Function at 0x407450
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Resolve dns
Resolve function by parsing pe exports
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0xaef4
call fcn.00411db0
mov eax, dword [0x422330]
push ebx
push esi
push edi
push 0x50
mov dword [esp + 0xaf00], eax
mov word [esp + 0x54], 2
call dword [sym.imp.WSOCK32.dll_htons]
mov word [esp + 0x52], ax
xor ebx, ebx
mov byte [esp + 0x110], bl
xor eax, eax
mov ecx, 0x7f
lea edi, [esp + 0x111]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [ebp + 8]
imul edi, edi, 0x1448
sub esp, 0x1c
mov ecx, esp
push 0xffffffffffffffff
push ebx
lea esi, [edi + 0x432d44]
mov dword [ecx + 0x18], 0xf
mov dword [ecx + 0x14], ebx
push esi
mov byte [ecx + 4], bl
mov dword [esp + 0x38], edi
call fcn.00401f40
call fcn.00404830
add esp, 0x1c
cmp eax, ebx
je 0x407511
sub esp, 0x1c
mov ecx, esp
push 0xffffffffffffffff
push ebx
mov dword [ecx + 0x18], 0xf
mov dword [ecx + 0x14], ebx
push esi
mov byte [ecx + 4], bl
call fcn.00401f40
call fcn.00404400
push eax
lea eax, [esp + 0x130]
push 0x41b38c
push eax
call fcn.00411af5
add esp, 0x28
jmp 0x407535
cmp dword [esi + 0x18], 0x10
jb 0x40751c
mov esi, dword [esi + 4]
jmp 0x40751f
add esi, 4
push esi
lea ecx, [esp + 0x114]
push 0x41b38c
push ecx
call fcn.00411af5
add esp, 0xc
push 0xa
mov esi, 0xf
push str.0123456789
lea ecx, [esp + 0x84]
mov dword [esp + 0x9c], esi
mov dword [esp + 0x98], ebx
mov byte [esp + 0x88], bl
call fcn.00402030
lea eax, [esp + 0x110]
mov dword [esp + 0x4c], esi
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x407578
sub eax, edx
push eax
lea edx, [esp + 0x114]
push edx
lea ecx, [esp + 0x3c]
call fcn.00402030
mov eax, dword [esp + 0x48]
push 1
dec eax
push eax
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x24]
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], ebx
mov byte [esp + 0x28], bl
call fcn.00401f40
cmp dword [esp + 0x30], 0x10
mov eax, dword [esp + 0x1c]
jae 0x4075c4
lea eax, [esp + 0x1c]
mov edx, dword [esp + 0x2c]
push edx
push ebx
push eax
lea ecx, [esp + 0x88]
call fcn.00403440
cmp eax, 0xffffffff
mov esi, dword [sym.imp.WSOCK32.dll_inet_addr]
je 0x4075f2
lea eax, [esp + 0x110]
push eax
call esi
mov dword [esp + 0x54], eax
jmp 0x407638
lea ecx, [esp + 0x110]
push ecx
call dword [sym.imp.WSOCK32.dll_gethostbyname]
cmp eax, ebx
jne 0x40762d
mov edx, dword [edi + 0x432d40]
mov esi, dword [sym.imp.WSOCK32.dll_closesocket]
push edx
call esi
mov eax, dword [ebp + 8]
push eax
call fcn.00408e70
mov ecx, dword [esp + 0x18]
add esp, 4
push ecx
call esi
push ebx
call dword [sym.imp.KERNEL32.DLL_ExitThread]
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
mov dword [esp + 0x54], ecx
cmp dword [0x421090], 0x10
mov eax, dword [0x42107c]
jae 0x40764b
mov eax, 0x42107c
push eax
call esi
mov edx, dword [esp + 0x54]
push edx
mov esi, eax
lea eax, [esp + 0xf4]
push 0x41c348
push eax
call fcn.00411af5
push esi
lea ecx, [esp + 0xe0]
push 0x41c348
push ecx
call fcn.00411af5
add esp, 0x18
lea esi, [esp + 0xd0]
lea eax, [esp + 0xf0]
jmp 0x407690
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4076b4
cmp cl, bl
je 0x4076b0
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4076b4
add eax, 2
add esi, 2
cmp cl, bl
jne 0x407690
xor eax, eax
jmp 0x4076b9
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x407758
push str._nRequest_to_local_address____n
call fcn.0040a180
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0x432d40]
mov edx, dword [ebp + 8]
push ecx
push edx
call fcn.004073c0
mov eax, dword [esp + 0x3c]
mov esi, 0x10
add esp, 0xc
cmp eax, esi
jb 0x4076fc
mov eax, dword [esp + 0x1c]
push eax
call fcn.00412292
add esp, 4
cmp dword [esp + 0x4c], esi
mov edi, 0xf
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov byte [esp + 0x1c], bl
jb 0x407720
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00412292
add esp, 4
cmp dword [esp + 0x94], esi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
jb 0x407745
mov edx, dword [esp + 0x80]
push edx
call fcn.00412292
add esp, 4
mov ecx, dword [esp + 0xaefc]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 6
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x4077c0
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
lea eax, [esp + 0x714]
push str.Socket_could_not_connect__exiting:__d_n
push eax
call fcn.00411af5
lea ecx, [esp + 0x71c]
push ecx
call fcn.0040a180
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x432d40]
mov esi, dword [sym.imp.WSOCK32.dll_closesocket]
add esp, 0x10
push eax
call esi
mov ecx, dword [ebp + 8]
push ecx
call fcn.00408e70
add esp, 4
push 0xffffffffffffffff
call esi
push ebx
call dword [sym.imp.KERNEL32.DLL_ExitThread]
push 0x10
lea edx, [esp + 0x54]
push edx
push eax
call dword [sym.imp.WSOCK32.dll_connect]
mov edx, eax
xor eax, eax
mov byte [esp + 0xaf8], bl
mov ecx, 0xff
lea edi, [esp + 0xaf9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [esp + 0x310], bl
mov ecx, 0xff
lea edi, [esp + 0x311]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
cmp edx, 0xffffffff
mov byte [esp + 0xef8], bl
mov ecx, 0x27ff
lea edi, [esp + 0xef9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
jne 0x40784e
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push 0xffffffffffffffff
lea eax, [esp + 0x718]
push str.Socket_state:__d__Socket_error:__d
push eax
call fcn.00411af5
lea ecx, [esp + 0x720]
push ecx
call fcn.0040a180
add esp, 0x14
lea edx, [esp + 0x98]
push edx
call fcn.004042c0
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
lea ecx, [esp + 0xb8]
call fcn.00402150
mov esi, dword [esp + 0x10]
mov eax, dword [esi + 0x432d5c]
cmp eax, 0x10
mov ecx, dword [esi + 0x432d58]
lea esi, [esi + 0x432d44]
mov dword [esp + 0x78], 0xf
mov dword [esp + 0x74], ebx
mov byte [esp + 0x64], bl
jb 0x40789e
mov eax, dword [esi + 4]
jmp 0x4078a1
lea eax, [esi + 4]
push ecx
push ebx
push eax
lea ecx, [esp + 0xc0]
call fcn.00403440
cmp eax, 0xffffffff
je 0x407921
mov ecx, dword [esp + 0x10]
mov edi, dword [ecx + 0x432d58]
push ebx
push esi
lea ecx, [esp + 0xbc]
call fcn.00403510
push 0xffffffffffffffff
add eax, edi
push eax
lea edx, [esp + 0xbc]
push edx
lea ecx, [esp + 0xa4]
mov dword [esp + 0xbc], 0xf
mov dword [esp + 0xb8], ebx
mov byte [esp + 0xa8], bl
call fcn.00401f40
push 0xffffffffffffffff
push ebx
lea eax, [esp + 0xa0]
push eax
lea ecx, [esp + 0x6c]
call fcn.00401f40
lea ecx, [esp + 0x98]
call fcn.00401ab0
jmp 0x407935
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0xbc]
push ecx
lea ecx, [esp + 0x6c]
call fcn.00401f40
mov esi, dword [ebp + 0x14]
mov edi, 0x41b788
mov ecx, 4
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x407990
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 0x432d5c]
lea eax, [eax + 0x432d44]
mov ecx, 0x10
cmp edx, ecx
jb 0x407966
mov eax, dword [eax + 4]
jmp 0x407969
add eax, 4
cmp dword [esp + 0x78], ecx
mov ecx, dword [esp + 0x64]
jae 0x407977
lea ecx, [esp + 0x64]
push eax
push ecx
lea eax, [esp + 0xb00]
push str.GET__s_HTTP_1.0_r_nHost:__s_r_n
push eax
call fcn.00411af5
add esp, 0x10
jmp 0x4079aa
push 0x41b5fe
lea ecx, [esp + 0xafc]
push 0x41b38c
push ecx
call fcn.00411af5
add esp, 0xc
lea eax, [esp + 0xaf8]
mov edx, eax
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4079b3
lea edi, [esp + 0x310]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
cmp cl, bl
jne 0x4079c4
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [ebp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4079e1
lea edi, [esp + 0x310]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
cmp cl, bl
jne 0x4079f2
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push str._nWill_send_this_now_n
rep movsb byte es:[edi], byte [esi]
call fcn.0040a180
lea edx, [esp + 0x314]
push edx
call fcn.0040a180
lea edi, [esp + 0x318]
add esp, 8
dec edi
lea ebx, [ebx]
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x407a30
mov ax, word [0x41c204]
mov cl, byte [0x41c206]
mov word [edi], ax
lea eax, [esp + 0x310]
mov byte [edi + 2], cl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x407a54
mov esi, dword [esp + 0x14]
push ebx
sub eax, edx
push eax
lea edx, [esp + 0x318]
push edx
push esi
call dword [sym.imp.WSOCK32.dll_send]
xor eax, eax
push ebx
mov ecx, 0x2800
lea edi, [esp + 0xefc]
rep stosd dword es:[edi], eax
push 0x9fff
lea eax, [esp + 0xf00]
push eax
push esi
call dword [sym.imp.WSOCK32.dll_recv]
cmp eax, ebx
je 0x407afa
jmp 0x407aa0
cmp eax, 0xffffffff
je 0x407afa
mov edx, dword [esp + 0x10]
push ebx
push eax
mov eax, dword [edx + 0x432d40]
lea ecx, [esp + 0xf00]
push ecx
push eax
call dword [sym.imp.WSOCK32.dll_send]
cmp eax, ebx
je 0x407b6a
cmp eax, 0xffffffff
je 0x407b6a
push ebx
xor eax, eax
mov ecx, 0x2800
lea edi, [esp + 0xefc]
rep stosd dword es:[edi], eax
push 0x9fff
lea ecx, [esp + 0xf00]
push ecx
push esi
call dword [sym.imp.WSOCK32.dll_recv]
cmp eax, ebx
jne 0x407aa0
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
lea eax, [esp + 0x718]
push str._nRecv_error:__d__Thread_number:__d_n
push eax
call fcn.00411af5
lea ecx, [esp + 0x720]
push ecx
call fcn.0040a180
add esp, 0x14
push 0x41b5fe
lea edx, [esp + 0x314]
push 0x41b38c
push edx
call fcn.00411af5
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x432d40]
mov edi, dword [sym.imp.WSOCK32.dll_closesocket]
add esp, 0xc
push ecx
call edi
mov edx, dword [ebp + 8]
push edx
call fcn.00408e70
add esp, 4
push esi
call edi
push ebx
call dword [sym.imp.KERNEL32.DLL_ExitThread]
push str._nSend_err_interrupt_n
call fcn.0040a180
add esp, 4
jmp 0x407b27