Function at 0x4059b0
Capabilities:
Check for time delay via gettickcount
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20008
call fcn.00465040
mov eax, dword [0x4c07e0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, 0x20000
mov esi, ecx
mov ebx, edi
mov ecx, edi
cmp dword [ebp + 8], ebx
cmovbe ebx, dword [ebp + 8]
cmp dword [ebp + 0xc], ecx
cmovbe ecx, dword [ebp + 0xc]
mov dword [ebp - 0x20008], ecx
mov ecx, esi
call fcn.004040e0
test al, al
jne 0x405a03
mov ecx, esi
call fcn.00404000
test eax, eax
je 0x405ec0
mov ecx, esi
call fcn.00404070
test eax, eax
jne 0x405ec0
mov eax, dword [esi + 0x402fc]
test eax, eax
jle 0x405bba
sub edi, dword [esi + 0x402f8]
mov ecx, esi
cmp edi, eax
cmovg edi, eax
call fcn.004040e0
test al, al
je 0x405aa1
lea ecx, [esi + 0x4061c]
call fcn.00403a90
cmp eax, 1
jg 0x405a64
mov eax, dword [esi + 0x40680]
mov ecx, dword [esi + 0x402f8]
sub eax, ecx
add eax, 0x28
cmp edi, eax
cmovg edi, eax
test edi, edi
jns 0x405aa7
xor edi, edi
jmp 0x405aa7
lea ecx, [esi + 0x4061c]
call fcn.00403a90
mov ecx, dword [esi + 0x402f8]
cmp eax, 2
jg 0x405aa7
mov eax, dword [esi + 0x40698]
add eax, dword [esi + 0x40680]
add eax, dword [esi + 0x40684]
sub eax, ecx
add eax, 0x228
cmp edi, eax
cmovg edi, eax
xor eax, eax
test edi, edi
cmovs edi, eax
jmp 0x405aa7
mov ecx, dword [esi + 0x402f8]
cmp edi, ebx
cmovg edi, ebx
test edi, edi
jle 0x405bb5
push 0
push edi
lea eax, [esi + 0x202ee]
add eax, ecx
push eax
push dword [esi + 0x2e8]
call dword [sym.imp.WS2_32.dll_send]
mov ecx, eax
cmp ecx, 0xffffffff
jne 0x405b07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x405bb5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
mov dword [esi + 0x40330], 2
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00464e2f
mov esp, ebp
pop ebp
ret 8
test ecx, ecx
jle 0x405bb5
mov eax, ecx
cdq
add dword [esi + 0x40310], eax
adc dword [esi + 0x40314], edx
add dword [esi + 0x402f8], ecx
sub dword [esi + 0x402fc], ecx
mov ecx, esi
mov ebx, dword [esi + 0x402f8]
call fcn.004040e0
test al, al
je 0x405b9c
push 2
lea ecx, [esi + 0x4061c]
call fcn.004072f0
test al, al
jne 0x405b5f
mov eax, dword [esi + 0x40680]
add eax, 0x28
cmp ebx, eax
jl 0x405b9c
push 1
push 2
jmp 0x405b91
push 0x10
lea ecx, [esi + 0x4061c]
call fcn.004072f0
test al, al
jne 0x405b9c
mov ecx, dword [esi + 0x40698]
mov eax, dword [esi + 0x40684]
add ecx, dword [esi + 0x40680]
add eax, 0x228
add eax, ecx
cmp ebx, eax
jl 0x405b9c
push 1
push 0x10
lea ecx, [esi + 0x4061c]
call fcn.00407370
mov edi, 0x20000
cmp dword [esi + 0x402f8], edi
jl 0x405bba
mov dword [esi + 0x402f8], 0
jmp 0x405bba
mov edi, 0x20000
or ebx, 0xffffffff
cmp dword [ebp - 0x20008], 0
jle 0x405e45
sub edi, dword [esi + 0x402f4]
lea eax, [ebp - 0x20004]
push 0x20000
push 0
push eax
call fcn.00466b60
add esp, 0xc
test edi, edi
jle 0x405e45
push 0
push edi
lea eax, [ebp - 0x20004]
push eax
push dword [esi + 0x2e8]
call dword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
test ebx, ebx
jns 0x405c24
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x405c22
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x405ae4
test ebx, ebx
jle 0x405e45
mov eax, dword [esi + 0x402f0]
lea edi, [eax + ebx]
add eax, 0x2ee
add eax, esi
cmp edi, 0x20000
jl 0x405c8d
add edi, 0xfffe0000
mov ecx, ebx
sub ecx, edi
push ecx
mov dword [ebp - 0x20008], ecx
lea ecx, [ebp - 0x20004]
push ecx
push eax
call fcn.00466cc0
add esp, 0xc
test edi, edi
je 0x405c85
mov eax, dword [ebp - 0x20008]
push edi
lea eax, [ebp + eax - 0x20004]
push eax
lea eax, [esi + 0x2ee]
push eax
call fcn.00466cc0
add esp, 0xc
mov dword [esi + 0x402f0], edi
jmp 0x405ca4
push ebx
lea ecx, [ebp - 0x20004]
push ecx
push eax
call fcn.00466cc0
add esp, 0xc
add dword [esi + 0x402f0], ebx
mov eax, ebx
mov ecx, esi
cdq
add dword [esi + 0x40318], eax
adc dword [esi + 0x4031c], edx
add dword [esi + 0x402f4], ebx
call fcn.004040e0
test al, al
je 0x405e45
lea edi, [esi + 0x4061c]
push 1
mov ecx, edi
call fcn.004072f0
test al, al
jne 0x405cfd
cmp dword [esi + 0x402f0], 0x28
jl 0x405cfd
push 1
push 1
mov ecx, edi
call fcn.00407370
mov ecx, esi
call fcn.00406370
add dword [esi + 0x402f4], 0xffffffd8
push 1
mov ecx, edi
call fcn.004072f0
test al, al
je 0x405d3f
push 4
mov ecx, edi
call fcn.004072f0
test al, al
jne 0x405d3f
mov eax, dword [esi + 0x4068c]
add eax, 0x28
cmp dword [esi + 0x402f0], eax
jl 0x405d3f
push 1
push 4
mov ecx, edi
call fcn.00407370
mov eax, dword [esi + 0x4068c]
sub dword [esi + 0x402f4], eax
push 1
mov ecx, edi
call fcn.004072f0
test al, al
je 0x405db0
push 4
mov ecx, edi
call fcn.004072f0
test al, al
je 0x405db0
push 8
mov ecx, edi
call fcn.004072f0
test al, al
jne 0x405db0
mov ecx, dword [esi + 0x4068c]
mov eax, dword [esi + 0x40690]
add ecx, dword [esi + 0x40698]
add eax, 0x228
add eax, ecx
cmp dword [esi + 0x402f0], eax
jl 0x405db0
push 1
push 8
mov ecx, edi
call fcn.00407370
mov ecx, esi
call fcn.004066e0
mov eax, 0xfffffe00
sub eax, dword [esi + 0x40698]
sub eax, dword [esi + 0x40690]
add dword [esi + 0x402f4], eax
mov ecx, edi
call fcn.00403a90
cmp eax, 3
jne 0x405e12
push 1
push 0x20
mov ecx, edi
call fcn.00407370
mov ecx, dword [esi + 0x40698]
mov eax, dword [esi + 0x40684]
add ecx, dword [esi + 0x40680]
add eax, 0x228
mov edx, dword [esi + 0x402f8]
add ecx, eax
mov eax, dword [esi + 0x402fc]
cmp edx, ecx
jge 0x405df6
sub edx, ecx
add eax, edx
mov edx, ecx
test eax, eax
jle 0x405e12
push eax
lea eax, [esi + 0x202ee]
mov ecx, esi
add eax, edx
push eax
call fcn.00406180
mov ecx, esi
call fcn.00405890
mov ecx, edi
call fcn.00403a90
cmp eax, 4
jne 0x405e45
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi + 0x2e0], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add eax, 0x4e20
mov dword [esi + 0x40330], 7
mov dword [esi + 0x43e80], eax
mov ecx, esi
call fcn.00404000
test eax, eax
je 0x405ec0
mov ecx, esi
call fcn.00404070
test eax, eax
jne 0x405ec0
test ebx, ebx
jle 0x405e7e
mov byte [esi + 0x2dc], 1
mov dword [esi + 0x40330], 9
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi + 0x43e80], eax
jmp 0x405e88
mov dword [esi + 0x40330], 8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esi + 0x2e0]
cmp eax, 0x7530
jbe 0x405ea4
cmp byte [esi + 0x2dc], 0
je 0x405eb7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esi + 0x43e80]
cmp eax, 0x15ba8
jbe 0x405ec0
push 0
mov ecx, esi
call fcn.00405380
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00464e2f
mov esp, ebp
pop ebp
ret 8