Function at 0x4012ea
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp 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 ebp
mov ebp, esp
sub esp, 0xa78
mov ecx, dword [ebp + 8]
and dword [0x442470], 0
and byte [ebp - 0x678], 0
xor eax, eax
push ebx
inc eax
push esi
lea edx, [ebp - 0xa78]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
push edi
mov word [ebp - 0x2c], 0x2f
lea ebx, [ebp - 0xa78]
lea eax, [ebp - 0xa78]
sub ecx, edx
mov dl, byte [ecx + eax]
cmp dl, 0x5c
jne 0x401335
add dl, 0xd3
test dl, dl
mov byte [eax], dl
je 0x40133e
inc eax
jmp 0x40132a
lea eax, [ebp - 0xa78]
push 0x3a
push eax
call fcn.0040fd90
mov edi, eax
test edi, edi
pop ecx
pop ecx
lea eax, [ebp - 0xa78]
je 0x4013ee
and byte [edi], 0
push str.http
push eax
call fcn.00419e0e
test eax, eax
pop ecx
pop ecx
jne 0x401899
mov byte [edi], 0x3a
inc edi
mov al, byte [edi]
inc edi
cmp al, 0x2f
jne 0x401899
mov al, byte [edi]
inc edi
cmp al, 0x2f
jne 0x401899
push 0x2f
push edi
call fcn.0040fd90
pop ecx
mov esi, eax
test esi, esi
pop ecx
lea eax, [ebp - 0xa78]
push eax
lea eax, [ebp - 0xcc]
push eax
je 0x4013cc
and byte [esi], 0
call fcn.0040f100
lea eax, [ebp - 0xcc]
push 0x4317c4
push eax
call fcn.0040f110
mov byte [esi], 0x2f
jmp 0x4013e5
call fcn.0040f100
lea eax, [ebp - 0xcc]
push 0x4317c4
push eax
call fcn.0040f110
lea esi, [ebp - 0x2c]
add esp, 0x10
mov ebx, edi
xor edi, edi
jmp 0x40146c
push 0x2f
push eax
call fcn.0040fd90
pop ecx
pop ecx
mov esi, eax
xor edi, edi
cmp esi, edi
lea eax, [ebp - 0xcc]
push 0x4317bc
push eax
je 0x40143d
and byte [esi], 0
call fcn.0040f100
lea eax, [ebp - 0xa78]
push eax
lea eax, [ebp - 0xcc]
push eax
call fcn.0040f110
lea eax, [ebp - 0xcc]
push 0x4317c4
push eax
call fcn.0040f110
mov byte [esi], 0x2f
jmp 0x401469
call fcn.0040f100
lea eax, [ebp - 0xa78]
push eax
lea eax, [ebp - 0xcc]
push eax
call fcn.0040f110
lea eax, [ebp - 0xcc]
push 0x4317c4
push eax
call fcn.0040f110
lea esi, [ebp - 0x2c]
add esp, 0x18
lea eax, [ebp - 0x678]
push esi
push eax
call fcn.0040f110
lea eax, [ebp - 0x678]
push str._HTTP_1.1
push eax
call fcn.0040f110
push 0x2f
push ebx
call fcn.0040fd90
add esp, 0x18
cmp eax, edi
je 0x401899
and byte [eax], 0
lea eax, [ebp - 0x178]
push ebx
push eax
call fcn.0040f100
or ebx, 0xffffffff
cmp dword [ebp + 0x10], edi
pop ecx
pop ecx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x28], edi
jne 0x4014da
push edi
push dword [ebp + 0xc]
call fcn.00401175
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp - 8], eax
jne 0x4014ec
jmp 0x401899
mov eax, 0x800
push eax
mov dword [ebp - 0x28], eax
call fcn.00401191
pop ecx
mov dword [ebp - 0xc], eax
xor edi, edi
inc edi
push 0x50
mov dword [0x442470], edi
mov word [ebp - 0x4c], 2
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x4a], ax
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, ebx
mov dword [ebp - 0x48], eax
jne 0x40153a
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x401872
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x48], eax
push 6
push edi
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 4], esi
je 0x401872
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x401b7e
push 0x31
push eax
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, ebx
je 0x401860
push 4
lea eax, [ebp - 0x3c]
push eax
push edi
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 0x10
lea eax, [ebp - 0x4c]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
jne 0x4015b7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401860
and byte [ebp - 0x578], 0
xor esi, esi
mov dword [0x442470], esi
mov dword [ebp - 0x18], 0x258
mov dword [ebp - 0x10], esi
mov dword [ebp + 8], 8
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [ebp + 0x1c], esi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x24], esi
je 0x4015f9
push eax
push esi
push esi
push esi
push esi
call dword [ebp + 0x1c]
add esp, 0x14
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [ebp + 0x18]
xor esi, esi
cmp eax, esi
je 0x401610
cmp dword [eax], esi
jne 0x401860
push esi
push esi
push esi
lea eax, [ebp - 0x1c]
push eax
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0x102
je 0x401a05
lea eax, [ebp - 0xf8]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
cmp eax, 0xffffffff
jne 0x40164b
xor eax, eax
cmp eax, esi
jmp 0x401a82
test byte [ebp - 0xf8], 0x10
je 0x4018b3
xor eax, eax
cmp eax, esi
lea eax, [ebp - 0x678]
push eax
lea eax, [ebp - 0x578]
push str.GET__s_r_n
mov dword [0x442470], 2
mov dword [ebp - 0x18], 0x258
mov dword [ebp - 0x14], esi
push eax
jne 0x40173e
call edi
add esp, 0xc
lea eax, [ebp - 0x178]
push eax
lea eax, [ebp - 0x578]
push str.Host:__s_r_n
push eax
call fcn.0040f5a0
pop ecx
lea eax, [ebp + eax - 0x578]
push eax
call edi
lea eax, [ebp - 0x578]
push str.Accept:___r_n
push eax
call fcn.0040f110
add esp, 0x14
lea eax, [ebp - 0xcc]
push eax
lea eax, [ebp - 0x578]
push str.Referer:__s_r_n
push eax
call fcn.0040f5a0
pop ecx
lea eax, [ebp + eax - 0x578]
push eax
call edi
lea eax, [ebp - 0x578]
push str.User_Agent:_Mozilla_4.0__compatible__MSIE_5.00__Windows_98__r_n
push eax
call fcn.0040f110
add esp, 0x14
cmp dword [ebp + 0x14], esi
je 0x401726
lea eax, [ebp - 0x578]
push str.Pragma:_no_cache_r_n
push eax
call fcn.0040f110
lea eax, [ebp - 0x578]
push str.Cache_Control:_no_cache_r_n
push eax
call fcn.0040f110
add esp, 0x10
lea eax, [ebp - 0x578]
push str.Connection:_close_r_n_r_n
push eax
call fcn.0040f110
pop ecx
pop ecx
jmp 0x40182d
call edi
add esp, 0xc
lea eax, [ebp - 0x178]
push eax
lea eax, [ebp - 0x578]
push str.Host:__s_r_n
push eax
call fcn.0040f5a0
pop ecx
lea eax, [ebp + eax - 0x578]
push eax
call edi
lea eax, [ebp - 0x578]
push str.Accept:___r_n
push eax
call fcn.0040f110
add esp, 0x14
lea eax, [ebp - 0xcc]
push eax
lea eax, [ebp - 0x578]
push str.Referer:__s_r_n
push eax
call fcn.0040f5a0
pop ecx
lea eax, [ebp + eax - 0x578]
push eax
call edi
lea eax, [ebp - 0x578]
push str.User_Agent:_Mozilla_4.0__compatible__MSIE_5.00__Windows_98__r_n
push eax
call fcn.0040f110
add esp, 0x14
push dword [ebp - 0x10]
lea eax, [ebp - 0x578]
push str.Range:_bytes_d__r_n
push eax
call fcn.0040f5a0
pop ecx
lea eax, [ebp + eax - 0x578]
push eax
call edi
add esp, 0xc
cmp dword [ebp + 0x14], esi
je 0x4017fd
lea eax, [ebp - 0x578]
push str.Pragma:_no_cache_r_n
push eax
call fcn.0040f110
lea eax, [ebp - 0x578]
push str.Cache_Control:_no_cache_r_n
push eax
call fcn.0040f110
add esp, 0x10
lea eax, [ebp - 0x578]
push str.Connection:_close_r_n_r_n
push eax
call fcn.0040f110
pop ecx
pop ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [ebp + 0x1c], esi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x20], esi
je 0x40182d
push eax
push esi
push esi
push esi
push 1
call dword [ebp + 0x1c]
add esp, 0x14
lea eax, [ebp - 0x578]
push eax
call fcn.0040f5a0
pop ecx
push esi
mov ebx, eax
push ebx
lea eax, [ebp - 0x578]
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x4018a0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x4018b3
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x1c]
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
cmp dword [ebp - 8], 0xffffffff
je 0x40188a
push dword [ebp - 8]
call fcn.004010d9
push dword [ebp + 0xc]
call fcn.0040110f
pop ecx
pop ecx
cmp dword [ebp - 0xc], 0
je 0x401899
push dword [ebp - 0xc]
call fcn.00401256
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
cmp eax, ebx
je 0x4018a9
mov dword [ebp - 0x14], eax
jmp 0x4018b3
and byte [ebp - 0x578], 0
mov dword [ebp - 0x14], esi
test byte [ebp - 0xf8], 1
je 0x401b46
xor ebx, ebx
jmp 0x401966
cmp esi, ebx
je 0x40199d
cmp dword [ebp + 0x10], ebx
jne 0x4018f7
cmp dword [ebp - 8], 0xffffffff
je 0x401940
push esi
lea eax, [ebp - 0xa78]
push eax
push dword [ebp - 8]
call fcn.004010b4
add esp, 0xc
cmp eax, esi
jne 0x401860
jmp 0x40193d
mov eax, dword [ebp - 0x34]
lea ebx, [esi + eax]
cmp ebx, dword [ebp - 0x28]
jl 0x401921
add dword [ebp - 0x28], 0x2800
push dword [ebp - 0x28]
push dword [ebp - 0xc]
call fcn.004011d9
test eax, eax
pop ecx
pop ecx
je 0x401860
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
push esi
lea eax, [ebp - 0xa78]
push eax
mov eax, dword [ebp - 0x34]
add eax, ecx
push eax
call fcn.0040f260
add esp, 0xc
mov dword [ebp - 0x34], ebx
add dword [ebp - 0x10], esi
add dword [ebp - 0x20], esi
xor ebx, ebx
cmp dword [ebp + 0x1c], ebx
je 0x401966
cmp dword [ebp - 0x24], ebx
jne 0x401952
mov dword [ebp - 0x24], esi
push dword [ebp - 0x30]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push 3
call dword [ebp + 0x1c]
add esp, 0x14
push ebx
push 0x400
lea eax, [ebp - 0xa78]
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4018c7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x40199d
xor eax, eax
cmp eax, ebx
jmp 0x401a82
xor eax, eax
cmp eax, ebx
je 0x4019ac
cmp dword [ebp + 8], ebx
jne 0x401a92
cmp dword [ebp + 0x1c], ebx
je 0x4019c5
push dword [ebp - 0x30]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push 2
call dword [ebp + 0x1c]
add esp, 0x14
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x1c]
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
cmp dword [ebp + 0x10], ebx
jne 0x401b5f
xor esi, esi
cmp dword [ebp - 8], 0xffffffff
je 0x401b77
push dword [ebp - 8]
call fcn.00401184
push dword [ebp - 8]
mov esi, eax
call fcn.004010d9
pop ecx
pop ecx
jmp 0x401b77
call fcn.00401268
cmp dword [ebp - 0x18], 0x258
jne 0x401a1d
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401a75
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [ebp - 0x14]
lea esi, [ebp + esi - 0x578]
push esi
call fcn.0040f5a0
mov ebx, eax
test ebx, ebx
pop ecx
je 0x401a75
push 0
push ebx
push esi
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x401a61
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401860
jmp 0x401a75
cmp eax, ebx
je 0x401a6a
mov dword [ebp - 0x14], eax
jmp 0x401a75
and dword [ebp - 0x14], 0
and byte [ebp - 0x578], 0
dec dword [ebp - 0x18]
jns 0x4015ff
xor eax, eax
test eax, eax
je 0x401860
cmp dword [ebp + 8], 0
je 0x401860
push dword [ebp - 4]
dec dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x1c]
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
cmp dword [ebp + 0x1c], 0
je 0x401ac1
push dword [ebp - 0x30]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push 4
call dword [ebp + 0x1c]
add esp, 0x14
push 6
push 1
push 2
mov dword [ebp - 0x18], 0x258
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 4], esi
je 0x401872
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x401b7e
push 0x31
push eax
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x401860
push 4
lea eax, [ebp - 0x3c]
push eax
push 1
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 0x10
lea eax, [ebp - 0x4c]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x401b46
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401860
test byte [ebp - 0xf8], 2
je 0x401a05
mov dword [ebp - 0x18], 0x258
jmp 0x401a05
mov eax, dword [ebp + 0xc]
cmp eax, ebx
mov ecx, dword [ebp - 0x34]
mov esi, ecx
je 0x401b70
mov edx, dword [ebp - 0xc]
mov dword [eax], edx
mov eax, dword [ebp - 0xc]
and byte [ecx + eax], 0
mov eax, esi
jmp 0x40189b
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x401872