Function at 0x401d52
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [ebp + 0x14]
mov word [ebp - 0x4c], ax
mov eax, dword [ebp + 0x20]
mov dword [eax], 0
cmp dword [ebp + 0x1c], 0
je 0x401d89
mov dword [esp + 8], 0x1c
mov dword [esp + 4], 0
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call sym._memset
mov dword [esp + 8], 0x20
mov dword [esp + 4], 0
lea eax, [ebp - 0x3c]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x38], eax
mov dword [hints.ai_flags], 1
movzx eax, word [ebp - 0x4c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x40d178
mov dword [esp + 4], 7
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sym._snprintf
mov dword [ebp - 0x40], 0
lea eax, [ebp - 0x40]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x3c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x48]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_getaddrinfo]
call eax
sub esp, 0x10
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x401e1b
mov eax, dword [ebp + 0x20]
mov edx, dword [ebp - 0x14]
mov dword [eax], edx
mov eax, 0xffffffff
jmp 0x402140
mov dword [ebp - 0x14], 0xfffffffe
mov dword [ebp - 0xc], 0xffffffff
mov dword [ebp - 0x10], 0
mov eax, dword [ebp - 0x40]
mov dword [hints.ai_next], eax
jmp 0x4020d8
cmp dword [ebp + 0x1c], 0
je 0x401e60
mov eax, dword [hints.ai_next]
mov edx, dword [eax + 0x10]
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call sym._memcpy
cmp dword [ebp + 8], 0
jne 0x401e72
mov dword [ebp - 0x14], 0
jmp 0x4020e2
mov eax, dword [hints.ai_next]
mov ecx, dword [eax + 0xc]
mov eax, dword [hints.ai_next]
mov edx, dword [eax + 8]
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_socket]
call eax
sub esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x401eba
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffd
jmp 0x4020e2
mov eax, dword [sym.imp.WS2_32.dll_WSACreateEvent]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x401ee2
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffd
jmp 0x4020e2
cmp dword [ebp + 8], 1
jne 0x401fd3
mov dword [hints.ai_addr], 1
mov dword [esp + 0x10], 4
lea eax, [hints.ai_addr]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov dword [esp + 4], 0xffff
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_setsockopt]
call eax
sub esp, 0x14
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x10]
mov edx, eax
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_bind]
call eax
sub esp, 0xc
test eax, eax
jne 0x401fc7
mov dword [esp + 4], 5
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_listen]
call eax
sub esp, 8
test eax, eax
jne 0x401faf
mov dword [esp + 8], 8
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_WSAEventSelect]
call eax
sub esp, 0xc
test eax, eax
je 0x401fa3
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffd
jmp 0x4020e2
mov dword [ebp - 0x14], 0
jmp 0x4020e2
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffb
jmp 0x4020e2
mov dword [ebp - 0x14], 0xfffffffc
jmp 0x4020a3
mov dword [esp + 8], 0x30
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_WSAEventSelect]
call eax
sub esp, 0xc
test eax, eax
je 0x40200e
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffd
jmp 0x4020e2
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x10]
mov edx, eax
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_connect]
call eax
sub esp, 0xc
test eax, eax
jne 0x402079
mov dword [esp + 8], 0x21
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_WSAEventSelect]
call eax
sub esp, 0xc
test eax, eax
je 0x402070
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffd
jmp 0x4020e2
mov dword [ebp - 0x14], 0
jmp 0x4020e2
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
cmp eax, 0x2733
jne 0x402090
mov dword [ebp - 0x14], 1
jmp 0x4020e2
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov dword [ebp - 0x14], 0xfffffffa
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_WSACloseEvent]
call eax
sub esp, 4
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
mov edx, dword [ebp + 0x20]
mov dword [edx], eax
mov eax, dword [hints.ai_next]
mov eax, dword [eax + 0x1c]
mov dword [hints.ai_next], eax
cmp dword [hints.ai_next], 0
jne 0x401e3b
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_freeaddrinfo]
call eax
sub esp, 4
cmp dword [ebp - 0x14], 0
js 0x402111
cmp dword [ebp + 8], 0
je 0x402111
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp - 0xc]
mov dword [eax], edx
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp - 0x10]
mov dword [eax + 4], edx
jmp 0x40213d
cmp dword [ebp - 0xc], 0xffffffff
je 0x40213d
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
cmp dword [ebp - 0x10], 0
je 0x40213d
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_WSACloseEvent]
call eax
sub esp, 4
mov eax, dword [ebp - 0x14]
leave
ret