Function at 0x409d54
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x414
push ebx
push esi
mov esi, ecx
push edi
xor edi, edi
mov eax, dword [esi + 0x78]
cmp eax, edi
je 0x409d6e
dec eax
jmp 0x409d70
xor eax, eax
cmp eax, edi
je 0x40a00a
cmp dword [esi + 0xb8], edi
je 0x40a00a
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x10], edi
push dword [esi + 0xb8]
lea ecx, [esi + 0x78]
call fcn.0040b6c3
push eax
call fcn.00408a89
pop ecx
cmp eax, 0xffffffff
pop ecx
mov dword [ebp - 4], eax
jne 0x409dd8
cmp dword [ebp - 0xc], edi
je 0x40a003
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], 0x3c
jle 0x409dbd
mov dword [ebp - 0xc], edi
push 0xffffffffffffffff
call sub.WS2_32.dll_closesocket
mov ecx, dword [esi + 0x34]
mov eax, dword [ebp + 8]
cmp dword [ecx + eax*4], edi
jne 0x40a014
jmp 0x409ff6
mov ebx, dword [ebp + 8]
cmp ebx, edi
je 0x409e23
mov eax, dword [esi + 0x40]
cmp eax, edi
je 0x409df2
push 0x2bf20
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [esi + 0xc0], edi
jne 0x40a018
movzx eax, byte [esi + 0xbc]
imul eax, eax, 0x401
cmp dword [esi + 0xb4], eax
jl 0x40a018
mov eax, dword [esi + 0x34]
cmp dword [eax + ebx*4], edi
jne 0x40a018
lea ecx, [ebp - 8]
mov eax, dword [esi]
push ecx
push edi
push dword [ebp - 0xc]
mov ecx, esi
mov dword [ebp - 8], edi
push ebx
push dword [ebp - 4]
call dword [eax + 0x20]
test eax, eax
jne 0x409e64
cmp dword [ebp - 0xc], edi
je 0x40a027
cmp dword [ebp - 4], edi
je 0x409e53
push dword [ebp - 4]
call sub.WS2_32.dll_closesocket
mov eax, dword [esi + 0x34]
cmp dword [eax + ebx*4], edi
jne 0x40a036
jmp 0x409ff6
mov edi, ebx
shl edi, 3
mov eax, dword [esi + 0x30]
mov ecx, dword [ebp - 8]
add eax, edi
mov edx, dword [eax + 4]
sub edx, dword [eax]
inc edx
cmp ecx, edx
jge 0x409fde
mov eax, dword [esi + 0x34]
xor edx, edx
cmp dword [eax + ebx*4], edx
jne 0x40a060
mov ebx, 0x401
lea eax, [ebp - 0x414]
push ebx
push edx
push eax
call fcn.0040e550
add esp, 0xc
lea eax, [ebp - 0x414]
push 0
push ebx
push eax
push dword [ebp - 4]
call sub.WS2_32.dll_recv
mov ebx, eax
test ebx, ebx
je 0x409fb3
cmp ebx, 0xffffffff
je 0x409fb3
test ebx, ebx
jle 0x409f72
push 0xea60
push dword [esi + 0x48]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x409f72
push eax
mov eax, dword [esi + 0x30]
mov eax, dword [edi + eax]
add eax, dword [ebp - 8]
push eax
push dword [esi + 0x4c]
call fcn.0040e2ef
mov eax, dword [esi + 0x30]
add esp, 0xc
push dword [esi + 0x4c]
lea ecx, [edi + eax]
mov eax, dword [edi + eax + 4]
sub eax, dword [ecx]
mov ecx, dword [ebp - 8]
add ecx, ebx
lea edx, [eax + 1]
cmp ecx, edx
jl 0x409f48
sub eax, dword [ebp - 8]
inc eax
push eax
lea eax, [ebp - 0x414]
push 1
push eax
call fcn.0040db18
mov eax, dword [esi + 0x30]
mov edx, dword [ebp + 8]
add esp, 0x10
lea ecx, [edi + eax]
mov eax, dword [edi + eax + 4]
sub eax, dword [ecx]
mov ecx, dword [esi + 0x38]
inc eax
mov dword [ebp - 8], eax
mov dword [ecx + edx*4], eax
jmp 0x409f69
push ebx
lea eax, [ebp - 0x414]
push 1
push eax
call fcn.0040db18
mov eax, dword [esi + 0x38]
mov ecx, dword [ebp + 8]
add dword [ebp - 8], ebx
add esp, 0x10
add dword [eax + ecx*4], ebx
lea eax, [eax + ecx*4]
push dword [esi + 0x48]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor ecx, ecx
cmp dword [ebp + 8], ecx
jne 0x409fa3
cmp dword [ebp - 0xc], ecx
je 0x409fa3
mov eax, dword [esi + 0x40]
cmp eax, ecx
je 0x409fa3
push ecx
movzx ecx, byte [esi + 0xbc]
dec ecx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
push dword [esi + 0x40]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [esi + 0x40], 0
and dword [ebp - 0xc], 0
and dword [ebp - 0x10], 0
mov ebx, dword [ebp + 8]
jmp 0x409e69
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x409fde
cmp dword [ebp - 0x10], 0x3c
jge 0x409fde
mov eax, dword [esi + 0x30]
push 0x3e8
add edi, eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0xc], 1
add dword [edi], eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 4], 0
je 0x409ff1
push dword [ebp - 4]
call sub.WS2_32.dll_closesocket
cmp eax, 0xffffffff
je 0x40a00a
inc dword [ebp - 0x10]
xor edi, edi
cmp dword [ebp - 0xc], edi
jne 0x409d8a
xor eax, eax
jmp 0x40a00d
push 0xffffffffffffffff
call sub.WS2_32.dll_closesocket
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret 4
cmp eax, edi
jmp 0x40a044
cmp dword [ebp - 4], edi
je 0x409fff
push dword [ebp - 4]
call sub.WS2_32.dll_closesocket
jmp 0x409fff
cmp dword [ebp - 4], edi
je 0x40a042
push dword [ebp - 4]
call sub.WS2_32.dll_closesocket
jmp 0x40a042
mov eax, dword [esi + 0x30]
mov ecx, dword [ebp - 8]
add dword [eax + ebx*8], ecx
lea eax, [eax + ebx*8]
cmp ebx, edi
jne 0x40a00a
mov eax, dword [esi + 0x40]
cmp eax, edi
je 0x40a00a
movzx ecx, byte [esi + 0xbc]
dec ecx
push edi
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
jmp 0x40a00a
mov eax, dword [esi + 0x30]
add dword [eax + ebx*8], ecx
cmp ebx, edx
lea eax, [eax + ebx*8]
jne 0x40a085
mov eax, dword [esi + 0x40]
cmp eax, edx
je 0x40a085
movzx ecx, byte [esi + 0xbc]
dec ecx
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
cmp dword [ebp - 4], 0
je 0x40a093
push dword [ebp - 4]
call sub.WS2_32.dll_closesocket
push 0xfffffffffffffffb
pop eax
jmp 0x40a00d