Function at 0x40b530
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Send data
Send data on socket
Send http request

Disassembly:
sub esp, 0x58
mov eax, dword [0x6a7c78]
xor eax, esp
mov dword [esp + 0x54], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x68]
movsx eax, byte [esi + 0x12d]
mov ebx, dword [esi + 0xc8]
shl eax, 6
cmp dword [ebx + 0x310], 0
push edi
lea edi, [eax + ebx + 0x1c]
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], 0
je 0x40b5e7
mov ecx, dword [esi]
movzx edx, word [ecx + 0xc7a]
push edx
push 0x50
push esi
call fcn.00407290
add esp, 8
push eax
mov eax, dword [edi + 0x30]
mov edi, dword [sym.imp.MSVCR90.dll_sprintf]
push str.CONNECT__s:_u_HTTP_1.0_r_nUser_agent:_libwebsockets_r_n
push eax
call edi
mov ebp, eax
lea eax, [ebx + 0x1f8]
add esp, 0x10
cmp byte [eax], 0
je 0x40b5bd
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx + 0x30]
push eax
add edx, ebp
push str.Proxy_authorization:_basic__s_r_n
push edx
call edi
add esp, 0xc
add ebp, eax
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x30]
add ecx, ebp
push 0x5db758
push ecx
call edi
movzx edx, word [ebx + 0x310]
add esp, 8
add ebp, eax
mov dword [esp + 0x14], ebp
lea ebp, [ebx + 0x178]
push edx
jmp 0x40b5fe
push 0x50
push esi
call fcn.00407290
mov ebp, eax
mov eax, dword [esi]
movzx ecx, word [eax + 0xc7a]
add esp, 8
push ecx
call dword [sym.imp.WS2_32.dll_htons]
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x28]
mov word [esp + 0x4a], ax
xor eax, eax
push ecx
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
push ebp
xor edi, edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], 1
mov dword [esp + 0x34], 2
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x40b724
mov edx, dword [esp + 0x18]
mov eax, edx
test eax, eax
je 0x40b6cf
mov ecx, dword [eax + 4]
sub ecx, 2
jne 0x40b673
mov edi, dword [eax + 0x18]
add edi, 4
mov eax, dword [eax + 0x1c]
test edi, edi
je 0x40b661
mov eax, 2
mov word [esp + 0x44], ax
mov ecx, dword [edi]
xor eax, eax
push edx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
cmp dword [esi + 0x104], 0
jne 0x40b828
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 0x104], eax
test eax, eax
jne 0x40b6dc
push str.Unable_to_open_socket_n
push 2
call fcn.00403280
add esp, 8
jmp 0x40b724
test edi, edi
jne 0x40b67a
push edx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x40b724
push eax
push ebx
call fcn.00405510
add esp, 8
test eax, eax
je 0x40b702
push str.Failed_to_set_wsi_socket_options_n
push 1
call fcn.00403280
mov edx, dword [esi + 0x104]
add esp, 8
push edx
jmp 0x40b71e
push esi
push ebx
mov byte [esi + 0x126], 8
call fcn.00403cb0
add esp, 8
test eax, eax
je 0x40b758
mov eax, dword [esi + 0x104]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esi]
mov ecx, dword [eax + 0xc58]
push esi
mov dword [eax + 0xc54], ecx
call fcn.00407040
push 0
push esi
call fcn.00405ae0
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.004adf6a
add esp, 0x58
ret
push 0x14
push 2
push esi
call fcn.00402f60
xor eax, eax
mov dword [esp + 0x60], eax
mov edx, 2
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov word [esp + 0x60], dx
mov eax, dword [ebx + 0x15c]
add esp, 0xc
test eax, eax
je 0x40b828
push 0x10
lea ecx, [esp + 0x58]
push ecx
push eax
push ebx
call fcn.00403080
add esp, 0x10
test eax, eax
jge 0x40b7da
mov edx, dword [ebx + 0x15c]
push edx
push str.Unable_to_find_interface__s_n
push 1
call fcn.00403280
add esp, 0xc
push 0
push esi
call fcn.00403570
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.004adf6a
add esp, 0x58
ret
mov ecx, dword [esi + 0x104]
push 0x10
lea eax, [esp + 0x58]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jge 0x40b828
mov edx, dword [ebx + 0x15c]
push edx
push str.Error_binding_to_interface__s
push 1
call fcn.00403280
add esp, 0xc
push 0
push esi
call fcn.00403570
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.004adf6a
add esp, 0x58
ret
mov ecx, dword [esi + 0x104]
push 0x10
lea eax, [esp + 0x48]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0xffffffff
je 0x40b850
call edi
cmp eax, 0x2748
jne 0x40b891
call edi
cmp eax, 0x2735
je 0x40b963
call edi
cmp eax, 0x2734
je 0x40b963
call edi
cmp eax, 0x2733
je 0x40b963
call edi
cmp eax, 0x2726
je 0x40b963
call edi
cmp eax, 0x2748
jne 0x40b974
cmp dword [ebx + 0x310], 0
je 0x40b911
lea edx, [ebx + 0x178]
push edx
push 0x50
push esi
call fcn.00407320
add esp, 0xc
test eax, eax
jne 0x40b974
mov eax, dword [esi]
mov cx, word [ebx + 0x310]
mov edx, dword [esp + 0x14]
mov word [eax + 0xc7a], cx
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x30]
push 0
push edx
mov edx, dword [esi + 0x104]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jl 0x40b974
push 0x14
push 1
push esi
call fcn.00402f60
add esp, 0xc
mov byte [esi + 0x126], 9
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.004adf6a
add esp, 0x58
ret
push 0x14
push 8
push esi
call fcn.00402f60
mov eax, dword [esi + 0x104]
lea edx, [esp + 0x28]
push edx
mov ecx, 9
push ebx
mov byte [esi + 0x126], 0xa
mov dword [esp + 0x30], eax
mov word [esp + 0x36], cx
call fcn.00405070
add esp, 0x14
test eax, eax
jl 0x40b974
neg eax
sbb eax, eax
pop edi
not eax
and eax, esi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x54]
xor ecx, esp
call fcn.004adf6a
add esp, 0x58
ret
push 2
push 0
push esi
call fcn.00403f50
add esp, 0xc
test eax, eax
je 0x40b8fc
push 0
push esi
call fcn.00403570
mov ecx, dword [esp + 0x6c]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.004adf6a
add esp, 0x58
ret