Function at 0x40ed70
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp 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 0xffffffffffffffff
push 0x45d36b
mov eax, dword fs:[0]
push eax
mov eax, 0x30e8
call fcn.00439c50
mov eax, dword [0x483ca0]
xor eax, esp
mov dword [esp + 0x30e4], eax
push esi
push edi
mov eax, dword [0x483ca0]
xor eax, esp
push eax
lea eax, [esp + 0x30f4]
mov dword fs:[0], eax
mov eax, dword [esp + 0x3118]
mov ecx, dword [esp + 0x3110]
mov edx, dword [esp + 0x3114]
mov edi, dword [esp + 0x3104]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10b0]
push eax
lea eax, [esp + 0x24]
mov dword [ecx], 0
push eax
lea eax, [esp + 0x20b8]
mov dword [esp + 0x18], ecx
push eax
push edi
mov dword [esp + 0x34], edx
mov dword [edx], 0
call fcn.0040be60
add esp, 0x10
test al, al
jne 0x40ee2f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
push edi
push str.Failed_to_parse_SERVER_ADDRESS:__s__Error_Code___d__Error___s
push 0x43f
push 0x46360c
push 3
push str.Utility::URLDownload
jmp 0x40f75b
lea eax, [esp + 0xb0]
push eax
lea eax, [esp + 0x20b4]
push eax
call fcn.0040c160
add esp, 8
test al, al
jne 0x40ee77
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
push edi
push str.Failed_to_get_IP_address_for_SERVER_ADDRESS:__s__Error_Code___d__Error___s
push 0x446
push 0x46360c
push 3
push str.Utility::URLDownload
jmp 0x40f75b
xorps xmm0, xmm0
mov eax, 2
movdqu xmmword [esp + 0x58], xmm0
mov word [esp + 0x58], ax
lea eax, [esp + 0xb0]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x40f72d
mov dword [esp + 0x5c], eax
lea eax, [esp + 0xb0]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
jne 0x40eeea
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
lea eax, [esp + 0x20bc]
push eax
push str.gethostbyname__s__failed__error_code:__d__error:__s
push 0x456
push 0x46360c
push 3
push str.Utility::URLDownload
jmp 0x40f75b
mov eax, dword [eax + 0xc]
mov esi, dword [esp + 0x20]
cmp esi, 0x1bb
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [esp + 0x5c], eax
mov eax, 0x50
cmove esi, eax
push esi
call dword [sym.imp.WS2_32.dll_htons]
push 0
push 1
push 2
mov word [esp + 0x66], ax
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [esp + 0x1c], edi
cmp edi, 0xffffffff
jne 0x40ef63
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
push str.socket___failed__error_code:__d__error:__s
push 0x46b
push 0x46360c
push 3
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
add esp, 0x24
jmp 0x40f769
push 4
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x10001
push eax
push 0x80
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 0x10
lea eax, [esp + 0x5c]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x40efdc
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
lea eax, [esp + 0x20bc]
push eax
push str.connect___failed__host:__s__error_code:__d__error:__s
push 0x478
push 0x46360c
push 3
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push edi
call fcn.0040b810
add esp, 0x2c
jmp 0x40f769
push 0x460828
lea ecx, [esp + 0x9c]
call fcn.00401403
push esi
lea eax, [esp + 0x30b4]
mov dword [esp + 0x3100], 0
push 0x463344
push eax
call fcn.0043a459
add esp, 0xc
lea eax, [esp + 0x98]
cmp byte [esp + 0x10b0], 0
push eax
push str.GET
jne 0x40f090
lea eax, [esp + 0x88]
push eax
call fcn.0040abe0
push 0x4635f0
push eax
lea eax, [esp + 0x54]
mov byte [esp + 0x3110], 1
push eax
call fcn.00403970
push str._HTTP_1.0_r_n
push eax
lea eax, [esp + 0x88]
mov byte [esp + 0x311c], 2
push eax
call fcn.00403970
add esp, 0x24
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x68]
call fcn.0040146f
lea ecx, [esp + 0x40]
call fcn.0040146f
lea ecx, [esp + 0x80]
jmp 0x40f0f9
lea eax, [esp + 0x70]
push eax
call fcn.0040abe0
lea ecx, [esp + 0x10bc]
mov byte [esp + 0x3108], 3
push ecx
push eax
lea eax, [esp + 0x54]
push eax
call fcn.00403970
push str._HTTP_1.0_r_n
push eax
lea eax, [esp + 0xa0]
mov byte [esp + 0x311c], 4
push eax
call fcn.00403970
add esp, 0x24
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
lea ecx, [esp + 0x40]
call fcn.0040146f
lea ecx, [esp + 0x68]
mov byte [esp + 0x30fc], 0
call fcn.0040146f
push str.Accept:_image_gif__image_x_xbitmap__image_jpeg__image_pjpeg__application_vnd.ms_powerpoint__application_vnd.ms_excel__application_msword__application_x_shockwave_flash____r_n
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x88]
push eax
call fcn.00403a10
add esp, 0xc
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
push str.Accept_Language:_en_us_r_n
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x88]
push eax
call fcn.00403a10
add esp, 0xc
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
push str.Pragma:_no_cache_r_n
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x88]
push eax
call fcn.00403a10
add esp, 0xc
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
push str.User_Agent:_Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.0__.NET_CLR_1.0.3705__.NET_CLR_1.1.4322__r_n
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x88]
push eax
call fcn.00403a10
add esp, 0xc
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
push str.Host:
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x30e0]
push eax
call fcn.00403a10
lea ecx, [esp + 0x20bc]
mov byte [esp + 0x3108], 5
push ecx
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.00403970
push 0x461ae4
push eax
lea eax, [esp + 0x88]
mov byte [esp + 0x311c], 6
push eax
call fcn.00403970
lea ecx, [esp + 0x30d4]
mov byte [esp + 0x3120], 7
push ecx
push eax
lea eax, [esp + 0x6c]
push eax
call fcn.00403970
mov byte [esp + 0x312c], 8
push 0x463a78
push eax
lea eax, [esp + 0xb8]
push eax
call fcn.00403970
add esp, 0x3c
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x80]
call fcn.0040146f
lea ecx, [esp + 0x40]
call fcn.0040146f
lea ecx, [esp + 0x68]
call fcn.0040146f
lea ecx, [esp + 0x28]
call fcn.0040146f
lea ecx, [esp + 0x30d8]
mov byte [esp + 0x30fc], 0
call fcn.0040146f
push str.Connection:_Keep_Alive_r_n_r_n
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x30e0]
push eax
call fcn.00403a10
add esp, 0xc
lea ecx, [esp + 0x98]
push eax
call fcn.00403c90
lea ecx, [esp + 0x30d8]
call fcn.0040146f
cmp dword [esp + 0xac], 0x10
lea eax, [esp + 0x98]
push 0
push dword [esp + 0xac]
cmovae eax, dword [esp + 0xa0]
push eax
push edi
call dword [sym.imp.WS2_32.dll_send]
cmp eax, dword [esp + 0xa8]
je 0x40f369
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
lea eax, [esp + 0x20bc]
push eax
push str.send___failed__host:__s__error_code:__d__error:__s
push 0x49e
push 0x46360c
push 3
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push edi
call fcn.0040b810
add esp, 0x2c
lea ecx, [esp + 0x98]
call fcn.0040146f
jmp 0x40f769
push 0x10000
call fcn.004167eb
add esp, 4
mov dword [esp + 0x18], eax
push 0
push 0xffff
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
mov dword [esp + 0x20], esi
test esi, esi
jg 0x40f3eb
mov eax, dword [esp + 0x18]
push eax
call fcn.004167f4
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
push str.recv___iReturn___1__error_code:__d__error:__s
push 0x4a9
push 0x46360c
push 0
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push edi
call fcn.0040b810
add esp, 0x28
lea ecx, [esp + 0x98]
call fcn.0040146f
jmp 0x40f769
mov edi, dword [esp + 0x3108]
test edi, edi
jne 0x40f49b
push str.Content_Length:
lea ecx, [esp + 0x6c]
call fcn.00401403
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x68]
cmp dword [esp + 0x7c], 0x10
push esi
cmovae eax, dword [esp + 0x6c]
push edi
push dword [esp + 0x80]
mov byte [esp + 0x3108], 9
push eax
call fcn.0040bd90
add esp, 0x10
cmp eax, 0xffffffff
je 0x40f59e
add eax, dword [esp + 0x78]
xor ecx, ecx
cmp eax, esi
jge 0x40f470
cmp ecx, 0x20
jge 0x40f469
mov dl, byte [eax + edi]
cmp dl, 0xd
je 0x40f466
cmp dl, 0xa
je 0x40f466
mov byte [esp + ecx + 0x30d0], dl
inc eax
inc ecx
cmp eax, esi
jl 0x40f447
cmp ecx, 0x20
jb 0x40f470
call fcn.004383dd
lea eax, [esp + 0x30d0]
mov byte [esp + ecx + 0x30d0], 0
push eax
call fcn.0043a280
add esp, 4
mov byte [esp + 0x30fc], 0
lea ecx, [esp + 0x68]
mov edi, eax
call fcn.0040146f
mov eax, dword [esp + 0x24]
mov dword [eax], edi
test edi, edi
jle 0x40f6e7
push esi
mov esi, dword [esp + 0x1c]
push esi
push 4
push 0x463b2c
call fcn.0040bd90
add esp, 0x10
cmp eax, 0xffffffff
je 0x40f6a3
lea esi, [eax + 4]
lea eax, [edi + 1]
push eax
call fcn.004167eb
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov dword [edx], eax
mov eax, dword [esp + 0x24]
sub eax, esi
push eax
mov dword [ecx], eax
mov eax, dword [esp + 0x20]
add eax, esi
push eax
push dword [edx]
call fcn.004384c0
push dword [esp + 0x28]
call fcn.004167f4
mov eax, dword [esp + 0x28]
add esp, 0x14
mov ecx, 0x3800
sub edi, dword [eax]
mov eax, 0x10000
cmp byte [esp + 0x310c], 0
cmovne eax, ecx
mov dword [esp + 0x20], eax
test edi, edi
je 0x40f57f
lea esi, [eax - 1]
push eax
call fcn.004167eb
add esp, 4
mov dword [esp + 0x24], eax
push 0
push esi
push eax
push dword [esp + 0x28]
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
jle 0x40f64c
mov eax, dword [esp + 0x14]
push esi
push dword [esp + 0x28]
mov ecx, dword [eax]
mov eax, dword [esp + 0x18]
add ecx, dword [eax]
push ecx
call fcn.004384c0
mov eax, dword [esp + 0x20]
push dword [esp + 0x30]
add dword [eax], esi
call fcn.004167f4
mov eax, dword [esp + 0x30]
add esp, 0x10
sub edi, esi
lea esi, [eax - 1]
jne 0x40f526
push dword [esp + 0x1c]
call fcn.0040b810
add esp, 4
lea ecx, [esp + 0x98]
call fcn.0040146f
mov al, 1
jmp 0x40f76b
push str.missing_Content_Length
push 0x4c7
push 0x46360c
push 0
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push esi
push edi
push 4
push 0x463b2c
call fcn.0040bd90
add esp, 0x28
cmp eax, 0xffffffff
je 0x40f610
mov ecx, dword [esp + 0x24]
lea esi, [eax + 4]
mov eax, dword [esp + 0x20]
sub eax, esi
mov dword [ecx], eax
inc eax
push eax
call fcn.004167eb
mov ecx, dword [esp + 0x14]
mov dword [ecx], eax
mov ecx, dword [esp + 0x28]
push dword [ecx]
lea ecx, [esi + edi]
push ecx
push eax
call fcn.004384c0
push edi
call fcn.004167f4
mov eax, dword [esp + 0x38]
add esp, 0x14
jmp 0x40f61c
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
mov dword [ecx], edi
mov dword [eax], esi
mov ecx, dword [esp + 0x14]
mov eax, dword [eax]
push dword [esp + 0x1c]
mov dword [ecx], eax
call fcn.0040b810
add esp, 4
lea ecx, [esp + 0x68]
call fcn.0040146f
lea ecx, [esp + 0x98]
call fcn.0040146f
mov al, 1
jmp 0x40f76b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
push str.recv___iReturn___1__error_code:__d__error:__s
push 0x4fb
push 0x46360c
push 0
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push dword [esp + 0x40]
call fcn.0040b810
push dword [esp + 0x4c]
call fcn.004167f4
add esp, 0x2c
lea ecx, [esp + 0x98]
call fcn.0040146f
jmp 0x40f769
push esi
call fcn.004167f4
push str.invalid_header
push 0x50c
push 0x46360c
push 0
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push dword [esp + 0x38]
call fcn.0040b810
add esp, 0x20
lea ecx, [esp + 0x98]
call fcn.0040146f
jmp 0x40f769
push dword [esp + 0x18]
call fcn.004167f4
push str.no_new_download
push 0x514
push 0x46360c
push 0
push str.Utility::URLDownload
push dword [0x4868e8]
call fcn.0040a4c0
push dword [esp + 0x38]
call fcn.0040b810
add esp, 0x20
lea ecx, [esp + 0x98]
call fcn.0040146f
mov al, 1
jmp 0x40f76b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
call fcn.004031d0
push eax
push esi
lea eax, [esp + 0x20bc]
push eax
push str.inet_addr__s__failed__error_code:__d__error:__s
push 0x45f
push 0x46360c
push 3
push str.Download
push dword [0x4868e8]
call fcn.0040a4c0
add esp, 0x28
xor al, al
mov ecx, dword [esp + 0x30f4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x30e4]
xor ecx, esp
call fcn.004396df
add esp, 0x30f4
ret