Function at 0x417340
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 0x42bbec
push eax
mov eax, 0x10ac
mov dword fs:[0], esp
call fcn.0042a3e0
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov ax, word [ebp + 6]
test ax, ax
je 0x41762b
mov esi, dword [sym.imp.MSVCRT.dll_sprintf]
lea ecx, [esp + 0x38]
movsx eax, ax
push eax
push str.ad_d
push ecx
call esi
lea edx, [esp + 0x44]
lea eax, [esp + 0xc4]
push edx
push str.http:___s_main_ad.html
push eax
call esi
mov cl, byte [esp + 0x2b]
add esp, 0x18
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 0x4173fe
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
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], ebx
mov byte [eax + ebx], 0
lea ecx, [esp + 0x6b8]
lea edx, [esp + 0xb8]
push ecx
push edx
mov ecx, ebp
mov dword [esp + 0x10cc], 0
call fcn.00416ee0
movsx eax, byte [esp + 0xab8]
mov ebx, dword [esp + 0xcb8]
push eax
call dword [sym.imp.MSVCRT.dll_isalpha]
add esp, 4
test eax, eax
je 0x41744d
lea ecx, [esp + 0xab8]
push ecx
call dword [sym.imp.WSOCK32.dll_gethostbyname]
jmp 0x41746e
lea edx, [esp + 0xab8]
push edx
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov dword [esp + 0x34], eax
push 2
lea eax, [esp + 0x38]
push 4
push eax
call dword [sym.imp.WSOCK32.dll_gethostbyaddr]
test eax, eax
jne 0x4174a7
mov eax, dword [ebp + 0xc]
push 0
push 0x927c0
push 0x274c
mov ecx, dword [eax + 0x20]
push ecx
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 0x41762b
xor edx, edx
lea edi, [esp + 0x28]
mov dword [esp + 0x24], edx
push ebx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
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 0x417553
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 0x41762b
mov al, byte [ecx - 1]
test al, al
je 0x417621
cmp al, 0xff
je 0x417621
dec al
mov byte [ecx - 1], al
jmp 0x41762b
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 0x4175b4
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 0x417600
mov ecx, dword [ebp + 0xc]
push 0x274c
mov edx, dword [ecx + 0x20]
push edx
call dword [sym.imp.USER32.dll_KillTimer]
mov ecx, dword [ebp + 0xc]
push 0
push 0
push 0
lea eax, [esp + 0xc4]
push 0
push eax
add ecx, 0x6e8
call fcn.0041e7d0
push esi
call dword [sym.imp.WSOCK32.dll_closesocket]
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x41762b
mov al, byte [ecx - 1]
test al, al
je 0x417621
cmp al, 0xff
je 0x417621
dec al
mov byte [ecx - 1], al
jmp 0x41762b
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