Function at 0x4057db
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x434
cmp dword [ebp + 8], 0
push ebx
push esi
push edi
mov ebx, ecx
je 0x405993
cmp byte [ebx + 0x435], 0
jne 0x405993
xor ecx, ecx
mov word [ebx + 0x228], cx
mov ecx, ebx
call fcn.00403828
mov esi, dword [ebx + 0x438]
mov edi, dword [ebx + 0x43c]
call dword [sym.imp.KERNEL32.DLL_GetTickCount64]
add eax, esi
mov dword [ebx + 0x440], eax
adc edx, edi
cmp byte [ebp + 0x18], 0
mov dword [ebx + 0x444], edx
je 0x40593e
lea eax, [esp + 0x28]
push eax
call fcn.0044331a
test al, al
je 0x405935
cmp dword [esp + 0x32c], 0
ja 0x405869
cmp dword [esp + 0x330], 2
jae 0x405935
mov eax, dword [esp + 0x28]
cmp eax, 3
jne 0x40589f
push dword [ebp + 0x10]
lea eax, [esp + 0x2c]
mov ecx, ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
call fcn.00404fe8
test al, al
je 0x40589b
push 0
push 1
call fcn.004432ee
mov al, 1
jmp 0x405995
mov eax, dword [esp + 0x28]
xor esi, esi
inc esi
cmp eax, esi
jne 0x4058c3
push dword [ebp + 0x10]
lea eax, [esp + 0x2c]
mov ecx, ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
call fcn.0040520e
test al, al
jne 0x40588b
mov eax, dword [esp + 0x28]
cmp eax, 2
jne 0x4058e1
push dword [ebp + 0x10]
lea eax, [esp + 0x2c]
mov ecx, ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
call fcn.004053a8
test al, al
jne 0x40588b
push esi
push 0
call fcn.004432ee
lea eax, [ebx + 0x228]
push eax
lea eax, [esp + 0x30]
push eax
push str._s_proxy_connect_failed___s___reconnect_directly
push str.Socket
push 0x4b3270
call fcn.00442ff3
add esp, 0x14
mov ecx, ebx
call fcn.00403828
mov esi, dword [ebx + 0x438]
mov edi, dword [ebx + 0x43c]
call dword [sym.imp.KERNEL32.DLL_GetTickCount64]
add eax, esi
mov dword [ebx + 0x440], eax
adc edx, edi
mov dword [ebx + 0x444], edx
cmp byte [ebx + 0x435], 0
jne 0x405993
push dword [ebp + 8]
xor eax, eax
lea esi, [ebx + 0x28]
lea edi, [ebx + 0x228]
mov edx, 0xff
mov ecx, esi
mov word [edi], ax
call fcn.00403b43
push 0x100
push esi
call fcn.0042a3af
pop ecx
pop ecx
push 2
lea eax, [ebx + 0xc]
push eax
lea eax, [ebx + 0x434]
push eax
push dword [ebp + 0xc]
push esi
call fcn.0044312f
test al, al
jne 0x40599e
push str.address_resolve_failed
mov edx, 0xff
mov ecx, edi
call fcn.00403b43
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
movzx eax, word [ebx + 0xc]
push 1
push 0
push 0
push 6
push 1
push eax
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov dword [ebx + 8], eax
cmp eax, 0xffffffff
jne 0x4059c2
push str.socket_create_failed
jmp 0x405987
cmp dword [ebp + 0x14], 0
je 0x4059d8
xor eax, eax
lea edi, [esp + 0x18]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea edi, [ebx + 0x228]
mov eax, dword [ebx]
xor esi, esi
inc esi
mov ecx, ebx
push esi
call dword [eax + 0x18]
lea eax, [esp + 0xc]
mov dword [esp + 0xc], esi
push eax
push 0x8004667e
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor eax, eax
lea ecx, [ebx + 0xc]
cmp word [ecx], 0x17
push eax
push eax
push eax
push eax
push 0x10
pop eax
push 0x1c
pop edx
cmove eax, edx
push eax
push ecx
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_WSAConnect]
cmp eax, 0xffffffff
jne 0x405ab0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x405a78
mov ecx, dword [ebx + 8]
xor edx, edx
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x33c], ecx
mov ecx, 0x3e8
div ecx
xor ecx, ecx
mov dword [esp + 0x338], esi
mov dword [esp + 0x10], eax
imul eax, edx, 0x3e8
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10]
push eax
push ecx
lea eax, [esp + 0x340]
push eax
push ecx
push ecx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x405ab0
mov ecx, ebx
call fcn.00403828
push str.connect_failed
mov edx, 0xff
mov ecx, edi
call fcn.00403b43
lea eax, [ebx + 0x28]
push eax
push str._s_direct_connect_failed
push str.Socket
push 0x4b3270
call fcn.00442ff3
add esp, 0x10
jmp 0x405993
and dword [esp + 0xc], 0
lea eax, [esp + 0xc]
push eax
push 0x8004667e
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, dword [ebx + 0x438]
mov edi, dword [ebx + 0x43c]
call dword [sym.imp.KERNEL32.DLL_GetTickCount64]
add eax, esi
mov dword [ebx + 0x440], eax
lea eax, [ebx + 0x28]
push eax
adc edx, edi
push 0
mov dword [ebx + 0x444], edx
mov eax, dword [ebx + 8]
push eax
push str._I64u__s_connected
push str.Socket
push 0x4b3270
call fcn.00442ff3
add esp, 0x18
jmp 0x405894