Function at 0x401120
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Set socket configuration

Disassembly:
mov eax, 0x40ba8c
call fcn.00405130
push ecx
mov eax, 0x1022c
call fcn.004050f0
mov eax, dword [0x40f440]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
cmp edi, ebx
mov esi, ecx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x10130], esi
mov dword [esi + 0x468], ebx
mov dword [esi + 0x46c], ebx
je 0x40116b
push edi
call fcn.00404af0
test eax, eax
pop ecx
jne 0x401178
push str.Error__url_is_nothing.
push ebx
push 2
jmp 0x401983
push edi
call fcn.00404af0
cmp eax, 0xff
pop ecx
jbe 0x401193
push str.Error__url_too_long.
push ebx
push 3
jmp 0x401983
mov cl, byte [edi]
xor ebx, ebx
test cl, cl
mov dword [ebp - 0x10118], 1
je 0x4011ba
lea edx, [ebp - 0x114]
mov eax, edi
sub edx, edi
mov byte [edx + eax], cl
inc ebx
inc eax
mov cl, byte [eax]
test cl, cl
jne 0x4011af
lea eax, [ebp - 0x114]
push eax
mov byte [ebp + ebx - 0x114], 0
push str._r_nCached_URL:__s_r_n
inc ebx
call fcn.00404c17
xor eax, eax
pop ecx
pop ecx
xor ecx, ecx
cmp ebx, eax
mov dword [ebp - 0x10120], eax
mov dword [ebp - 0x1011c], eax
mov dword [ebp - 0x10128], eax
mov dword [ebp - 0x10124], eax
jle 0x4012a8
lea edi, [ebp + eax - 0x114]
mov dl, byte [edi]
cmp dl, 0x3a
jne 0x401255
inc eax
mov byte [edi], 0
cmp byte [ebp + eax - 0x114], 0x2f
mov dword [ebp - 0x10118], 1
jne 0x40123d
inc eax
cmp byte [ebp + eax - 0x114], 0x2f
jne 0x401261
lea ecx, [ebp + ecx - 0x114]
inc eax
mov dword [ebp - 0x10120], ecx
mov ecx, eax
jmp 0x40125a
cmp dword [ebp - 0x1011c], 0
jne 0x40125a
lea ecx, [ebp + ecx - 0x114]
mov dword [ebp - 0x1011c], ecx
jmp 0x401239
cmp dl, 0x2f
je 0x40126f
inc eax
cmp eax, ebx
jl 0x4011fa
jmp 0x40129f
push str.Error__proto_parse_failed.
push 0
push 6
jmp 0x401983
and dword [ebp - 0x10118], 0
cmp dword [ebp - 0x1011c], 0
mov byte [ebp + eax - 0x114], 0
lea ecx, [ebp + ecx - 0x114]
jne 0x401296
mov dword [ebp - 0x1011c], ecx
jmp 0x40129c
mov dword [ebp - 0x10128], ecx
lea ecx, [eax + 1]
cmp dword [ebp - 0x1011c], 0
jne 0x4012b7
lea eax, [ebp + ecx - 0x114]
mov dword [ebp - 0x1011c], eax
jmp 0x4012eb
xor eax, eax
cmp dword [ebp - 0x10128], eax
jne 0x4012d6
cmp dword [ebp - 0x10118], eax
je 0x4012de
lea edx, [ebp + ecx - 0x114]
mov dword [ebp - 0x10128], edx
cmp dword [ebp - 0x10118], eax
jne 0x4012eb
lea eax, [ebp + ecx - 0x114]
mov dword [ebp - 0x10124], eax
mov eax, dword [ebp - 0x1011c]
test eax, eax
je 0x40197a
cmp byte [eax], 0
je 0x40197a
cmp dword [ebp - 0x10128], 0
jne 0x401317
mov dword [ebp - 0x10118], 0x50
jmp 0x401346
mov edi, dword [ebp - 0x10128]
push edi
call fcn.00404c12
test eax, eax
pop ecx
mov dword [ebp - 0x10118], eax
jl 0x40196f
cmp eax, 0xffff
jg 0x40196f
cmp byte [edi], 0
je 0x40196f
cmp dword [esi + 0x35c], 0
jne 0x401417
cmp dword [ebp - 0x10124], 0
lea edi, [esi + 0xab]
mov byte [esi + 0xaa], 0x2f
mov byte [edi], 0
je 0x40138d
mov eax, dword [ebp - 0x10124]
cmp byte [eax], 0
je 0x40138d
push eax
call fcn.00404af0
pop ecx
push eax
push dword [ebp - 0x10124]
mov ecx, esi
push edi
call fcn.0040104d
mov edi, 0x40c4d8
push edi
call fcn.00404c17
push dword [ebp - 0x10120]
push str.Proto:__s_r_n
call fcn.00404c17
push dword [ebp - 0x1011c]
push str.Host:__s_r_n
call fcn.00404c17
push dword [ebp - 0x10118]
push dword [ebp - 0x10128]
push str.Port:__s____d_r_n
call fcn.00404c17
push dword [ebp - 0x10124]
push str.URI:__s_r_n
call fcn.00404c17
add esp, 0x28
cmp dword [esi + 0x35c], 0
push dword [ebp - 0x1011c]
mov ebx, 0x40c49c
push ebx
je 0x40145a
lea eax, [esi + 0x69]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp dword [ebp - 0x10120], 0
push dword [ebp + 8]
jne 0x401435
lea eax, [esi + 0xaa]
jmp 0x401446
lea eax, [esi + 0x28]
test eax, eax
je 0x401427
cmp byte [eax], 0
jne 0x40138d
push str.Error__proxy_not_specified.
push 0
push 5
jmp 0x401983
mov eax, dword [ebp - 0x10120]
cmp byte [eax], 0
lea eax, [esi + 0xaa]
jne 0x401457
push str.http:___s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
jmp 0x4014a7
push ebx
jmp 0x40144b
lea eax, [esi + 0x28]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
push dword [ebp - 0x1011c]
lea eax, [esi + 0x1a9]
push ebx
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
push dword [ebp - 0x1011c]
lea eax, [esi + 0x69]
push ebx
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esi + 0xaa]
push eax
push ebx
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [ebp - 0x10118]
add esp, 0x30
mov dword [esi + 0x358], eax
push dword [esi + 0x358]
lea eax, [esi + 0x1a9]
push eax
lea ecx, [esi + 0x28]
push ecx
push str.Server:__s_ServerIP:__s_Port:__d__r_n
call fcn.00404c17
push str.Proxy:
call fcn.00404c17
add esp, 0x14
cmp dword [esi + 0x35c], 0
je 0x4014df
push str._YES_r_n
jmp 0x4014e4
push str._NO_r_n
call fcn.00404c17
pop ecx
lea eax, [esi + 0x69]
push eax
lea eax, [esi + 0xaa]
push eax
push str.URL_URI:__s_HOST:__s_r_n
call fcn.00404c17
add esp, 0xc
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x401520
push str.Error_when_socket.
push eax
jmp 0x40194d
and word [ebp - 0x1012a], 0
push 4
lea ecx, [ebp - 0x1012c]
push ecx
push 0x80
push 0xffff
push eax
mov word [ebp - 0x1012c], 1
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x401576
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_setsockopt_LINGER_.
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 1
mov ecx, esi
call fcn.00401014
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
jmp 0x40198a
push 4
lea eax, [esi + 0x350]
push eax
push 0x1006
push 0xffff
push dword [esi + 4]
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x4015a7
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_setsockopt_RCVTIME_.
jmp 0x401947
push 4
lea eax, [esi + 0x354]
push eax
push 0x1005
push 0xffff
push dword [esi + 4]
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x4015d8
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_setsockopt_SNDTIMEO_.
jmp 0x401947
push 0
call sub.WSOCK32.dll_htonl
mov dword [esi + 0xc], eax
lea eax, [esi + 8]
push 0x10
push eax
push dword [esi + 4]
mov word [eax], 2
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x40160c
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_bind_socket.
jmp 0x401947
lea eax, [esi + 0x28]
push eax
call sub.WSOCK32.dll_gethostbyname
test eax, eax
mov dword [ebp - 0x10120], eax
je 0x40163c
lea eax, [esi + 0x28]
push eax
call fcn.00404af0
test eax, eax
pop ecx
je 0x40163c
mov eax, dword [ebp - 0x10120]
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
jmp 0x401677
call sub.WSOCK32.dll_WSAGetLastError
mov dword [ebp - 0x10120], eax
lea eax, [esi + 0x1a9]
push eax
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x40195a
lea eax, [esi + 0x1a9]
push eax
call fcn.00404af0
test eax, eax
pop ecx
je 0x40195a
mov eax, dword [ebp + 8]
mov dword [esi + 0x1c], eax
xor eax, eax
mov ax, word [esi + 0x358]
mov word [esi + 0x18], 2
push eax
call sub.WSOCK32.dll_htons
mov ecx, dword [esi + 4]
mov dword [ebp - 0x10238], ecx
lea ecx, [ebp - 0x10138]
push ecx
mov word [esi + 0x1a], ax
xor eax, eax
push eax
push eax
lea ecx, [ebp - 0x1023c]
push ecx
push eax
mov dword [ebp - 0x10138], eax
mov dword [ebp - 0x10134], eax
mov dword [ebp - 0x1023c], 1
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
jne 0x4016e1
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_select.
jmp 0x401947
push 0x10
lea eax, [esi + 0x18]
push eax
push dword [esi + 4]
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x401706
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_connect.
jmp 0x401947
push str.GET
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push str.GET
call fcn.00404c17
pop ecx
lea eax, [esi + 0xaa]
push eax
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
lea eax, [esi + 0xaa]
push eax
push ebx
call fcn.00404c17
pop ecx
pop ecx
mov ebx, str._HTTP_1.0_r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
pop ecx
mov ebx, str.Accept:_image_gif__image_x_bitmap__image_jpeg__image_pjpeg__application_vnd.ms_powerpoint__application_vnd.ms_excel__application_msword__application_x_comet____r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
pop ecx
mov ebx, str.Accept_Language:_en_r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
pop ecx
mov ebx, str.Accept_Encoding:_gzip__deflate_r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
pop ecx
mov ebx, str.Cache_Control:_no_cache_r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
pop ecx
mov ebx, str.User_Agent:_Mozilla_4.0__compatible__MSIE_5.0__Windows_NT__DigExt__DTS_Agent___r_n
push ebx
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push ebx
call fcn.00404c17
mov dword [esp], str.Host:
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push dword [ebp - 0x1011c]
mov ecx, esi
push dword [esi + 4]
call fcn.00401079
push edi
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push dword [ebp - 0x1011c]
push str.Host:__s_r_n
call fcn.00404c17
pop ecx
pop ecx
push edi
push dword [esi + 4]
mov ecx, esi
call fcn.00401079
push edi
call fcn.00404c17
xor edi, edi
xor ebx, ebx
pop ecx
mov dword [ebp - 0x10120], edi
mov dword [ebp - 0x10118], edi
inc ebx
mov dword [ebp - 4], edi
cmp ebx, 0xffffffff
je 0x401920
test ebx, ebx
je 0x401920
push 0
push 0xffff
lea eax, [ebp - 0x10114]
push eax
push dword [esi + 4]
call sub.WSOCK32.dll_recv
push 4
mov ebx, eax
push 0x1000
lea eax, [ebx + edi]
push eax
push 0
mov dword [ebp - 0x10124], ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
and dword [ebp + 8], 0
cmp dword [ebp - 0x10120], 0
mov dword [ebp - 0x10118], eax
je 0x4018b3
mov eax, dword [ebp + 8]
cmp eax, edi
jae 0x4018a1
mov ecx, dword [ebp - 0x10120]
mov cl, byte [eax + ecx]
mov edx, dword [ebp - 0x10118]
mov byte [eax + edx], cl
inc eax
mov dword [ebp + 8], eax
jmp 0x401885
push 0x4000
push edi
push dword [ebp - 0x10120]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 0x10118]
lea ecx, [ebx + edi]
cmp dword [ebp + 8], ecx
jae 0x4018d8
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
sub ecx, edi
mov cl, byte [ebp + ecx - 0x10114]
inc dword [ebp + 8]
mov byte [edx + eax], cl
jmp 0x4018b9
add edi, ebx
test eax, eax
mov dword [ebp + 8], edi
mov dword [ebp - 0x10120], eax
jne 0x40182d
push eax
push eax
call fcn.0040514f
push str.Error_when_memory_alloc.
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x10130]
push eax
push 1
call fcn.00401014
mov eax, 0x401911
ret
mov eax, dword [ebp - 0x10118]
push dword [esi + 4]
or dword [ebp - 4], 0xffffffff
mov dword [esi + 0x46c], edi
mov dword [esi + 0x468], eax
call sub.WSOCK32.dll_closesocket
test ebx, ebx
je 0x401951
push str.Error_when_recieve.
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 1
jmp 0x401983
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0xc]
jmp 0x40198a
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
push str.Error_when_resolve_host.
push dword [ebp - 0x10120]
jmp 0x401981
push str.Error__bad_port_in_URL.
push 0
push 8
jmp 0x401983
push str.Error__bad_host_in_URL.
push 0
push 7
mov ecx, esi
call fcn.00401014
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x14]
call fcn.00404bac
pop edi
pop esi
pop ebx
leave
ret 4