Function at 0x408420
Capabilities:
Get socket status
Initialize winsock library
Receive data
Receive data on socket

Disassembly:
sub esp, 0xae8
mov eax, dword [0x41c050]
xor eax, esp
mov dword [esp + 0xae4], eax
mov eax, dword [esp + 0xaec]
push ebx
push ebp
push esi
mov esi, ecx
push edi
lea ecx, [esp + 0x1c]
mov dword [esp + 0x20], eax
xor eax, eax
push ecx
mov edi, edx
push eax
mov ecx, esi
mov dword [esp + 0x40], edi
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], eax
call fcn.00408860
mov ebp, eax
add esp, 8
mov ecx, esi
mov dword [esp + 0x28], ebp
call fcn.00408de0
mov ebx, eax
mov dword [esp + 0x54], ebx
test edi, edi
je 0x408482
mov dword [edi], 0
test ebx, ebx
je 0x408752
test ebp, ebp
je 0x40875f
push 0x190
lea edx, [esp + 0x164]
push 0
push edx
call fcn.0040b7d0
add esp, 0xc
lea eax, [esp + 0x160]
push eax
push 0x202
mov dword [esp + 0x44], 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
jne 0x408752
call fcn.00408ca0
mov ebp, eax
mov dword [esp + 0x4c], ebp
cmp ebp, 0xffffffff
je 0x40874e
mov edi, dword [esp + 0x28]
xor esi, esi
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov eax, edi
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], 1
mov dword [esp + 0x44], 0x19
lea ecx, [eax + 1]
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x408510
sub eax, ecx
push eax
push edi
push ebp
call fcn.00408ef0
add esp, 0xc
xor edi, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x40], esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x30], 1
mov dword [esp + 0x24], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x10], esi
jmp 0x408552
xor esi, esi
lea ecx, [esp + 0x44]
push ecx
push esi
push esi
lea edx, [esp + 0x64]
push edx
push esi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x408743
lea eax, [esp + 0x58]
push eax
push ebp
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x408743
push esi
push 0x800
lea ecx, [esp + 0x2f8]
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
jle 0x408798
add dword [esp + 0x24], esi
cmp dword [esp + 0x30], 1
jne 0x4085ce
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x48]
push ecx
lea edx, [esp + 0x2fc]
push edx
call fcn.004087b0
mov edi, dword [esp + 0x28]
add esp, 0x10
test edi, edi
je 0x4086b2
mov eax, dword [esp + 0x14]
push edi
call fcn.00409100
mov ebx, dword [esp + 0x18]
add esp, 4
mov ecx, edi
mov ebp, eax
call fcn.00409060
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x1c], eax
sub eax, ebp
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], 0
test ecx, ecx
je 0x40860c
mov dword [ecx], eax
mov ebx, dword [esp + 0x14]
call fcn.004091f0
cmp eax, 0xc8
jne 0x408699
mov eax, dword [esp + 0x18]
mov esi, ebx
mov ebx, dword [esp + 0x20]
sub esi, ebp
cmp dword [ebx], 0
lea edi, [eax + ebp]
mov dword [esp + 0x50], 1
jne 0x408669
mov ecx, dword [esp + 0x34]
push ecx
call fcn.0040a769
add esp, 4
mov dword [ebx], eax
test eax, eax
jne 0x408669
mov edi, dword [esp + 0x18]
xor ebx, ebx
test eax, eax
mov eax, dword [esp + 0x14]
sete bl
sub eax, ebp
add dword [esp + 0x10], eax
mov ebp, dword [esp + 0x4c]
jmp 0x40870b
mov edx, dword [ebx]
add edx, dword [esp + 0x10]
push esi
push edi
push edx
call fcn.0040b850
mov eax, dword [esp + 0x5c]
mov edi, dword [esp + 0x24]
xor ebx, ebx
add esp, 0xc
test eax, eax
mov eax, dword [esp + 0x14]
sete bl
sub eax, ebp
add dword [esp + 0x10], eax
mov ebp, dword [esp + 0x4c]
jmp 0x40870b
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
sub eax, ebp
add dword [esp + 0x10], eax
mov ebp, dword [esp + 0x4c]
mov ebx, 1
jmp 0x40870b
cmp dword [esp + 0x30], 0
jne 0x40870b
mov ecx, dword [esp + 0x20]
cmp dword [ecx], 0
mov ebx, 1
jne 0x4086e2
mov edx, dword [esp + 0x34]
push edx
call fcn.0040a769
mov ecx, dword [esp + 0x24]
add esp, 4
mov dword [ecx], eax
test eax, eax
jne 0x4086e2
xor ebx, ebx
jmp 0x4086fe
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
add ecx, dword [esp + 0x10]
push esi
lea edx, [esp + 0x2f4]
push edx
push ecx
call fcn.0040b850
add esp, 0xc
xor edx, edx
test ebx, ebx
sete dl
add dword [esp + 0x10], esi
mov ebx, edx
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x24]
jg 0x408722
test eax, eax
jle 0x408722
mov ebx, 1
mov dword [esp + 0x2c], ebx
test edi, edi
je 0x40873b
push edi
call fcn.0040a6f4
mov dword [esp + 0x1c], 0
mov edi, dword [esp + 0x1c]
add esp, 4
test ebx, ebx
je 0x408550
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
mov ebx, dword [esp + 0x54]
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x40875f
push ebp
call fcn.0040a6f4
add esp, 4
test ebx, ebx
je 0x40876c
push ebx
call fcn.0040a6f4
add esp, 4
cmp word [esp + 0x3c], 0
je 0x408779
call sub.WS2_32.dll_WSACleanup
mov ecx, dword [esp + 0xaf4]
mov eax, dword [esp + 0x2c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040a6e5
add esp, 0xae8
ret 4
je 0x408743
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2733
jne 0x408743
jmp 0x408550