Function at 0x407170
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Receive data
Receive data on socket
Reference http user-agent string
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6c4
mov eax, dword [0x42f6dc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov dword [ebp - 0x6b4], eax
mov al, byte [ebp + 0x10]
mov edi, edx
push 0x200
mov dword [ebp - 0x6c0], edi
mov dword [ebp - 0x6b8], ecx
mov byte [ebp - 0x6a9], al
call fcn.0040ab1f
add esp, 4
cmp byte [ebp - 0x6a9], 0
mov dword [ebp - 0x6bc], eax
jne 0x4071e5
lea esi, [ebx + 0x200]
push esi
call fcn.0040ab1f
push esi
push 0
push eax
mov dword [ebp - 0x6b0], eax
call fcn.004103e0
add esp, 0x10
jmp 0x4071f1
mov eax, dword [ebp - 0x6c0]
mov dword [ebp - 0x6b0], eax
push 0x42acd8
push edi
call fcn.0040d110
add esp, 8
test eax, eax
jne 0x407215
push 0x42acdc
push edi
call fcn.0040d110
add esp, 8
test eax, eax
je 0x407252
mov ecx, edi
xor edx, edx
lea esi, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x407220
sub ecx, esi
je 0x407252
jmp 0x407230
mov al, byte [edi + edx]
cmp al, 0xa
je 0x40723b
cmp al, 0xd
jne 0x40723f
mov byte [edi + edx], 0
mov eax, edi
inc edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407245
sub eax, esi
cmp edx, eax
jb 0x407230
push 0xc0
lea eax, [ebp - 0x4c8]
push 0
mov ecx, 0x10
mov esi, 0x42ace0
lea edi, [ebp - 0x508]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.004103e0
push 0xb8
lea eax, [ebp - 0x3c0]
push 0
mov ecx, 0x12
mov esi, str.Mozilla_5.0__compatible__Konqueror_4.3__Linux__KHTML_4.3.5__like_Gecko_
lea edi, [ebp - 0x408]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.004103e0
movq xmm0, qword [str.Mozilla_4.8__en___Windows_NT_5.0__U_]
mov eax, dword [0x42ad88]
movq qword [ebp - 0x308], xmm0
movq xmm0, qword [0x42ad70]
mov dword [ebp - 0x2e8], eax
mov al, byte [0x42ad8c]
movq qword [ebp - 0x300], xmm0
movq xmm0, qword [0x42ad78]
push 0xdb
mov byte [ebp - 0x2e4], al
movq qword [ebp - 0x2f8], xmm0
movq xmm0, qword [0x42ad80]
lea eax, [ebp - 0x2e3]
push 0
push eax
movq qword [ebp - 0x2f0], xmm0
call fcn.004103e0
push 0xa8
lea eax, [ebp - 0x1b0]
push 0
mov ecx, 0x16
mov esi, str.Mozilla_4.0__compatible__MSIE_6.0__America_Online_Browser_1.1__rev1.5__Windows_NT_5.1__
lea edi, [ebp - 0x208]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.004103e0
mov ecx, 0x15
mov esi, str.Mozilla_5.0__Windows__U__Windows_NT_5.1__en_US__rv:1.7.5__Gecko_20060127_Netscape_8.1
lea edi, [ebp - 0x108]
rep movsd dword es:[edi], dword [esi]
push 0xaa
lea eax, [ebp - 0xb2]
push 0
push eax
movsw word es:[edi], word [esi]
call fcn.004103e0
push ebx
push 0
push dword [ebp - 0x6b4]
call fcn.004103e0
mov esi, dword [ebp - 0x6bc]
add esp, 0x48
push str.GET
push 0x200
push esi
call fcn.0040b739
push dword [ebp - 0x6c0]
push 0x200
push esi
call fcn.0040b78e
push str._HTTP_1.0_r_nHost:
push 0x200
push esi
call fcn.0040b78e
push dword [ebp - 0x6b8]
push 0x200
push esi
call fcn.0040b78e
push 0x42ae5c
push 0x200
push esi
call fcn.0040b78e
push str.Cache_Control:_max_age0__no_store_r_n
push 0x200
push esi
call fcn.0040b78e
add esp, 0x48
push str.User_agent:
push 0x200
push esi
call fcn.0040b78e
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edx, edx
mov ecx, 5
div ecx
lea eax, [ebp - 0x508]
shl edx, 8
add eax, edx
push eax
push 0x200
push esi
call fcn.0040b78e
push str._r_n_r_n
push 0x200
push esi
call fcn.0040b78e
add esp, 0x18
lea eax, [ebp - 0x6a8]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jns 0x407440
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [ebp - 0x6c4]
jmp 0x40764c
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x407646
push dword [ebp - 0x6b8]
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x40764c
mov ecx, 2
mov word [ebp - 0x518], cx
mov eax, dword [eax + 0xc]
push 0x50
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x514], eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x516], ax
push 0x10
lea eax, [ebp - 0x518]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4074be
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40764c
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4074c3
push 0
sub ecx, edx
push ecx
push esi
push edi
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x407646
mov ecx, dword [sym.imp.WS2_32.dll_recv]
mov dl, byte [ebp - 0x6a9]
xor esi, esi
mov edi, edi
mov eax, ebx
sub eax, esi
push 0
test dl, dl
je 0x407504
dec eax
push eax
mov eax, dword [ebp - 0x6b4]
jmp 0x407510
add eax, 0x200
push eax
mov eax, dword [ebp - 0x6b0]
add eax, esi
push eax
push edi
call ecx
mov dl, byte [ebp - 0x6a9]
add esi, eax
lea ecx, [ebx + 0x200]
test dl, dl
je 0x40752a
mov ecx, ebx
cmp esi, ecx
jge 0x407538
mov ecx, dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x4074f0
cmp eax, 0xffffffff
jne 0x407547
cmp byte [ebp + 0x14], 0
je 0x407646
mov esi, dword [ebp - 0x6b0]
test dl, dl
mov eax, esi
cmovne eax, dword [ebp - 0x6b4]
push str.HTTP_1.1_200_OK
push eax
mov dword [ebp - 0x6b8], eax
call fcn.0040d110
mov ecx, dword [ebp - 0x6b8]
add esp, 8
cmp eax, ecx
je 0x407597
push str.HTTP_1.0_200_OK
push ecx
call fcn.0040d110
add esp, 8
cmp eax, dword [ebp - 0x6b8]
je 0x407597
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x407652
push dword [ebp - 0x6bc]
call fcn.0040b7f1
add esp, 4
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
cmp byte [ebp - 0x6a9], 0
jne 0x407633
push str._r_n_r_n
push esi
call fcn.0040d110
add esp, 8
test eax, eax
je 0x40765b
cmp byte [ebp + 0x14], 0
je 0x4075fa
push ebx
push str._r_n_r_n
push esi
call fcn.0040d110
add esp, 8
add eax, 4
push eax
push dword [ebp - 0x6b4]
call fcn.0040db80
add esp, 0xc
jmp 0x40761f
lea eax, [ebx - 1]
push eax
push str._r_n_r_n
push esi
call fcn.0040d110
add esp, 8
add eax, 4
push eax
push ebx
push dword [ebp - 0x6b4]
call fcn.0040ce37
add esp, 0x10
push esi
call fcn.0040b7f1
mov eax, dword [ebp - 0x6b4]
add esp, 4
cmp byte [eax], 0
je 0x40767f
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b6df
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [ebp - 0x6b0]
cmp byte [ebp - 0x6a9], 0
jne 0x407664
push esi
call fcn.0040b7f1
add esp, 4
push dword [ebp - 0x6bc]
call fcn.0040b7f1
add esp, 4
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0040b6df
mov esp, ebp
pop ebp
ret