Function at 0x413990
Capabilities:
Connect socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x5515a8
push eax
mov dword fs:[0], esp
sub esp, 0x14c
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
test edi, edi
jne 0x4139cd
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
cmp dword [esi + 0x908], 0
je 0x4139db
call fcn.004135e0
xor eax, eax
push ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov eax, 1
push edi
lea ecx, [ebp + 8]
mov dword [esi + 0x804], ebx
mov dword [ebp - 0x50], 2
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x24], 0
call fcn.00404560
mov edx, dword [ebp + 8]
mov ecx, dword [edx - 0xc]
mov dword [ebp - 4], 0
test ecx, ecx
jns 0x413a39
push 0x80070057
call fcn.004035e0
mov eax, dword [edx - 8]
mov edi, 1
sub edi, dword [edx - 4]
sub eax, ecx
or eax, edi
jge 0x413a56
push ecx
lea ecx, [ebp + 8]
call fcn.00403d90
mov edx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp - 0x54]
push ecx
push 0
push edx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x413ab1
push str.getaddrinfo__
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov ecx, esi
call fcn.004134d0
push 0
push 0x564af4
push 0x564ac4
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x413c27
mov ecx, dword [ebp - 0x24]
xor eax, eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov eax, dword [ecx + 0x18]
mov edx, dword [eax]
mov dword [ebp - 0x20], edx
mov edx, dword [eax + 4]
mov dword [ebp - 0x1c], edx
mov edx, dword [eax + 8]
mov dword [ebp - 0x18], edx
mov eax, dword [eax + 0xc]
push ecx
mov dword [ebp - 0x14], eax
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov ecx, 2
push ebx
mov word [ebp - 0x20], cx
call dword [sym.imp.WS2_32.dll_htons]
movzx edx, byte [ebp - 0x19]
movzx ecx, byte [ebp - 0x1b]
push edx
movzx edx, byte [ebp - 0x1c]
mov word [ebp - 0x1e], ax
movzx eax, byte [ebp - 0x1a]
push eax
push ecx
push edx
lea eax, [esi + 0x808]
push str._d._d._d._d
push eax
call fcn.0052eafa
mov edx, dword [esi + 0x90c]
add esp, 0x18
lea ecx, [ebp - 0x10]
push ecx
push 0x8004667e
mov edi, 1
push edx
mov dword [ebp - 0x2c], 4
mov dword [ebp - 0x10], edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [esi + 0x90c]
push 0x10
lea eax, [ebp - 0x20]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x28], eax
cmp eax, 0xffffffff
jne 0x413bd5
mov ebx, dword [sym.imp.WS2_32.dll_select]
mov eax, dword [esi + 0x90c]
lea edx, [ebp - 0x34]
push edx
push 0
lea ecx, [ebp - 0x158]
push ecx
push 0
push eax
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0x64
mov dword [ebp - 0x154], eax
mov dword [ebp - 0x158], edi
call ebx
test eax, eax
jle 0x413c48
mov eax, dword [esi + 0x90c]
lea edx, [ebp - 0x158]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x413b65
mov eax, dword [esi + 0x90c]
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x28]
push edx
push 0x1007
push 0xffff
push eax
call dword [sym.imp.WS2_32.dll_getsockopt]
mov edx, dword [esi + 0x90c]
lea ecx, [ebp - 0x10]
push ecx
push 0x8004667e
xor ebx, ebx
push edx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [ebp - 0x28], ebx
je 0x413c53
push ebx
push 0x564ab0
push 0x564aa4
push ebx
mov dword [esi + 0x908], ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x413c33
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
cmp eax, 0xffffffff
jne 0x413b65
jmp 0x413c0d
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [esi + 0x908], edi
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x413c7f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
pop ebx
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8