Function at 0x408150
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x560
mov eax, dword [0x44a00c]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
cmp dword [edi + 0xc], 0
jge 0x408186
mov eax, dword [edi + 4]
mov edx, str.503_Bad_sequence_of_commands._r_n
push dword [eax + 0xc8]
push 0x1f
jmp 0x4084a5
mov al, byte [ebx]
push 0x400
mov byte [ebp - 0x545], al
lea eax, [ebp - 0x40c]
push 0
push eax
call fcn.0041ea80
add esp, 0xc
lea eax, [ebx + 5]
mov ecx, edi
push eax
lea eax, [ebp - 0x40c]
push eax
call fcn.00407280
cmp byte [ebp - 0x545], 0x72
mov esi, 0x4443e8
mov eax, dword [edi + 0x78]
mov ecx, dword [edi + 0x7c]
mov dword [ebp - 0x550], eax
mov dword [ebp - 0x54c], ecx
je 0x4081e4
or eax, ecx
mov esi, 0x444928
jne 0x4081e4
mov esi, 0x44492c
push 5
push str.stou
push ebx
call fcn.00424470
add esp, 0xc
test eax, eax
jne 0x408219
mov eax, dword [edi + 4]
lea ecx, [ebp - 0x544]
push edi
push ecx
lea ecx, [ebp - 0x40c]
mov eax, dword [eax + 0xec]
push ecx
call eax
add esp, 0xc
test eax, eax
je 0x408251
mov eax, dword [edi + 4]
lea ecx, [ebp - 0x40c]
push edi
push esi
push ecx
mov eax, dword [eax + 0xfc]
call eax
mov ebx, eax
add esp, 0xc
mov dword [ebp - 0x558], ebx
test ebx, ebx
jne 0x408266
push esi
lea eax, [ebp - 0x40c]
push eax
push str.open___s__mode__s__error_n
call fcn.0040eaf0
add esp, 0xc
mov eax, dword [edi + 4]
mov edx, str.550_cant_open_file__r_n
push dword [eax + 0xc8]
push 0x16
jmp 0x4084a5
mov eax, dword [edi + 4]
push edi
push dword [ebp - 0x54c]
push dword [ebp - 0x550]
mov eax, dword [eax + 0x100]
push ebx
call eax
add esp, 0x10
test eax, eax
jns 0x4082bd
call fcn.00422fff
push edi
push ebx
mov esi, dword [eax]
mov eax, dword [edi + 4]
mov eax, dword [eax + 0x10c]
call eax
push esi
push dword [ebp - 0x54c]
lea eax, [ebp - 0x40c]
push dword [ebp - 0x550]
push eax
push str.set_file___s__pointer___lld__error_d_n
call fcn.0040eaf0
add esp, 0x1c
jmp 0x408251
mov eax, dword [edi + 4]
mov edx, str.150_Opening_ASCII_mode_data_connection_for_ls._r_n
mov ecx, dword [edi + 8]
push dword [eax + 0xc8]
push 0x30
call fcn.00401770
add esp, 8
test eax, eax
jg 0x4082f2
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041be62
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 4]
mov eax, dword [eax + 0xe8]
push eax
mov dword [ebp - 0x54c], eax
call fcn.00423370
add esp, 4
mov esi, eax
cmp byte [ebp - 0x545], 0x72
jne 0x408380
mov ecx, dword [edi + 4]
push edi
push dword [ebp - 0x54c]
mov ecx, dword [ecx + 0x104]
push esi
push ebx
call ecx
add esp, 0x10
test eax, eax
jle 0x40836a
mov ecx, dword [edi + 4]
mov edx, esi
push dword [ecx + 0xc8]
mov ecx, dword [edi + 0xc]
push eax
call fcn.00401770
add esp, 8
test eax, eax
jle 0x40841e
mov eax, dword [edi + 4]
push edi
push dword [ebp - 0x54c]
mov eax, dword [eax + 0x104]
push esi
push ebx
call eax
add esp, 0x10
test eax, eax
jg 0x408330
test eax, eax
mov ebx, str.226_Transfer_complete._r_n
mov ecx, str.426_Connection_closed__transfer_aborted._r_n
cmovs ebx, ecx
jmp 0x408437
mov eax, dword [edi + 4]
mov edx, dword [edi + 0xc]
mov dword [ebp - 0x550], 0
mov dword [ebp - 0x554], edx
mov ecx, dword [eax + 0xc8]
lea eax, [ebp - 0x560]
test ecx, ecx
mov dword [ebp - 0x510], edx
mov dword [ebp - 0x514], 1
cmove eax, dword [ebp - 0x550]
push eax
push 0
push 0
lea eax, [ebp - 0x514]
mov dword [ebp - 0x560], ecx
push eax
lea eax, [edx + 1]
mov dword [ebp - 0x55c], 0
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
js 0x408425
je 0x408425
push 0
push dword [ebp - 0x54c]
push esi
push dword [ebp - 0x554]
call dword [sym.imp.WS2_32.dll_recv]
mov ecx, eax
test ecx, ecx
js 0x408425
jle 0x408428
mov eax, dword [edi + 4]
push edi
push ecx
push esi
mov eax, dword [eax + 0x108]
push ebx
call eax
add esp, 0x10
test eax, eax
jg 0x408380
mov ebx, str.426_Connection_closed__transfer_aborted._r_n
jmp 0x408437
or ecx, 0xffffffff
test ecx, ecx
mov ebx, str.226_Transfer_complete._r_n
mov eax, str.426_Connection_closed__transfer_aborted._r_n
cmovs ebx, eax
push esi
call fcn.004230f4
mov eax, dword [edi + 4]
add esp, 4
mov dword [edi + 0x78], 0
mov dword [edi + 0x7c], 0
mov eax, dword [eax + 0x10c]
push edi
push dword [ebp - 0x558]
call eax
add esp, 8
cmp ebx, str.226_Transfer_complete._r_n
jne 0x408476
push 2
push dword [edi + 0xc]
call dword [sym.imp.WS2_32.dll_shutdown]
push dword [edi + 0xc]
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, ebx
mov dword [edi + 0xc], 0xffffffff
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408490
mov eax, dword [edi + 4]
sub ecx, edx
mov edx, ebx
push dword [eax + 0xc8]
push ecx
mov ecx, dword [edi + 8]
call fcn.00401770
xor ecx, ecx
add esp, 8
test eax, eax
setg cl
pop edi
pop esi
pop ebx
lea eax, [ecx - 1]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041be62
mov esp, ebp
pop ebp
ret 4