Function at 0x40e4e0
Capabilities:
Get common file path
Link many functions at runtime

Disassembly:
sub esp, 0x258
push ebx
mov ebx, dword [esp + 0x260]
push ebx
call dword [sym.imp.WS2_32.dll_inet_addr]
push eax
call dword [sym.imp.WS2_32.dll_htonl]
cmp eax, 0xffffffff
jne 0x40e922
push esi
push edi
mov ecx, 8
xor eax, eax
lea edi, [esp + 0x30]
mov dword [esp + 0xc], 0
rep stosd dword es:[edi], eax
mov eax, 1
mov dword [esp + 0x34], 2
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], eax
mov eax, dword [0x416fbc]
mov dword [esp + 0x3c], 0
test eax, eax
jne 0x40e6f3
mov eax, dword [0x416fb8]
mov dword [esp + 0x14], str.getaddrinfo
test eax, eax
mov dword [esp + 0x18], 0x40ee10
mov dword [esp + 0x1c], str.getnameinfo
mov dword [esp + 0x20], 0x40f550
mov dword [esp + 0x24], str.freeaddrinfo
mov dword [esp + 0x28], 0x40edc0
jne 0x40e6e9
lea eax, [esp + 0x15c]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40e6df
lea edi, [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x50]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x50]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.ws2_32
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x50]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x40e620
push str.getaddrinfo
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x40e6a0
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea edi, [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x50]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x50]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.wship6
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x50]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x40e6df
push str.getaddrinfo
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x40e6a0
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40e6df
xor ebx, ebx
lea edi, [esp + 0x18]
mov ecx, dword [edi - 4]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [edi], eax
je 0x40e740
inc ebx
add edi, 8
cmp ebx, 3
jl 0x40e6a6
xor eax, eax
mov edx, dword [esp + eax + 0x18]
mov dword [eax + 0x416544], edx
add eax, 8
cmp eax, 0x18
jl 0x40e6c6
mov ebx, dword [esp + 0x268]
mov dword [0x416fb8], 1
mov eax, dword [0x416544]
mov dword [0x416fbc], eax
lea ecx, [esp + 0xc]
lea edx, [esp + 0x30]
push ecx
push edx
push 0
push ebx
call eax
mov esi, eax
push esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
test esi, esi
jne 0x40e749
mov eax, dword [esp + 0xc]
mov esi, dword [eax + 0x18]
mov ecx, dword [esi + 4]
push ecx
call dword [sym.imp.WS2_32.dll_ntohl]
mov edx, dword [esi + 4]
mov dword [esp + 0x10], eax
push edx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
push ebx
push str.Resolv__s_t__s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
jmp 0x40e760
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40e6d8
push ebx
push str.Cant_Resolv__s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0xc]
mov dword [esp + 0x2c], eax
mov eax, dword [0x416fb4]
test eax, eax
jne 0x40e915
mov eax, dword [0x416fb8]
mov dword [esp + 0x14], str.getaddrinfo
test eax, eax
mov dword [esp + 0x18], 0x40ee10
mov dword [esp + 0x1c], str.getnameinfo
mov dword [esp + 0x20], 0x40f550
mov dword [esp + 0x24], str.freeaddrinfo
mov dword [esp + 0x28], 0x40edc0
jne 0x40e90b
lea ecx, [esp + 0x15c]
push 0x104
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40e901
lea edi, [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x50]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x50]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.ws2_32
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
and ecx, 3
lea eax, [esp + 0x50]
rep movsb byte es:[edi], byte [esi]
push eax
call ebx
mov esi, eax
test esi, esi
je 0x40e851
push str.getaddrinfo
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x40e8cd
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea edi, [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x50]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x50]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.wship6
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x50]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebx
mov esi, eax
test esi, esi
je 0x40e901
push str.getaddrinfo
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x40e8cd
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x40e901
xor ebx, ebx
lea edi, [esp + 0x18]
mov ecx, dword [edi - 4]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [edi], eax
je 0x40e8c4
inc ebx
add edi, 8
cmp ebx, 3
jl 0x40e8d3
xor eax, eax
mov edx, dword [esp + eax + 0x18]
mov dword [eax + 0x416544], edx
add eax, 8
cmp eax, 0x18
jl 0x40e8ef
mov dword [0x416fb8], 1
mov eax, dword [0x416554]
mov dword [0x416fb4], eax
mov ecx, dword [esp + 0x2c]
push ecx
call eax
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
add esp, 0x258
ret