Function at 0x401570
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x44a4b5
mov eax, dword fs:[0]
push eax
sub esp, 0x404
mov eax, dword [0x45e560]
xor eax, esp
mov dword [esp + 0x400], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x45e560]
xor eax, esp
push eax
lea eax, [esp + 0x418]
mov dword fs:[0], eax
mov eax, dword [esp + 0x428]
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
xor ebx, ebx
mov dword [esp + 0x420], ebx
xor eax, eax
mov ebp, 0xf
mov dword [esp + 0x1b0], eax
mov dword [esp + 0x1b4], eax
mov dword [esp + 0x1b8], eax
mov dword [esp + 0x1bc], eax
mov dword [esp + 0x190], ebp
mov dword [esp + 0x18c], ebx
mov byte [esp + 0x17c], bl
mov dword [esp + 0x158], ebp
mov dword [esp + 0x154], ebx
mov byte [esp + 0x144], bl
mov dword [esp + 0x174], ebp
mov dword [esp + 0x170], ebx
mov byte [esp + 0x160], bl
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x160]
push ecx
lea edx, [esp + 0x148]
push edx
lea eax, [esp + 0x184]
push eax
lea ecx, [esp + 0x43c]
mov byte [esp + 0x430], 3
push ecx
mov dword [esp + 0x2c], 0x50
call fcn.00401340
lea edx, [esp + 0x178]
call fcn.00402430
test al, al
jne 0x401729
mov esi, 0x10
cmp dword [esp + 0x174], esi
jb 0x401695
mov edx, dword [esp + 0x160]
push edx
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x174], ebp
mov dword [esp + 0x170], ebx
mov byte [esp + 0x160], bl
cmp dword [esp + 0x158], esi
jb 0x4016c3
mov eax, dword [esp + 0x144]
push eax
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x158], ebp
mov dword [esp + 0x154], ebx
mov byte [esp + 0x144], bl
cmp dword [esp + 0x190], esi
jb 0x4016f1
mov ecx, dword [esp + 0x17c]
push ecx
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x190], ebp
mov dword [esp + 0x18c], ebx
mov byte [esp + 0x17c], bl
cmp dword [esp + 0x444], esi
jb 0x40171f
mov edx, dword [esp + 0x430]
push edx
call fcn.0040e8c6
add esp, 4
mov eax, 4
jmp 0x401ec6
mov eax, dword [esp + 0x144]
mov edi, 0x10
cmp dword [esp + 0x158], edi
jae 0x401745
lea eax, [esp + 0x144]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov esi, eax
cmp esi, ebx
jne 0x401807
cmp dword [esp + 0x174], edi
jb 0x40176f
mov eax, dword [esp + 0x160]
push eax
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x174], ebp
mov dword [esp + 0x170], ebx
mov byte [esp + 0x160], bl
cmp dword [esp + 0x158], edi
jb 0x40179d
mov ecx, dword [esp + 0x144]
push ecx
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x158], ebp
mov dword [esp + 0x154], ebx
mov byte [esp + 0x144], bl
cmp dword [esp + 0x190], edi
jb 0x4017cb
mov edx, dword [esp + 0x17c]
push edx
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x190], ebp
mov dword [esp + 0x18c], ebx
mov byte [esp + 0x17c], bl
cmp dword [esp + 0x444], edi
jb 0x40171f
mov eax, dword [esp + 0x430]
push eax
call fcn.0040e8c6
add esp, 4
mov eax, 4
jmp 0x401ec6
mov edx, dword [esp + 0x18]
mov ecx, 2
push edx
mov word [esp + 0x1b4], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x1b2], ax
mov eax, dword [esi + 0xc]
mov ecx, dword [eax]
add ecx, 4
push ecx
call dword [sym.imp.WS2_32.dll_inet_addr]
push 6
push 1
push 2
mov dword [esp + 0x1c0], eax
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x401922
push str.HTTP::SendHTTP:_Could_not_construct_a_TestSocket
mov edi, 3
mov esi, str..genHTTP.cpp
call fcn.00403700
mov esi, 0x10
add esp, 4
cmp dword [esp + 0x174], esi
jb 0x401889
mov edx, dword [esp + 0x160]
push edx
call fcn.0040e8c6
add esp, 4
mov edi, 0xf
mov dword [esp + 0x174], edi
mov dword [esp + 0x170], ebx
mov byte [esp + 0x160], bl
cmp dword [esp + 0x158], esi
jb 0x4018bc
mov eax, dword [esp + 0x144]
push eax
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x158], edi
mov dword [esp + 0x154], ebx
mov byte [esp + 0x144], bl
cmp dword [esp + 0x190], esi
jb 0x4018ea
mov ecx, dword [esp + 0x17c]
push ecx
call fcn.0040e8c6
add esp, 4
mov dword [esp + 0x190], edi
mov dword [esp + 0x18c], ebx
mov byte [esp + 0x17c], bl
cmp dword [esp + 0x444], esi
jb 0x401918
mov edx, dword [esp + 0x430]
push edx
call fcn.0040e8c6
add esp, 4
mov eax, 1
jmp 0x401ec6
lea eax, [esp + 0x18]
push eax
push 0x8004667e
push ebp
mov dword [esp + 0x24], 1
mov byte [esp + 0x23], bl
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x4019bc
push edi
lea ecx, [esp + 0x1b4]
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x40195e
mov byte [esp + 0x17], 1
jmp 0x4019d3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x4019d3
mov esi, 3
lea edi, [ebp + 1]
push 0x3e8
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x38], 1
dec esi
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0x2c]
push edx
push ebx
lea eax, [esp + 0x3c]
push eax
push ebx
push edi
call dword [sym.imp.WS2_32.dll_select]
sub eax, ebx
jne 0x4019b0
cmp esi, ebx
jg 0x401973
jmp 0x4019d3
sub eax, 1
jne 0x4019d3
mov byte [esp + 0x17], 1
jmp 0x4019d3
push str.HTTP::SendHTTP:_Could_not_set_TestSock_to_be_non_blocking
mov edi, 3
mov esi, str..genHTTP.cpp
call fcn.00403700
add esp, 4
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
push ebp
call esi
cmp byte [esp + 0x17], bl
jne 0x401a33
push str.HTTP::SendHTTP:_TestSocket_could_not_connect_to_our_server._Exit_REQ_SOCKET_CONNECT_
mov edi, 4
mov esi, str..genHTTP.cpp
call fcn.00403700
add esp, 4
lea esi, [esp + 0x15c]
call fcn.00403010
lea esi, [esp + 0x140]
call fcn.00403010
lea esi, [esp + 0x178]
call fcn.00403010
lea esi, [esp + 0x42c]
call fcn.00403010
mov eax, 2
jmp 0x401ec6
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x401a80
lea esi, [esp + 0x15c]
call fcn.00403010
lea esi, [esp + 0x140]
call fcn.00403010
lea esi, [esp + 0x178]
call fcn.00403010
lea esi, [esp + 0x42c]
call fcn.00403010
mov eax, 1
jmp 0x401ec6
push 4
lea ecx, [esp + 0x28]
push ecx
push 0x1006
push 0xffff
push ebp
mov dword [esp + 0x38], 0x1388
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x401aac
push ebp
call esi
jmp 0x4019f9
push str.HTTP:_Begin_Socket_Connect
mov edi, 4
mov esi, str..genHTTP.cpp
call fcn.00403700
add esp, 4
mov esi, 0x10
push esi
lea edx, [esp + 0x1b4]
push edx
push ebp
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x401aed
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push str.HTTP:_Socket_Connect_Failure
jmp 0x4019ec
mov eax, 0xf
mov dword [esp + 0x1ac], eax
mov dword [esp + 0x1a8], ebx
mov byte [esp + 0x198], bl
mov dword [esp + 0x1d8], eax
mov dword [esp + 0x1d4], ebx
mov byte [esp + 0x1c4], bl
mov eax, dword [esp + 0x20]
mov byte [esp + 0x420], 5
lea edi, [esp + 0x1c0]
mov ecx, 0x451a14
cmp dword [eax + 0x14], ebx
je 0x401b3e
mov ecx, str.POST
call fcn.00402f20
mov ecx, dword [esp + 0x160]
cmp dword [esp + 0x174], esi
jae 0x401b5a
lea ecx, [esp + 0x160]
mov eax, dword [esp + 0x1c4]
cmp dword [esp + 0x1d8], esi
jae 0x401b71
lea eax, [esp + 0x1c4]
push ecx
push eax
push str._s__s_HTTP_1.0_r_n
lea edx, [esp + 0x1a0]
call fcn.00402410
add esp, 0xc
mov ecx, str.Accept:_image_gif__image_x_xbitmap__image_jpeg__image_pjpeg__application_vnd.ms_excel__application_msword__application_vnd.ms_powerpoint____r_n
lea edx, [esp + 0x194]
call fcn.00402800
mov ecx, str.Accept_Language:_en_us_r_n
lea edx, [esp + 0x194]
call fcn.00402800
mov ecx, str.Accept_Encoding:_gzip__deflate_r_n
lea edx, [esp + 0x194]
call fcn.00402800
mov ecx, dword [esp + 0x28]
push ebx
add ecx, 4
push ecx
or eax, 0xffffffff
lea esi, [esp + 0x19c]
call fcn.004028f0
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x14]
cmp eax, ebx
je 0x401c0f
push eax
push str.Content_Length:__d_r_n
lea edx, [esp + 0x1c8]
call fcn.00402410
add esp, 8
push ebx
lea eax, [esp + 0x1c4]
push eax
or eax, 0xffffffff
call fcn.004028f0
mov ecx, str.Content_Type:_application_x_www_form_urlencoded_r_n
mov edx, esi
call fcn.00402800
cmp dword [esp + 0x158], 0x10
mov eax, dword [esp + 0x144]
jae 0x401c27
lea eax, [esp + 0x144]
push eax
push str.Host:__s_r_n
lea edx, [esp + 0x1c8]
call fcn.00402410
add esp, 8
push ebx
lea ecx, [esp + 0x1c4]
push ecx
or eax, 0xffffffff
lea esi, [esp + 0x19c]
call fcn.004028f0
mov edi, esi
mov esi, dword [esp + 0x1c]
call fcn.004021a0
mov ecx, 0x451b60
mov edx, edi
call fcn.00402800
mov edx, dword [esp + 0x20]
push ebx
push edx
or eax, 0xffffffff
mov esi, edi
call fcn.004028f0
mov esi, dword [esp + 0x1c]
call fcn.004021a0
cmp dword [esp + 0x1ac], 0x10
mov eax, dword [esp + 0x198]
jae 0x401c9c
lea eax, [esp + 0x198]
mov ecx, dword [esp + 0x1a8]
push ebx
push ecx
push eax
push ebp
call dword [sym.imp.WS2_32.dll_send]
mov byte [esp + 0x17], bl
xor esi, esi
mov dword [esp + 0x1f4], 0xf
mov dword [esp + 0x1f0], ebx
mov byte [esp + 0x1e0], bl
mov byte [esp + 0x420], 6
push ebx
push 1
lea edx, [esp + 0x21c]
push edx
push ebp
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 1
jne 0x401d9c
mov eax, dword [esp + 0x214]
push eax
mov eax, 1
lea edi, [esp + 0x1e0]
call fcn.00402610
mov al, byte [esp + 0x214]
cmp al, 0xa
je 0x401d1a
cmp al, 0xd
je 0x401d25
inc esi
jmp 0x401d25
cmp esi, ebx
jne 0x401d23
mov byte [esp + 0x17], 1
xor esi, esi
cmp byte [esp + 0x17], bl
je 0x401cd4
mov esi, dword [esp + 0x1c]
add esi, 0x1c
lea edi, [esp + 0x1dc]
call fcn.004021a0
mov dword [esp + 0x210], 0xf
mov dword [esp + 0x20c], ebx
mov byte [esp + 0x1fc], bl
mov byte [esp + 0x420], 7
nop
push ebx
push 0x1ff
lea ecx, [esp + 0x21c]
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, ebx
jle 0x401dc1
cmp eax, 0x200
jae 0x401dbf
lea ecx, [esp + 0x214]
lea edx, [esp + 0x1f8]
mov byte [esp + eax + 0x214], bl
call fcn.00402800
jmp 0x401d60
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push str.HTTP:_Socket_Recive_Timeout
mov edi, 4
mov esi, str..genHTTP.cpp
call fcn.00403700
add esp, 4
jmp 0x401e6d
cmp eax, ebx
jne 0x401e43
mov esi, dword [esp + 0x1c]
add esi, 0x38
lea edi, [esp + 0x1f8]
call fcn.004021a0
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, edi
call fcn.00403010
lea esi, [esp + 0x1dc]
call fcn.00403010
lea esi, [esp + 0x1c0]
call fcn.00403010
lea esi, [esp + 0x194]
call fcn.00403010
lea esi, [esp + 0x15c]
call fcn.00403010
lea esi, [esp + 0x140]
call fcn.00403010
lea esi, [esp + 0x178]
call fcn.00403010
lea esi, [esp + 0x42c]
call fcn.00403010
xor eax, eax
jmp 0x401ec6
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push str.HTTP:_Socket_Recive_Timeout
mov edi, 4
mov esi, str..genHTTP.cpp
call fcn.00403700
add esp, 4
lea esi, [esp + 0x1f8]
call fcn.00403010
lea esi, [esp + 0x1dc]
call fcn.00403010
lea esi, [esp + 0x1c0]
call fcn.00403010
lea esi, [esp + 0x194]
call fcn.00403010
lea esi, [esp + 0x15c]
call fcn.00403010
lea esi, [esp + 0x140]
call fcn.00403010
lea esi, [esp + 0x178]
call fcn.00403010
lea esi, [esp + 0x42c]
call fcn.00403010
mov eax, 3
mov ecx, dword [esp + 0x418]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x400]
xor ecx, esp
call fcn.0042d9c5
add esp, 0x410
ret 0x20