Function at 0x406ca0
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0x44
push ebx
push ebp
push esi
push edi
mov ebp, ecx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 0
mov esi, dword [esp + 0x14]
cmp esi, 5
jle 0x406cd9
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esp + 0x10]
cmp eax, 0x7d0
ja 0x406e48
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x1c]
push eax
inc esi
push 0x4004667f
push ecx
mov dword [esp + 0x20], esi
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
jne 0x406e58
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x406ecf
mov ecx, dword [ebp + 4]
lea edx, [esp + 0x20]
lea eax, [esp + 0x44]
push edx
push eax
lea esi, [ebp + 0xa5068]
push 0
push 0x280
push esi
push ecx
mov dword [esp + 0x38], 0x10
call sub.WSOCK32.dll_recvfrom
mov edi, eax
cmp edi, 0xffffffff
je 0x406e6d
mov ecx, ebp
call fcn.00406c10
mov ebx, eax
lea ecx, [edi - 4]
push ebx
mov dword [ebx + 4], ecx
mov edx, dword [esi]
mov eax, ecx
lea esi, [ebp + 0xa506c]
lea edi, [ebx + 0x14]
mov dword [ebx + 0x10], edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebp]
mov ecx, ebp
call dword [edx + 4]
test al, al
jne 0x406da9
push str.Throwing_away_malformed_packet_n
call fcn.00401450
mov al, byte [ebx + 0xa]
add esp, 4
test al, al
je 0x406d93
push ebx
call fcn.00407530
add esp, 4
jmp 0x406cbb
mov byte [ebx + 9], 0
mov eax, dword [ebp + 0xa5064]
dec eax
mov dword [ebp + 0xa5064], eax
jmp 0x406cbb
mov dword [ebx], 0
mov eax, dword [esp + 0x48]
mov dword [ebx], eax
mov ecx, dword [esp + 0x46]
push ecx
call sub.WSOCK32.dll_ntohs
mov word [ebx + 0xc], ax
mov edx, dword [esp + 0x46]
push edx
call sub.WSOCK32.dll_ntohs
and eax, 0xffff
lea ecx, [esp + 0x24]
push eax
push 0
push ebx
call fcn.004054d0
mov ecx, eax
call fcn.00405570
push eax
push str.recvfrom__s____d_n
call fcn.00401450
mov eax, dword [ebp + 0x30]
mov ecx, dword [ebp + 0x38]
lea esi, [ebp + 0x28]
add esp, 0xc
cmp ecx, eax
jl 0x406e23
mov cl, byte [esi + 0xd]
test cl, cl
jne 0x406e0c
test eax, eax
jne 0x406e32
mov ecx, dword [esi + 0x14]
test ecx, ecx
jle 0x406e32
mov edx, dword [esi]
add ecx, eax
push 0
push ecx
mov ecx, esi
call dword [edx + 8]
test al, al
je 0x406e32
mov eax, dword [esi + 0x10]
mov edx, dword [esi + 4]
lea ecx, [eax + 1]
mov dword [esi + 0x10], ecx
mov dword [edx + eax*4], ebx
mov eax, dword [ebp + 0x38]
push eax
push str.InBuffers.Count_____d_n
call fcn.00401450
add esp, 8
jmp 0x406cbb
push esi
push str.Breaking_out_of_SocketHandlerClass::Service_read_loop._times___d_n
call fcn.00401450
add esp, 8
jmp 0x406ecf
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.ioctlsocket_returned_error_code__d_n
call fcn.00401450
add esp, 8
jmp 0x406ecf
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.recvfrom_returned_error_code__d_n
call fcn.00401450
mov eax, dword [ebp + 4]
add esp, 8
cmp eax, 0xffffffff
mov dword [esp + 0x14], 4
je 0x406ecf
lea ecx, [esp + 0x14]
lea edx, [esp + 0x10]
push ecx
push edx
push 0x1007
push 0xffff
push eax
call sub.WSOCK32.dll_getsockopt
mov eax, dword [esp + 0x14]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x10]
push eax
push ecx
push 0x1007
push 0xffff
push edx
mov dword [esp + 0x24], 0
call sub.WSOCK32.dll_setsockopt
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x50]
xor ebx, ebx
test eax, eax
je 0x407163
cmp ebx, 5
jle 0x406f00
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esp + 0x10]
cmp eax, 0x1388
ja 0x4070c2
mov eax, dword [ebp + 0x44]
inc ebx
mov esi, dword [eax]
mov word [esp + 0x44], 2
mov ax, word [esi + 0xc]
test ax, ax
jne 0x406f1d
mov cx, word [ebp + 0xc]
push ecx
jmp 0x406f1e
push eax
call sub.WSOCK32.dll_htons
mov word [esp + 0x46], ax
mov edx, dword [esi]
push 0x7f000001
mov dword [esp + 0x4c], edx
call sub.WSOCK32.dll_htonl
push 0x413408
push 0
push esi
lea ecx, [esp + 0x30]
mov dword [esp + 0x54], eax
call fcn.004054d0
mov ecx, eax
call fcn.004055b0
test al, al
je 0x406f84
cmp dword [ebp + 0xc], 0x4d4
jne 0x406f84
mov ax, word [esi + 0xc]
push 0x4d4
push eax
push esi
lea ecx, [esp + 0x38]
call fcn.004054d0
mov ecx, eax
call fcn.00405570
push eax
push str.Translating_address__s_to_loopback_address_on_port__d._n
jmp 0x406fe2
mov ax, word [0x413416]
test ax, ax
je 0x406fc2
xor edx, edx
lea ecx, [esp + 0x34]
mov dx, ax
mov ax, word [esi + 0xc]
push edx
push eax
push esi
call fcn.004054d0
mov ecx, eax
call fcn.00405570
push eax
push str.Translating_address__s_to_loopback_address_on_port__d_n
call fcn.00401450
mov cx, word [0x413416]
add esp, 0xc
jmp 0x406fee
mov edx, dword [ebp + 0xc]
mov ax, word [esi + 0xc]
push edx
push eax
push esi
lea ecx, [esp + 0x48]
call fcn.004054d0
mov ecx, eax
call fcn.00405570
push eax
push str.Translating_address__s_to_loopback_address_on_port__d_n
call fcn.00401450
mov cx, word [ebp + 0xc]
add esp, 0xc
push ecx
call sub.WSOCK32.dll_htons
mov edi, dword [esp + 0x48]
mov word [esp + 0x46], ax
mov edx, dword [esp + 0x46]
mov dword [esp + 0x14], edi
push edx
call sub.WSOCK32.dll_ntohs
mov ecx, dword [esp + 0x16]
mov edx, dword [esp + 0x15]
and eax, 0xffff
and ecx, 0xff
push eax
mov eax, dword [esp + 0x1b]
and eax, 0xff
and edx, 0xff
push eax
push ecx
and edi, 0xff
push edx
push edi
push str.sendto__d._d._d._d____d_n
call fcn.00401450
mov ecx, dword [esi + 4]
add esp, 0x18
lea eax, [esp + 0x44]
add ecx, 4
push 0x10
push eax
mov eax, dword [ebp + 4]
push 0
lea edx, [esi + 0x10]
push ecx
push edx
push eax
call sub.WSOCK32.dll_sendto
cmp eax, 0xffffffff
je 0x4070d8
mov eax, dword [ebp + 0x50]
test eax, eax
jle 0x40708c
lea ecx, [eax - 1]
xor eax, eax
test ecx, ecx
mov dword [ebp + 0x50], ecx
jle 0x40708c
mov ecx, dword [ebp + 0x44]
inc eax
mov edx, dword [ecx + eax*4]
mov dword [ecx + eax*4 - 4], edx
mov ecx, dword [ebp + 0x50]
cmp eax, ecx
jl 0x40707a
mov al, byte [esi + 0xa]
test al, al
je 0x40709e
push esi
call fcn.00407530
add esp, 4
jmp 0x4070af
mov byte [esi + 9], 0
mov eax, dword [ebp + 0xa5064]
dec eax
mov dword [ebp + 0xa5064], eax
mov eax, dword [ebp + 0x50]
test eax, eax
jne 0x406ee6
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push ebx
push str.Breaking_out_of_SocketHandlerClass::Service_write_loop._times___d_n
call fcn.00401450
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x40714e
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.sendto_returned_error_code__d_n
call fcn.00401450
mov eax, dword [ebp + 4]
add esp, 8
cmp eax, 0xffffffff
mov dword [esp + 0x14], 4
je 0x407163
lea ecx, [esp + 0x14]
lea edx, [esp + 0x10]
push ecx
push edx
push 0x1007
push 0xffff
push eax
call sub.WSOCK32.dll_getsockopt
mov eax, dword [esp + 0x14]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x10]
push eax
push ecx
push 0x1007
push 0xffff
push edx
mov dword [esp + 0x24], 0
call sub.WSOCK32.dll_setsockopt
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push str.sendto_returned_WSAEWOULDBLOCK_n
call fcn.00401450
add esp, 4
push 0x19
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret