Function at 0x402660
Capabilities:
Print debug messages
Set socket configuration

Disassembly:
sub esp, 0x18
mov eax, dword [0x443d3c]
xor eax, esp
mov dword [esp + 0x14], eax
push ebx
mov ebx, dword [esp + 0x20]
push ebp
mov ebp, dword [esp + 0x28]
push esi
xor eax, eax
push 0x438874
push 0xa16b
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov word [esp + 0x24], ax
lea eax, [esp + 0x1c]
mov esi, ecx
push str._d__s
push eax
mov dword [esi + 4], 0x40
call fcn.004200a5
push str.GetDownloadServerIPaPORT::InitWinSock___call
call fcn.00404f70
add esp, 0x14
call fcn.0040d3c0
test al, al
jne 0x4026e3
push str.GetDownloadServerIPaPORT::InitWinSock___failed
call fcn.00404f70
add esp, 4
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
push str.GetDownloadServerIPaPORT::CreateTcpSocket___call
call fcn.00404f70
push esi
call fcn.0040d410
add esp, 8
test al, al
jne 0x40271d
push str.Failed_in_CGateInfo::CreateTcpSocket__
call fcn.00404f70
add esp, 4
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
push str.GetDownloadServerIPaPORT::SyncConnectWithTimeOut___call
call fcn.00404f70
mov ecx, dword [esi + 0x14]
push 0x2710
push 0x2bd
push ecx
push esi
call fcn.0040d5d0
add esp, 0x14
test al, al
jne 0x402770
push str.Failed_in_CGateInfo::SyncConnectWithTimeOut__
call fcn.00404f70
add esp, 4
push str.ERROR_:_Cant_connect_to_Gate___GateInfo_line_79_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
mov eax, dword [esi]
push edi
mov edi, dword [sym.imp.WSOCK32.dll_setsockopt]
push 4
lea edx, [esp + 0x14]
push edx
push 0x1005
push 0xffff
push eax
mov dword [esp + 0x24], 0x1388
call edi
test eax, eax
je 0x4027c4
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.GetDownloadServerIPaPORT::setsockopt_SO_SNDTIME0___failed_error__d
call fcn.00404f70
add esp, 8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
mov edx, dword [esi]
push 4
lea ecx, [esp + 0x14]
push ecx
push 0x1006
push 0xffff
push edx
call edi
test eax, eax
je 0x402809
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.GetDownloadServerIPaPORT::setsockopt_SO_RCVTIME0___failed_error__d
call fcn.00404f70
add esp, 8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
push str.GetDownloadServerIPaPORT::SyncSend___call
call fcn.00404f70
mov eax, dword [esi + 4]
push eax
lea ecx, [esp + 0x20]
push ecx
push esi
call fcn.0040d460
add esp, 0x10
test al, al
jne 0x40284d
push str.GetDownloadServerIPaPORT::SyncSend___failed
call fcn.00404f70
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
push str.GetDownloadServerIPaPORT::CreateNewThread___call
mov dword [esp + 0x18], 0
call fcn.00404f70
lea edx, [esp + 0x18]
push edx
push esi
push 0x4023a0
call fcn.0040cc90
mov edi, eax
push edi
push str.GetDownloadServerIPaPORT::CreateNewThread___handle__x
call fcn.00404f70
add esp, 0x18
push 0x2710
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x4028c1
test edi, edi
je 0x4028c1
push str.GetDownloadServerIPaPORT::WaitForSingleObject___timeout
call fcn.00404f70
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
push str.GetDownloadServerIPaPORT::ParseReplay___call
call fcn.00404f70
add esp, 4
mov ecx, esi
call fcn.004025e0
test al, al
jne 0x4028fd
push str.GetDownloadServerIPaPORT::ParseReplay___failed
call fcn.00404f70
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.0042050e
add esp, 0x18
ret 8
mov ecx, dword [esi + 0xc]
mov edx, ebx
mov al, byte [ecx]
mov byte [edx], al
add ecx, 1
add edx, 1
test al, al
jne 0x402902
mov eax, dword [esi + 0x10]
mov dword [ebp], eax
cmp dword [esi], 0
je 0x402924
push esi
call fcn.0040d4c0
add esp, 4
mov ecx, dword [esp + 0x24]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov al, 1
call fcn.0042050e
add esp, 0x18
ret 8