Function at 0x401c8e
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 0x401cc5
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], 0x40d198
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 0x401d57
mov eax, dword [ebp + 0x20]
mov edx, dword [ebp - 0x14]
mov dword [eax], edx
mov eax, 0xffffffff
jmp 0x40207c
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 0x402014
cmp dword [ebp + 0x1c], 0
je 0x401d9c
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 0x401dae
mov dword [ebp - 0x14], 0
jmp 0x40201e
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 0x401df6
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 0x40201e
mov eax, dword [sym.imp.WS2_32.dll_WSACreateEvent]
call eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x401e1e
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 0x40201e
cmp dword [ebp + 8], 1
jne 0x401f0f
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 0x401f03
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 0x401eeb
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 0x401edf
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 0x40201e
mov dword [ebp - 0x14], 0
jmp 0x40201e
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 0x40201e
mov dword [ebp - 0x14], 0xfffffffc
jmp 0x401fdf
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 0x401f4a
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 0x40201e
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 0x401fb5
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 0x401fac
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 0x40201e
mov dword [ebp - 0x14], 0
jmp 0x40201e
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
cmp eax, 0x2733
jne 0x401fcc
mov dword [ebp - 0x14], 1
jmp 0x40201e
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 0x401d77
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 0x40204d
cmp dword [ebp + 8], 0
je 0x40204d
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 0x402079
cmp dword [ebp - 0xc], 0xffffffff
je 0x402079
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 0x402079
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