Function at 0x40a640
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Send data
Send data on socket
Send http request
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x164
mov eax, dword [0x430034]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov dword [ebp - 0x140], eax
xor edi, edi
mov eax, dword [ebp + 0x14]
push 4
mov dword [ebp - 0x164], eax
lea eax, [ebp - 0x124]
push eax
push 0x1006
push 0xffff
push ecx
mov dword [ebp - 0x138], edx
mov dword [ebp - 0x154], ecx
mov dword [ebp - 0x148], ebx
mov dword [ebp - 0x124], 0x1388
call dword [sym.imp.WS2_32.dll_setsockopt]
mov eax, dword [sym.imp.WS2_32.dll_recv]
mov esi, dword [ebx]
mov dword [ebp - 0x158], eax
mov eax, dword [sym.imp.ntdll.dll_NtDelayExecution]
mov dword [ebp - 0x15c], eax
nop dword [eax + eax]
test esi, esi
jne 0x40a6d0
push 0x21
call fcn.00414236
add esp, 4
jmp 0x40a6dd
lea eax, [edi + 0x21]
push eax
push esi
call fcn.00411ab3
add esp, 8
push 0
mov dword [ebx], eax
add eax, edi
push 0x20
push eax
push dword [ebp - 0x154]
call dword [ebp - 0x158]
test eax, eax
je 0x40a6fb
cmp eax, 0xffffffff
jne 0x40a703
test edi, edi
je 0x40af59
add edi, eax
mov dword [ebp - 0x18], 0xfffc2f70
mov eax, dword [ebx]
mov dword [ebp - 0x14], 0xffffffff
mov byte [edi + eax], 0
lea eax, [ebp - 0x18]
push eax
push 0
call dword [ebp - 0x15c]
mov esi, dword [ebx]
mov edx, str._r_n_r_n
push 0
push ecx
mov ecx, esi
call fcn.004099e0
add esp, 8
mov dword [ebp - 0x144], eax
cmp eax, 0xffffffff
je 0x40a6c0
push 0
sub edi, eax
mov dword [ebp - 0x10], 0
push ecx
xorps xmm0, xmm0
mov edx, 0x42c62c
mov ecx, esi
movq qword [ebp - 0x18], xmm0
add edi, 0xfffffffc
call fcn.004099e0
add esp, 8
lea ecx, [eax + esi]
mov ax, word [ecx + 1]
mov word [ebp - 0x18], ax
mov al, byte [ecx + 3]
lea ecx, [ebp - 0x18]
mov byte [ebp - 0x16], al
call fcn.0040de70
mov dword [ebp - 0x10], eax
cmp eax, 0x133
mov eax, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0x160], eax
jne 0x40a957
mov edx, dword [str.Location]
lea eax, [ebp - 0x13c]
push ecx
push eax
mov ecx, esi
mov dword [ebp - 0x13c], 0
call fcn.0040a500
mov esi, dword [ebp - 0x13c]
add esp, 8
test esi, esi
je 0x40aa07
mov eax, dword [ebx]
test eax, eax
je 0x40a7df
push eax
call fcn.0041421b
add esp, 4
push 0x104
lea eax, [ebp - 0x120]
mov dword [ebx], 0
push 0
push eax
call fcn.0040ffd0
add esp, 0xc
lea eax, [ebp - 0x120]
push esi
push dword [0x42c2e8]
push eax
call dword [ebp - 0x160]
add esp, 0xc
mov dword [ebp - 0x15c], eax
push dword [ebp - 0x154]
call dword [sym.imp.WS2_32.dll_closesocket]
push esi
call fcn.0041421b
mov eax, dword [ebp - 0x138]
add esp, 4
xor esi, esi
mov ecx, eax
mov dl, byte [eax]
test dl, dl
je 0x40a853
nop dword [eax]
cmp dl, 0x2e
lea eax, [esi + 1]
mov dl, byte [ecx + 1]
cmovne eax, esi
inc ecx
mov esi, eax
test dl, dl
jne 0x40a840
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x14c], eax
test eax, eax
je 0x40a955
push dword [ebp - 0x138]
xorps xmm0, xmm0
mov eax, 2
movups xmmword [ebp - 0x134], xmm0
mov word [ebp - 0x134], ax
mov ax, word [ebp + 8]
rol ax, 8
mov word [ebp - 0x132], ax
cmp esi, 3
jne 0x40a8a5
call dword [sym.imp.WS2_32.dll_inet_addr]
jmp 0x40a8ba
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x40a949
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x130], eax
lea eax, [ebp - 0x134]
push 0x10
push eax
push dword [ebp - 0x14c]
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
js 0x40a949
mov edi, dword [ebp - 0x15c]
xor esi, esi
test edi, edi
je 0x40a918
mov ebx, dword [ebp - 0x154]
nop dword [eax + eax]
push 0
mov eax, edi
sub eax, esi
push eax
lea eax, [ebp - 0x120]
add eax, esi
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40a912
add esi, eax
cmp esi, edi
jne 0x40a8f0
mov ebx, dword [ebp - 0x148]
mov eax, dword [ebp - 0x140]
mov edx, dword [ebp - 0x138]
mov ecx, dword [ebp - 0x14c]
push 0
push eax
push ebx
push dword [ebp + 8]
call fcn.0040a640
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040e688
mov esp, ebp
pop ebp
ret 0x10
push dword [ebp - 0x14c]
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [ebx]
mov edx, dword [str.Content_Length]
lea eax, [ebp - 0x138]
push ecx
push eax
mov ecx, esi
mov dword [ebp - 0x138], 0
call fcn.0040a500
mov esi, dword [ebp - 0x138]
add esp, 8
test esi, esi
jne 0x40ae47
push ecx
mov ecx, dword [ebx]
lea eax, [ebp - 0x138]
push eax
mov edx, str.content_length
call fcn.0040a500
mov esi, dword [ebp - 0x138]
add esp, 8
test esi, esi
jne 0x40ae47
mov edx, dword [str.Transfer_Encoding]
lea eax, [ebp - 0x13c]
push ecx
mov ecx, dword [ebx]
push eax
mov dword [ebp - 0x13c], esi
call fcn.0040a500
mov eax, dword [ebp - 0x13c]
add esp, 8
mov edx, dword [str.chunked]
mov esi, 7
mov dword [ebp - 0x15c], eax
test eax, eax
je 0x40af59
nop dword [eax]
mov bl, byte [edx]
lea edx, [edx + 1]
mov cl, byte [eax]
cmp cl, bl
jne 0x40aa1f
inc eax
test cl, cl
je 0x40aa2d
sub esi, 1
jne 0x40a9f0
jmp 0x40aa2d
mov eax, 0x133
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040e688
mov esp, ebp
pop ebp
ret 0x10
movsx ecx, cl
movsx eax, bl
sub ecx, eax
jne 0x40ae33
xor ebx, ebx
xor esi, esi
mov dword [ebp - 0x138], ebx
mov dword [ebp - 0x150], ebx
mov dword [ebp - 0x14c], esi
test edi, edi
je 0x40ab7e
mov eax, dword [ebp - 0x148]
mov edx, 0x42c620
push esi
push ecx
mov ecx, dword [ebp - 0x144]
mov eax, dword [eax]
add ecx, 4
add ecx, eax
call fcn.004099e0
add esp, 8
mov dword [ebp - 0x13c], eax
cmp eax, 0xffffffff
je 0x40ab7e
lea ecx, [eax + 1]
push ecx
call fcn.00414236
mov ebx, dword [ebp - 0x13c]
mov esi, eax
mov eax, dword [ebp - 0x148]
add esp, 4
mov ecx, dword [eax]
mov eax, dword [ebp - 0x144]
add eax, 4
push ebx
add ecx, eax
push ecx
push esi
call fcn.00410130
add esp, 0xc
mov byte [ebx + esi], 0
xor eax, eax
test esi, esi
je 0x40ab07
cmp byte [esi], al
je 0x40ab07
nop dword [eax]
inc eax
cmp byte [eax + esi], 0
jne 0x40aac0
test eax, eax
je 0x40ab07
add eax, 3
push eax
call fcn.00414236
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40ab07
push esi
push str.0x_s
push ebx
call dword [ebp - 0x160]
add esp, 0xc
mov ecx, ebx
mov byte [eax + ebx], 0
call fcn.0040de70
push ebx
mov dword [ebp - 0x150], eax
call fcn.0041421b
add esp, 4
sub edi, dword [ebp - 0x13c]
mov eax, dword [ebp - 0x150]
inc eax
push eax
lea ebx, [edi - 2]
mov esi, ebx
mov dword [ebp - 0x138], ebx
mov dword [ebp - 0x14c], esi
call fcn.00414236
mov ecx, dword [ebp - 0x140]
add esp, 4
mov edx, dword [ebp - 0x144]
mov dword [ecx], eax
test eax, eax
je 0x40ab90
mov edi, dword [ebp - 0x148]
add edx, 6
push ebx
mov ecx, dword [edi]
add ecx, dword [ebp - 0x13c]
add ecx, edx
push ecx
push eax
call fcn.00410130
mov eax, dword [edi]
add esp, 0xc
mov edx, dword [ebp - 0x144]
mov ecx, dword [ebp - 0x140]
mov dword [ebp - 0x138], ebx
mov byte [edx + eax], 0
mov eax, dword [ecx]
mov byte [esi + eax], 0
jmp 0x40ab90
mov ecx, dword [ebp - 0x140]
mov edx, dword [ebp - 0x144]
nop word [eax + eax]
mov edi, dword [ebp - 0x150]
test edi, edi
je 0x40ac11
test edx, edx
jne 0x40abac
lea eax, [edi + 1]
push eax
call fcn.00414236
add esp, 4
jmp 0x40abbc
lea eax, [ebx + 1]
add eax, edi
push eax
push dword [ecx]
call fcn.00411ab3
add esp, 8
mov ecx, dword [ebp - 0x140]
mov dword [ecx], eax
push 0
mov eax, edi
sub eax, esi
push eax
mov eax, dword [ecx]
add eax, ebx
push eax
push dword [ebp - 0x154]
call dword [ebp - 0x158]
mov ecx, dword [ebp - 0x140]
cmp eax, 0xffffffff
je 0x40abf1
add esi, eax
add ebx, eax
mov eax, dword [ecx]
mov byte [ebx + eax], 0
cmp esi, edi
jb 0x40abc4
mov edx, dword [ebp - 0x144]
xor edi, edi
mov dword [ebp - 0x14c], esi
mov dword [ebp - 0x138], ebx
mov dword [ebp - 0x150], edi
jmp 0x40ab96
mov ebx, dword [ebp - 0x154]
lea eax, [ebp - 0x14c]
push eax
lea edx, [ebp - 0x148]
mov dword [ebp - 0x148], 0
mov ecx, ebx
call fcn.0040a460
add esp, 4
cmp dword [ebp - 0x14c], 2
jne 0x40acb1
mov edi, dword [ebp - 0x148]
mov esi, 2
mov eax, edi
mov edx, 0x42c620
test eax, eax
je 0x40acbf
mov bl, byte [edx]
lea edx, [edx + 1]
mov cl, byte [eax]
cmp cl, bl
jne 0x40ac6e
inc eax
test cl, cl
je 0x40ac78
sub esi, 1
jne 0x40ac57
jmp 0x40ac78
movsx eax, bl
movsx ecx, cl
sub ecx, eax
jne 0x40acb9
push edi
call fcn.0041421b
mov ebx, dword [ebp - 0x154]
lea eax, [ebp - 0x14c]
add esp, 4
mov dword [ebp - 0x148], 0
lea edx, [ebp - 0x148]
mov ecx, ebx
push eax
call fcn.0040a460
add esp, 4
cmp dword [ebp - 0x14c], 2
je 0x40ac41
mov edi, dword [ebp - 0x148]
jmp 0x40acbf
mov ebx, dword [ebp - 0x154]
cmp byte [edi], 0x30
je 0x40adb7
xor esi, esi
mov edx, 0x42c620
push esi
push ecx
mov ecx, edi
mov dword [ebp - 0x14c], esi
call fcn.004099e0
add esp, 8
mov dword [ebp - 0x13c], eax
cmp eax, 0xffffffff
je 0x40ada3
test eax, eax
je 0x40ada3
lea ecx, [eax + 1]
push ecx
call fcn.00414236
mov ebx, dword [ebp - 0x138]
mov edi, eax
mov ecx, dword [ebp - 0x140]
add esp, 4
mov edx, dword [ebp - 0x144]
test edi, edi
je 0x40ab90
push dword [ebp - 0x13c]
mov ebx, dword [ebp - 0x148]
push ebx
push edi
call fcn.00410130
mov eax, dword [ebp - 0x13c]
add esp, 0xc
mov byte [edi + eax], 0
xor eax, eax
cmp byte [edi], al
je 0x40ad9a
inc eax
cmp byte [eax + edi], 0
jne 0x40ad46
test eax, eax
je 0x40ad9a
add eax, 3
push eax
call fcn.00414236
add esp, 4
mov dword [ebp - 0x13c], eax
test eax, eax
je 0x40ad9a
push edi
push str.0x_s
push eax
call dword [ebp - 0x160]
mov ecx, dword [ebp - 0x13c]
add esp, 0xc
mov byte [eax + ecx], 0
call fcn.0040de70
push dword [ebp - 0x13c]
mov dword [ebp - 0x150], eax
call fcn.0041421b
add esp, 4
push ebx
call fcn.0041421b
add esp, 4
push edi
call fcn.0041421b
mov ebx, dword [ebp - 0x138]
add esp, 4
jmp 0x40ab7e
mov eax, dword [ebp - 0x15c]
test eax, eax
je 0x40adca
push eax
call fcn.0041421b
add esp, 4
push edi
call fcn.0041421b
add esp, 4
mov dword [ebp - 0x158], 0
lea eax, [ebp - 0x14c]
mov ecx, ebx
lea edx, [ebp - 0x158]
push eax
call fcn.0040a460
mov eax, dword [ebp - 0x158]
add esp, 4
test eax, eax
je 0x40ae07
push eax
call fcn.0041421b
add esp, 4
mov ecx, dword [ebp - 0x164]
test ecx, ecx
je 0x40af21
mov eax, dword [ebp - 0x138]
mov dword [ecx], eax
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040e688
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp - 0x15c]
push eax
call fcn.0041421b
add esp, 4
jmp 0x40af59
mov ecx, esi
call fcn.0040de70
mov ebx, eax
mov eax, dword [ebp - 0x164]
test eax, eax
je 0x40ae5c
mov dword [eax], ebx
lea ecx, [ebx + 1]
push ecx
call fcn.00414236
mov ecx, eax
add esp, 4
mov eax, dword [ebp - 0x140]
mov dword [eax], ecx
test ecx, ecx
jne 0x40ae94
test esi, esi
je 0x40af59
push esi
call fcn.0041421b
mov eax, dword [ebp - 0x140]
add esp, 4
mov eax, dword [eax]
jmp 0x40af4c
mov eax, dword [ebp - 0x148]
cmp edi, ebx
mov edx, dword [ebp - 0x144]
mov esi, ebx
cmovne esi, edi
add edx, 4
push esi
mov eax, dword [eax]
add eax, edx
push eax
push ecx
call fcn.00410130
mov eax, dword [ebp - 0x140]
add esp, 0xc
mov eax, dword [eax]
mov byte [esi + eax], 0
cmp edi, ebx
je 0x40aefc
mov esi, dword [ebp - 0x140]
nop
push 0
mov eax, ebx
sub eax, edi
push eax
mov eax, dword [esi]
add eax, edi
push eax
push dword [ebp - 0x154]
call dword [ebp - 0x158]
test eax, eax
jle 0x40aef6
add edi, eax
mov eax, dword [esi]
mov byte [edi + eax], 0
jmp 0x40aef8
js 0x40af37
cmp edi, ebx
jne 0x40aed0
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp - 0x144]
mov eax, dword [eax]
mov byte [ecx + eax], 0
mov eax, dword [ebp - 0x138]
test eax, eax
je 0x40af21
push eax
call fcn.0041421b
add esp, 4
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040e688
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp - 0x138]
test eax, eax
je 0x40af4a
push eax
call fcn.0041421b
add esp, 4
mov eax, dword [esi]
test eax, eax
je 0x40af59
push eax
call fcn.0041421b
add esp, 4
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040e688
mov esp, ebp
pop ebp
ret 0x10