2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-04-24 23:33:34 +03:00

Tabify and formatting.

This commit is contained in:
Lev 2017-01-25 15:16:48 +05:00
parent 79164dc618
commit be5b192ed0

View File

@ -40,7 +40,7 @@ void PrintBinaryArray(const char* data, int dataLen, std::stringstream &ss)
{ {
ss << "["; ss << "[";
for (int i = 0; i < dataLen; i++) for (int i = 0; i < dataLen; i++)
ss << " " << (unsigned int) (unsigned char)data[i]; ss << " " << (unsigned int)(unsigned char)data[i];
ss << "]"; ss << "]";
} }
@ -695,15 +695,19 @@ bool CSendToCall::compareInputArgs(IEngExtCall* other, bool strict)
if (strict) { if (strict) {
if (otherCall->m_Len != m_Len) if (otherCall->m_Len != m_Len)
return false; return false;
} else { }
else {
int maxDiff; int maxDiff;
if (m_Len < 40) { if (m_Len < 40) {
maxDiff = 10; maxDiff = 10;
} else if (m_Len < 90) { }
else if (m_Len < 90) {
maxDiff = 15; maxDiff = 15;
} else if (m_Len < 120) { }
else if (m_Len < 120) {
maxDiff = 18; maxDiff = 18;
} else { }
else {
maxDiff = m_Len / 8; maxDiff = m_Len / 8;
} }
if (abs(otherCall->m_Len - m_Len) > maxDiff) if (abs(otherCall->m_Len - m_Len) > maxDiff)
@ -3220,7 +3224,7 @@ IEngExtCall* IEngExtCallFactory::createByOpcode(ExtCallFuncs opc, void* buf, int
case ECF_CLOSE_SOCKET: IEngExtCallFactory_CreateFuncCall(CCloseSocketCall, buf, ptrSize); case ECF_CLOSE_SOCKET: IEngExtCallFactory_CreateFuncCall(CCloseSocketCall, buf, ptrSize);
case ECF_RECVFROM: IEngExtCallFactory_CreateFuncCall(CRecvFromCall, buf, ptrSize); case ECF_RECVFROM: IEngExtCallFactory_CreateFuncCall(CRecvFromCall, buf, ptrSize);
case ECF_SENDTO: IEngExtCallFactory_CreateFuncCall(CSendToCall, buf, ptrSize); case ECF_SENDTO: IEngExtCallFactory_CreateFuncCall(CSendToCall, buf, ptrSize);
case ECF_BIND: IEngExtCallFactory_CreateFuncCall(CBindCall , buf, ptrSize); case ECF_BIND: IEngExtCallFactory_CreateFuncCall(CBindCall, buf, ptrSize);
case ECF_GET_SOCK_NAME: IEngExtCallFactory_CreateFuncCall(CGetSockNameCall, buf, ptrSize); case ECF_GET_SOCK_NAME: IEngExtCallFactory_CreateFuncCall(CGetSockNameCall, buf, ptrSize);
case ECF_WSA_GET_LAST_ERROR: IEngExtCallFactory_CreateFuncCall(CWSAGetLastErrorCall, buf, ptrSize); case ECF_WSA_GET_LAST_ERROR: IEngExtCallFactory_CreateFuncCall(CWSAGetLastErrorCall, buf, ptrSize);