Function at 0x404550
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Send data
Send data on socket
Send http request

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x460
push ebx
xor eax, eax
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
xor ecx, ecx
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov word [ebp - 0x22], ax
add esi, 0x2c
xor edi, edi
mov eax, 2
mov byte [ebp - 5], 0
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x40], ecx
mov word [ebp - 0x30], ax
cmp esi, ebx
je 0x4045ae
lea edx, [edi + 0xb]
push edx
push ecx
call dword [sym.imp.msvcrt.dll_realloc]
mov cl, byte [esi]
mov byte [edi + eax], cl
add esp, 8
mov byte [edi + eax + 1], bl
inc edi
jmp 0x4045b0
mov eax, ecx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x44], eax
mov dword [edx + 0x28], ebx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x18]
mov esi, 1
lea ebx, [ebp - 5]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x14], esi
lea ecx, [ecx]
mov edx, dword [ebp - 0x1c]
push 0
push esi
push ebx
push edx
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x40460f
cmp eax, 0xffffffff
jne 0x404605
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2733
jne 0x404616
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x14], 1
jmp 0x404609
sub esi, eax
add ebx, eax
test esi, esi
jne 0x4045d0
jmp 0x404616
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x404986
mov ecx, dword [ebp - 0x44]
lea eax, [edi + 0xb]
push eax
push ecx
call dword [sym.imp.msvcrt.dll_realloc]
mov dl, byte [ebp - 5]
mov esi, eax
mov byte [esi + edi], dl
push str._r_n_r_n
mov byte [esi + edi + 1], 0
push esi
inc edi
mov dword [ebp - 0x44], esi
call dword [sym.imp.msvcrt.dll_strstr]
add esp, 0x10
test eax, eax
je 0x4045b9
lea eax, [ebp - 0x20]
push eax
push 0x40a974
push esi
mov eax, 0x40a768
call fcn.00403110
add esp, 0xc
lea ecx, [ebp - 0xc]
push ecx
push 0x40a978
mov dword [ebp - 0x14], eax
push eax
mov eax, 0x40a768
call fcn.00403110
add esp, 0xc
lea edx, [ebp - 0xc]
mov edi, eax
mov eax, dword [ebp - 0xc]
push edx
push 0x40a978
push eax
mov eax, 0x40a768
mov dword [ebp - 0x18], edi
call fcn.00403110
xor ecx, ecx
add esp, 0xc
mov ebx, eax
mov dword [ebp - 0x1c], ebx
cmp edi, ecx
je 0x4049e0
cmp ebx, ecx
je 0x4049d2
cmp dword [ebp - 0xc], ecx
je 0x4049d2
mov eax, dword [ebp + 8]
cmp byte [eax + 0x2c], 0x43
je 0x40488f
push 0x40c
push ecx
mov dword [ebp - 0x45c], ecx
lea ecx, [ebp - 0x458]
push ecx
call sub.msvcrt.dll_memset
add esp, 0xc
lea edx, [ebp - 0x45c]
push edx
push ebx
call fcn.00401860
add esp, 8
test eax, eax
jne 0x40473f
push edi
mov edi, dword [sym.imp.msvcrt.dll_free]
call edi
add esp, 4
push ebx
call edi
mov eax, dword [ebp - 0x14]
add esp, 4
test eax, eax
je 0x404725
push eax
call edi
add esp, 4
test esi, esi
je 0x404a07
push esi
call edi
add esp, 4
mov eax, 0x57
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x45c]
test eax, eax
jne 0x404755
mov dword [ebp - 0x10], 0
jmp 0x40486a
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x458]
push eax
call dword [sym.imp.WS2_32.dll_htons]
push 6
push 1
push 2
mov word [ebp - 0x2e], ax
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp + 8]
add ecx, 0x1c
mov dword [ebp + 8], ecx
mov dword [ecx], eax
cmp eax, 0xffffffff
je 0x404749
push 0x10
lea ecx, [ebp - 0x30]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x4047aa
mov eax, dword [ebp + 8]
call fcn.00404420
mov dword [ebp - 0x10], 0
jmp 0x40486a
mov eax, edi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4047b0
sub eax, edx
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x54]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4047c2
sub eax, edx
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0xc]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4047d4
mov ebx, dword [ebp - 0x20]
sub eax, edx
mov ecx, eax
mov eax, ebx
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4047e7
mov edx, dword [ebp - 0x38]
sub eax, edi
add eax, ecx
add eax, dword [ebp - 0x34]
push 1
lea eax, [eax + edx + 0x64]
push eax
call dword [sym.imp.msvcrt.dll_calloc]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x54]
push ebx
push ecx
mov edi, eax
mov eax, dword [ebp - 0x18]
push edx
push eax
push str._s__s__s_r_n_s
push edi
call dword [sym.imp.msvcrt.dll_sprintf]
mov eax, edi
add esp, 0x20
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x404828
sub eax, ecx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push 0
mov ebx, eax
push ebx
push edi
push edx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, ebx
je 0x404856
mov eax, dword [ebp + 8]
call fcn.00404420
mov dword [ebp - 0x10], 0
test edi, edi
je 0x404864
push edi
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
mov edi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x1c]
push edi
mov edi, dword [sym.imp.msvcrt.dll_free]
call edi
add esp, 4
push ebx
call edi
add esp, 4
test esi, esi
je 0x404975
push esi
call edi
add esp, 4
jmp 0x404975
lea eax, [ebp - 0xc]
push eax
push 0x40a784
push ebx
mov eax, 0x40a768
mov dword [ebp - 0xc], ecx
call fcn.00403110
mov edi, eax
add esp, 0xc
test edi, edi
je 0x40499a
cmp dword [ebp - 0xc], 0
je 0x40499a
mov edx, edi
call fcn.00402dc0
mov ecx, dword [ebp - 0xc]
push ecx
mov dword [ebp - 0x2c], eax
call dword [sym.imp.msvcrt.dll_atoi]
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp - 0x18]
push edx
mov word [ebp - 0x2e], ax
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
push ebx
mov ebx, dword [sym.imp.msvcrt.dll_free]
call ebx
add esp, 4
push edi
call ebx
xor edi, edi
add esp, 4
cmp esi, edi
je 0x40490a
push esi
call ebx
add esp, 4
cmp dword [ebp - 0x2c], edi
je 0x404972
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, dword [ebp + 8]
mov dword [ebx + 0x1c], eax
cmp eax, 0xffffffff
je 0x404972
push 0x10
lea ecx, [ebp - 0x30]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x404953
lea eax, [ebx + 0x1c]
call fcn.00404420
mov edx, dword [ebx + 0x18]
push edi
push 0x5a
push str.HTTP_1.0_502_r_nConnection:_close_r_nContent_type:_text_html__unsigned_charsetus_ascii_r_n_r_n502
push edx
call dword [sym.imp.WS2_32.dll_send]
jmp 0x404972
mov eax, dword [ebx + 0x18]
push edi
push 0x29
push str.HTTP_1.0_200_r_nContent_Type:_text_html_r_n_r_n
push eax
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0x29
je 0x404975
lea eax, [ebx + 0x1c]
call fcn.00404420
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x404986
push eax
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
mov eax, dword [ebp - 0x10]
neg eax
sbb eax, eax
and eax, 0xffffffa9
add eax, 0x57
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x18]
mov edi, dword [sym.imp.msvcrt.dll_free]
push ecx
call edi
add esp, 4
push ebx
call edi
mov eax, dword [ebp - 0x14]
add esp, 4
test eax, eax
je 0x4049bc
push eax
call edi
add esp, 4
test esi, esi
je 0x404a07
push esi
call edi
add esp, 4
mov eax, 0x57
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [sym.imp.msvcrt.dll_free]
call edi
add esp, 4
jmp 0x4049e6
mov edi, dword [sym.imp.msvcrt.dll_free]
test ebx, ebx
je 0x4049f0
push ebx
call edi
add esp, 4
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4049fd
push eax
call edi
add esp, 4
test esi, esi
je 0x404a07
push esi
call edi
add esp, 4
pop edi
pop esi
mov eax, 0x57
pop ebx
mov esp, ebp
pop ebp
ret