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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x14bc
call fcn.00463a90
mov eax, dword [0x4b9430]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x1388
lea eax, [ebp - 0x1398]
push 0
push eax
mov ebx, ecx
call fcn.00463ac0
mov eax, dword [ebx + 0xd8]
add esp, 0xc
test eax, 0x800000
je 0x40e500
and eax, 0xff7fffff
mov dword [ebx + 0xd8], eax
lea eax, [ebx + 0x154]
call fcn.00415900
test eax, eax
je 0x40e4e2
cmp byte [eax], 0
jne 0x40e7bb
mov ecx, dword [ebx + 0x84]
push ecx
push str.No_complete_request_line_received_yet._Continuing_reading_from__d.
push 2
call fcn.004090c0
add esp, 0xc
jmp 0x40e500
mov edx, dword [ebx]
mov esi, dword [ebx + 0x84]
xor eax, eax
lea ecx, [ebp - 0x14b0]
push ecx
mov dword [ebp - 0x14b0], eax
push 0
mov dword [ebp - 0x14ac], eax
mov eax, dword [edx + 0x74]
push 0
lea edx, [ebp - 0x14a0]
mov dword [ebp - 0x14b0], eax
push edx
lea eax, [esi + 1]
push eax
mov dword [ebp - 0x149c], esi
mov dword [ebp - 0x14a0], 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jne 0x40e733
push 2
push eax
lea ecx, [ebp - 0x10]
push ecx
push esi
mov esi, dword [sym.imp.WS2_32.dll_recv]
call esi
cmp eax, 1
jne 0x40e733
mov edi, dword [ebx + 0x84]
push 0
push 0x1387
lea edx, [ebp - 0x1398]
push edx
push edi
call esi
mov esi, eax
test esi, esi
jle 0x40e79c
lea eax, [ebp - 0x1398]
push eax
push esi
push edi
push str.from_socket__d:__N
push 0x8000
call fcn.004090c0
mov edx, dword [ebx]
mov edx, dword [edx + 0x64]
add esp, 0x14
lea ecx, [ebp - 0x1398]
push esi
push ecx
lea eax, [ebx + 0x154]
call fcn.004152f0
add esp, 8
test eax, eax
jne 0x40e79c
lea eax, [ebx + 0x154]
call fcn.00415900
mov esi, eax
mov dword [ebp - 0x14a8], esi
test esi, esi
je 0x40e79c
cmp byte [esi], 0
jne 0x40e60a
mov al, byte [ebp - 0x1398]
cmp al, 0x41
jl 0x40e5fa
cmp al, 0x5a
jle 0x40e60a
cmp al, 0x61
jl 0x40e602
cmp al, 0x7a
jle 0x40e60a
cmp al, 0x20
jne 0x40e79c
push 7
push str.CONNECT
push esi
call fcn.0045d3c3
add esp, 0xc
test eax, eax
jne 0x40e6de
mov esi, dword [ebx + 0xe4]
push 0x4c5cdc
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x4c5cfc]
mov eax, dword [ecx + 4]
xor edi, edi
cmp byte [eax + 0x25], 0
mov edx, ecx
jne 0x40e65a
cmp dword [eax + 0xc], esi
jae 0x40e650
mov eax, dword [eax + 8]
jmp 0x40e654
mov edx, eax
mov eax, dword [eax]
cmp byte [eax + 0x25], 0
je 0x40e646
mov dword [ebp - 0x14a4], edx
cmp edx, ecx
je 0x40e671
cmp esi, dword [edx + 0xc]
jb 0x40e671
lea eax, [ebp - 0x14a4]
jmp 0x40e67d
mov dword [ebp - 0x14b4], ecx
lea eax, [ebp - 0x14b4]
mov esi, dword [eax]
cmp ecx, esi
je 0x40e6aa
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esi + 0x20]
cmp eax, 0x927c0
jbe 0x40e6a7
push esi
lea eax, [ebp - 0x14b8]
push eax
push 0x4c5cf8
call fcn.0041d2b0
jmp 0x40e6aa
lea edi, [esi + 0x10]
push 0x4c5cdc
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
je 0x40e6d8
movzx ecx, word [edi + 0xc]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
cmp dword [edi + 8], 0xffffffff
movzx eax, ax
je 0x40e6d8
cmp eax, 0x1bb
jne 0x40e79c
mov esi, dword [ebp - 0x14a8]
cmp byte [esi], 0
je 0x40e500
push str._http:__
mov edx, esi
call fcn.004159b0
add esp, 4
test eax, eax
jne 0x40e7af
lea eax, [ebx + 0x154]
call fcn.00415a60
mov dword [ebx + 0x100], eax
test eax, eax
jne 0x40e7b9
push esi
call fcn.0045d483
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret
mov esi, dword [ebx + 0x84]
call fcn.0040d680
test eax, eax
je 0x40e786
mov edx, dword [ebx]
mov eax, dword [edx + 0x74]
mov ecx, dword [ebx + 0x84]
push eax
push ecx
push str.No_request_line_on_socket__d_received_in_time._Timeout:__d.
push 2
call fcn.004090c0
mov ebx, dword [ebx + 0x84]
add esp, 0x10
mov esi, 0x21
mov edi, str.HTTP_1.1_504_Connection_timeout_r_n
call fcn.0040cd80
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret
mov edx, dword [ebx + 0x84]
push edx
push str.The_client_side_of_the_connection_on_socket__d_got_closed_without_sending_a_complete_request_line.
push 2
call fcn.004090c0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret
mov dword [ebx + 0x100], 0
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret