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

Disassembly:
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov ebp, ecx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
cmp dword [esp + 0x10], 5
jle 0x4060a7
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esp + 0x14]
cmp eax, 0x1388
ja 0x406264
mov ebx, dword [esp + 0x10]
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x1c]
inc ebx
push eax
push 0x4004667f
push ecx
mov dword [esp + 0x1c], ebx
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
jne 0x4061ed
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x406264
mov ecx, dword [ebp + 4]
lea edx, [esp + 0x20]
lea eax, [esp + 0x24]
push edx
push eax
lea esi, [ebp + 0xa4068]
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 0x406202
mov ecx, ebp
call fcn.00405fe0
mov ebx, eax
lea ecx, [edi - 4]
push ebx
mov dword [ebx + 4], ecx
mov edx, dword [esi]
mov eax, ecx
lea esi, [ebp + 0xa406c]
lea edi, [ebx + 0x10]
mov dword [ebx + 0xc], 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 0x40617b
push 0x410178
call fcn.00401430
mov al, byte [ebx + 0xa]
add esp, 4
test al, al
je 0x406165
push ebx
call fcn.004067aa
add esp, 4
jmp 0x40608b
mov byte [ebx + 9], 0
mov eax, dword [ebp + 0xa4064]
dec eax
mov dword [ebp + 0xa4064], eax
jmp 0x40608b
push 0x7f000001
mov dword [ebx], 0
call sub.WSOCK32.dll_htonl
mov ecx, dword [esp + 0x28]
cmp ecx, eax
jne 0x40619c
mov eax, dword [0x411bd8]
mov dword [ebx], eax
jmp 0x40619e
mov dword [ebx], ecx
mov ecx, dword [ebp + 0x30]
mov eax, dword [ebp + 0x38]
lea esi, [ebp + 0x28]
cmp eax, ecx
jl 0x4061d9
mov al, byte [esi + 0xd]
test al, al
jne 0x4061ba
test ecx, ecx
jne 0x40608b
mov eax, dword [esi + 0x14]
test eax, eax
jle 0x40608b
mov edx, dword [esi]
add eax, ecx
push 0
push eax
mov ecx, esi
call dword [edx + 8]
test al, al
je 0x40608b
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
jmp 0x40608b
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x410154
call fcn.00401430
add esp, 8
jmp 0x406264
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x410130
call fcn.00401430
mov eax, dword [ebp + 4]
add esp, 8
cmp eax, 0xffffffff
mov dword [esp + 0x10], 4
je 0x406264
lea ecx, [esp + 0x10]
lea edx, [esp + 0x14]
push ecx
push edx
push 0x1007
push 0xffff
push eax
call sub.WSOCK32.dll_getsockopt
mov eax, dword [esp + 0x10]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x14]
push eax
push ecx
push 0x1007
push 0xffff
push edx
mov dword [esp + 0x28], 0
call sub.WSOCK32.dll_setsockopt
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ebx, eax
mov eax, dword [ebp + 0x50]
xor edi, edi
test eax, eax
je 0x4063e3
cmp edi, 5
jle 0x406291
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, ebx
cmp eax, 0x1388
ja 0x4063e3
mov eax, dword [ebp + 0x44]
mov cx, word [ebp + 0xc]
push ecx
inc edi
mov esi, dword [eax]
mov word [esp + 0x28], 2
call sub.WSOCK32.dll_htons
mov word [esp + 0x26], ax
mov edx, dword [esi]
push 0x411bd8
push esi
lea ecx, [esp + 0x1c]
mov dword [esp + 0x30], edx
call fcn.00404ab0
mov ecx, eax
call fcn.00404b20
test al, al
je 0x4062db
push 0x7f000001
call sub.WSOCK32.dll_htonl
mov dword [esp + 0x28], eax
mov ecx, dword [esi + 4]
lea eax, [esp + 0x24]
push 0x10
push eax
mov eax, dword [ebp + 4]
add ecx, 4
push 0
lea edx, [esi + 0xc]
push ecx
push edx
push eax
call sub.WSOCK32.dll_sendto
cmp eax, 0xffffffff
je 0x406358
mov eax, dword [ebp + 0x50]
test eax, eax
jle 0x406322
lea ecx, [eax - 1]
xor eax, eax
test ecx, ecx
mov dword [ebp + 0x50], ecx
jle 0x406322
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 0x406310
mov al, byte [esi + 0xa]
test al, al
je 0x406334
push esi
call fcn.004067aa
add esp, 4
jmp 0x406345
mov byte [esi + 9], 0
mov eax, dword [ebp + 0xa4064]
dec eax
mov dword [ebp + 0xa4064], eax
mov eax, dword [ebp + 0x50]
test eax, eax
jne 0x406279
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x4063ce
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x410110
call fcn.00401430
mov eax, dword [ebp + 4]
add esp, 8
cmp eax, 0xffffffff
mov dword [esp + 0x14], 4
je 0x4063e3
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, 0x24
ret
push 0x4100f0
call fcn.00401430
add esp, 4
push 0x19
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret