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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x97c
mov eax, dword [0x5c0020]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor esi, esi
push 0x800
mov dword [ebp - 0x970], edx
mov dword [ebp - 0x968], ecx
mov dword [ebp - 0x940], 0
mov dword [ebp - 0x964], 0
mov dword [ebp - 0x958], 0xffffffff
mov dword [ebp - 0x944], 0
mov dword [ebp - 0x96c], 0x800
mov dword [ebp - 0x93c], esi
mov dword [ebp - 0x954], 0x800
mov dword [ebp - 0x938], esi
call fcn.0053a7e0
add esp, 4
mov ebx, eax
push 0x800
mov dword [ebp - 0x934], ebx
call fcn.0053a7e0
add esp, 4
xor edi, edi
mov dword [ebp - 0x948], eax
mov byte [ebp - 0x24], 0
mov dword [ebp - 0x950], edi
jmp 0x40f8f8
mov esi, dword [ebp - 0x93c]
mov eax, dword [ebp - 0x968]
mov dword [ebp - 0x92c], eax
lea eax, [ebp - 0x97c]
push eax
push 0
push 0
lea eax, [ebp - 0x930]
push eax
push 0x40
mov dword [ebp - 0x930], 1
mov dword [ebp - 0x97c], 5
mov dword [ebp - 0x978], 0
call dword [sym.imp.WSOCK32.dll_select]
test eax, eax
js 0x40fe48
je 0x40fe69
push 0
push 0x800
lea eax, [ebp - 0x828]
push eax
push dword [ebp - 0x968]
call dword [sym.imp.WSOCK32.dll_recv]
mov ebx, eax
mov dword [ebp - 0x94c], ebx
test ebx, ebx
jns 0x40f98b
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.recv
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
test ebx, ebx
jle 0x40fe63
cmp dword [ebp - 0x940], 0
jne 0x40fbe9
xor eax, eax
add esi, ebx
mov dword [ebp - 0x94c], eax
cmp esi, dword [ebp - 0x96c]
jbe 0x40f9cc
mov eax, dword [ebp - 0x934]
push esi
push eax
call fcn.0053d33b
add esp, 8
mov dword [ebp - 0x934], eax
mov dword [ebp - 0x96c], esi
push ebx
mov ebx, dword [ebp - 0x934]
lea eax, [ebp - 0x828]
push eax
mov eax, dword [ebp - 0x93c]
add eax, ebx
push eax
call fcn.005398d0
mov edx, esi
add esp, 0xc
lea esi, [edx - 1]
xor eax, eax
mov dword [ebp - 0x93c], edx
test esi, esi
jle 0x40f8f2
mov edx, dword [ebp - 0x940]
lea ecx, [eax + 1]
lea esp, [esp]
test edx, edx
jne 0x40fa82
mov dl, byte [eax + ebx]
cmp dl, 0xd
jne 0x40fa4c
inc eax
inc ecx
cmp byte [eax + ebx], 0xa
jne 0x40fa68
mov edx, dword [ebp - 0x93c]
inc eax
inc ecx
cmp eax, edx
jge 0x40fa68
cmp byte [eax + ebx], 0xd
jne 0x40fa68
inc eax
inc ecx
cmp eax, edx
jge 0x40fa68
cmp byte [eax + ebx], 0xa
jne 0x40fa68
mov edx, ecx
mov dword [ebp - 0x940], edx
jmp 0x40fa6e
cmp dl, 0xa
mov edx, dword [ebp - 0x940]
jne 0x40fa6e
inc eax
inc ecx
cmp byte [eax + ebx], 0xa
cmove edx, ecx
mov dword [ebp - 0x940], edx
jmp 0x40fa6e
mov edx, dword [ebp - 0x940]
inc eax
inc ecx
cmp eax, esi
jl 0x40fa10
mov esi, dword [ebp - 0x93c]
test edx, edx
je 0x40f8f8
dec edx
xor esi, esi
mov dword [ebp - 0x95c], edx
test edx, edx
jle 0x40fbab
mov ecx, esi
mov edi, ecx
cmp ecx, edi
jg 0x40fac0
cmp byte [esi + ebx], 0x3a
jne 0x40fac0
mov ecx, esi
cmp esi, edx
jge 0x40fab8
mov al, byte [ebx + esi + 1]
cmp al, 0x20
je 0x40fab3
cmp al, 9
jne 0x40fab8
inc esi
cmp esi, edx
jl 0x40faa7
lea eax, [esi + 1]
jmp 0x40fb96
mov al, byte [esi + ebx]
cmp al, 0xd
je 0x40facf
cmp al, 0xa
jne 0x40fb9c
cmp ecx, edi
jle 0x40fb72
mov ebx, dword [ebp - 0x94c]
cmp ebx, ecx
jle 0x40fb6c
sub ecx, edi
add edi, dword [ebp - 0x934]
push ecx
push str.content_length
push edi
mov dword [ebp - 0x960], ecx
call fcn.00553474
add esp, 0xc
test eax, eax
jne 0x40fb1f
mov eax, dword [ebp - 0x934]
add eax, ebx
push eax
call fcn.00538964
add esp, 4
mov dword [ebp - 0x958], eax
jmp 0x40fb66
mov eax, dword [ebp - 0x960]
push eax
push str.transfer_encoding
push edi
call fcn.00553474
add esp, 0xc
test eax, eax
jne 0x40fb66
mov eax, dword [ebp - 0x934]
push 7
add eax, ebx
push str.chunked
push eax
call fcn.00553474
mov ecx, dword [ebp - 0x964]
add esp, 0xc
test eax, eax
mov eax, 1
cmove ecx, eax
mov dword [ebp - 0x964], ecx
mov edx, dword [ebp - 0x95c]
mov ebx, dword [ebp - 0x934]
mov ecx, dword [ebp - 0x93c]
cmp esi, ecx
jge 0x40fb90
lea esp, [esp]
mov al, byte [esi + ebx]
cmp al, 0xd
je 0x40fb8b
cmp al, 0xa
jne 0x40fb90
inc esi
cmp esi, ecx
jl 0x40fb80
mov edi, esi
mov ecx, esi
xor eax, eax
mov dword [ebp - 0x94c], eax
inc esi
cmp esi, edx
jl 0x40fa97
mov edi, dword [ebp - 0x950]
mov esi, dword [ebp - 0x93c]
mov eax, dword [ebp - 0x934]
add eax, dword [ebp - 0x940]
mov ebx, esi
sub ebx, dword [ebp - 0x940]
push ebx
push eax
lea eax, [ebp - 0x828]
push eax
mov dword [ebp - 0x94c], ebx
call fcn.005398d0
add esp, 0xc
cmp dword [ebp - 0x940], 0
je 0x40fc75
cmp dword [ebp - 0x964], 0
je 0x40fdcc
xor esi, esi
test ebx, ebx
jle 0x40fc6f
mov eax, dword [ebp - 0x944]
test eax, eax
jne 0x40fd33
test edi, edi
jne 0x40fc28
cmp byte [ebp + esi - 0x828], 0xd
jne 0x40fc19
inc esi
cmp esi, ebx
jge 0x40fc6f
cmp byte [ebp + esi - 0x828], 0xa
jne 0x40fc28
inc esi
cmp esi, ebx
jge 0x40fc6f
lea esp, [esp]
movsx eax, byte [ebp + esi - 0x828]
push eax
call fcn.0053a461
add esp, 4
test eax, eax
je 0x40fca0
cmp edi, 0x1f
jae 0x40fca0
mov al, byte [ebp + esi - 0x828]
mov byte [ebp + edi - 0x24], al
inc edi
mov dword [ebp - 0x950], edi
cmp edi, 0x20
jae 0x40febc
inc esi
mov byte [ebp + edi - 0x24], 0
cmp esi, ebx
jl 0x40fc30
mov esi, dword [ebp - 0x93c]
mov ecx, dword [ebp - 0x938]
mov eax, dword [ebp - 0x958]
mov ebx, dword [ebp - 0x934]
test eax, eax
jle 0x40f8f8
cmp ecx, eax
jge 0x40fe69
jmp 0x40f8f8
mov al, byte [ebp + esi - 0x828]
cmp al, 0xd
je 0x40fcb6
cmp al, 0xa
je 0x40fcb6
inc esi
cmp esi, ebx
jl 0x40fca0
jmp 0x40fc6f
cmp byte [ebp + esi - 0x828], 0xd
jne 0x40fcc1
inc esi
cmp esi, ebx
jge 0x40fc6f
cmp byte [ebp + esi - 0x828], 0xa
jne 0x40fdb9
xor ecx, ecx
test edi, edi
je 0x40fd16
mov ebx, dword [ebp - 0x944]
nop
mov al, byte [ebp + ecx - 0x24]
cmp al, 0x30
jl 0x40fcf7
cmp al, 0x39
jg 0x40fcf7
shl ebx, 4
movsx eax, al
add ebx, 0xffffffd0
jmp 0x40fd03
movsx eax, al
shl ebx, 4
or eax, 0x20
add ebx, 0xffffffa9
inc ecx
add ebx, eax
cmp ecx, edi
jb 0x40fce0
mov dword [ebp - 0x944], ebx
mov ebx, dword [ebp - 0x94c]
mov eax, dword [ebp - 0x944]
inc esi
mov byte [ebp - 0x24], 0
mov dword [ebp - 0x950], 0
test eax, eax
je 0x40fe63
mov edi, ebx
mov ebx, dword [ebp - 0x938]
sub edi, esi
cmp eax, edi
cmovl edi, eax
add ebx, edi
cmp ebx, dword [ebp - 0x954]
jbe 0x40fd76
cmp dword [ebp - 0x958], ebx
mov ecx, ebx
cmovge ecx, dword [ebp - 0x958]
push ecx
push dword [ebp - 0x948]
mov dword [ebp - 0x954], ecx
call fcn.0053d33b
add esp, 8
mov dword [ebp - 0x948], eax
lea eax, [ebp - 0x828]
add eax, esi
push edi
push eax
mov eax, dword [ebp - 0x938]
add eax, dword [ebp - 0x948]
push eax
call fcn.005398d0
mov eax, dword [ebp - 0x944]
add esi, edi
add esp, 0xc
sub eax, edi
mov edi, dword [ebp - 0x950]
mov dword [ebp - 0x938], ebx
mov ebx, dword [ebp - 0x94c]
mov dword [ebp - 0x944], eax
jmp 0x40fdbf
mov eax, dword [ebp - 0x944]
cmp esi, ebx
jl 0x40fc02
jmp 0x40fc6f
mov ecx, dword [ebp - 0x958]
mov edx, dword [ebp - 0x938]
test ecx, ecx
jle 0x40fde7
lea eax, [ebx + edx]
cmp eax, ecx
jle 0x40fde7
mov ebx, ecx
sub ebx, edx
lea esi, [ebx + edx]
cmp esi, dword [ebp - 0x954]
jbe 0x40fe1c
cmp ecx, esi
mov eax, esi
cmovge eax, ecx
push eax
push dword [ebp - 0x948]
mov dword [ebp - 0x954], eax
call fcn.0053d33b
mov edx, dword [ebp - 0x938]
add esp, 8
mov dword [ebp - 0x948], eax
jmp 0x40fe22
mov eax, dword [ebp - 0x948]
push ebx
lea ecx, [ebp - 0x828]
push ecx
add eax, edx
push eax
call fcn.005398d0
mov ecx, esi
mov esi, dword [ebp - 0x93c]
add esp, 0xc
mov dword [ebp - 0x938], ecx
jmp 0x40fc7b
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.select
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
jmp 0x40fe69
mov ebx, dword [ebp - 0x934]
push ebx
call fcn.0053a7a8
mov eax, dword [ebp - 0x938]
mov ecx, dword [ebp - 0x970]
add esp, 4
mov dword [ecx], eax
test eax, eax
jne 0x40fea5
push dword [ebp - 0x948]
call fcn.0053a7a8
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0053786f
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x948]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0053786f
mov esp, ebp
pop ebp
ret
call fcn.0053888a
int3