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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x10810
call fcn.00401f70
push ebx
push ebp
push esi
push edi
xor ebx, ebx
push ebx
mov edi, ecx
mov ecx, dword [edi]
push 0x800
lea eax, [esp + 0x628]
push eax
push ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], ebx
mov byte [esp + 0x23], bl
mov byte [esp + 0x22], bl
xor ebp, ebp
call sub.WSOCK32.dll_recv
cmp eax, ebx
jle 0x401538
jmp 0x401390
add dword [esp + 0x14], eax
mov edi, dword [esp + 0x14]
sub edi, eax
mov ecx, eax
mov al, byte [esp + 0x13]
mov edx, ecx
shr ecx, 2
lea edi, [esp + edi + 0xe20]
lea esi, [esp + 0x620]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test al, al
rep movsb byte es:[edi], byte [esi]
jne 0x401503
lea eax, [esp + 0xe20]
push str._r_n_r_n
push eax
call fcn.00401ee0
add esp, 8
test eax, eax
jne 0x4013fa
lea ecx, [esp + 0xe20]
push 0x407168
push ecx
call fcn.00401ee0
add esp, 8
test eax, eax
je 0x401511
lea edx, [esp + 0xe20]
sub eax, edx
mov ebp, eax
mov ecx, ebp
shr ecx, 2
mov esi, edx
lea edi, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov al, byte [esp + ebp + 0xe20]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp al, 0xa
mov eax, dword [esp + 0x14]
mov byte [esp + 0x13], 1
mov byte [esp + ebp + 0x220], 0
jne 0x401446
mov ecx, 0xfffffffe
lea edx, [esp + ebp + 0xe22]
jmp 0x401452
mov ecx, 0xfffffffc
lea edx, [esp + ebp + 0xe24]
sub ecx, ebp
add eax, ecx
push eax
mov dword [esp + 0x18], eax
lea eax, [esp + 0xe24]
push edx
push eax
call fcn.00401ba0
add esp, 0xc
lea ecx, [esp + 0x220]
push str.CONTENT_LENGTH:
push ecx
call fcn.00401910
add esp, 8
test eax, eax
je 0x401503
mov cl, byte [eax + 0x10]
add eax, 0x10
cmp cl, 0xa
mov byte [esp + 0x12], 1
je 0x4014a3
test cl, cl
je 0x4014a3
mov cl, byte [eax + 1]
inc eax
inc ebx
cmp cl, 0xa
jne 0x401495
mov ecx, ebx
mov edx, ecx
shr ecx, 2
mov esi, eax
sub esi, ebx
lea edi, [esp + 0x20]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
lea eax, [esp + ebx + 0x1f]
rep movsb byte es:[edi], byte [esi]
cmp byte [eax], 0xd
jne 0x4014c9
mov byte [eax], 0
jmp 0x4014ce
mov byte [esp + ebx + 0x20], 0
lea eax, [esp + 0x20]
push eax
call fcn.00401b96
mov ebx, eax
add esp, 4
cmp ebx, 0xfa00
jle 0x40150b
mov esi, dword [esp + 0x18]
mov ecx, dword [esi]
push ecx
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1441a], 5
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [esp + 0x12]
test al, al
je 0x401511
cmp dword [esp + 0x14], ebx
jge 0x401534
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
push 0
push 0x800
lea ecx, [esp + 0x628]
push ecx
push eax
call sub.WSOCK32.dll_recv
test eax, eax
jg 0x401390
mov edi, dword [esp + 0x18]
mov edx, dword [edi]
push edx
call sub.WSOCK32.dll_closesocket
mov eax, dword [esp + 0x14]
mov byte [esp + eax + 0xe20], 0
cmp dword [esp + 0x220], 0x50545448
je 0x40156b
mov dword [edi + 0x1441a], 6
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov cl, byte [esp + 0x229]
mov dl, byte [esp + 0x22a]
mov al, byte [esp + 0x22b]
mov byte [esp + 0x1c], cl
lea ecx, [esp + 0x1c]
push ecx
mov byte [esp + 0x21], dl
mov byte [esp + 0x22], al
mov byte [esp + 0x23], 0
call fcn.00401b96
mov ebx, dword [esp + 0x1c]
mov dword [edi + 0x14412], eax
mov eax, dword [esp + 0x18]
lea ecx, [ebp + 1]
mov edx, ecx
shr ecx, 2
add edi, 0x460a
lea esi, [esp + 0x224]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [eax + 1]
mov edx, ecx
shr ecx, 2
mov dword [ebx + 0x1440a], ebp
lea esi, [esp + 0xe24]
lea edi, [ebx + 0x4a0a]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add esp, 4
mov dword [ebx + 0x1440e], eax
push 0x100
lea eax, [esp + 0x124]
push eax
mov esi, 2
push str.CONTENT_TYPE:
mov ecx, ebx
mov dword [ebx + 0x14416], esi
call fcn.00401150
cmp al, 1
jne 0x401664
lea ecx, [esp + 0x120]
push str.text_html
push ecx
call fcn.00401ee0
add esp, 8
test eax, eax
je 0x401643
mov dword [ebx + 0x14416], esi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0x120]
push str.text_plain
push edx
call fcn.00401ee0
add esp, 8
neg eax
sbb eax, eax
neg eax
mov dword [ebx + 0x14416], eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret