Function at 0x40ec20
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
sub esp, 0x99c
mov eax, dword [esp + 0x9a0]
push ebx
mov ebx, dword [eax]
push ebp
push esi
push edi
mov byte [esp + 0xa8], 0
xor eax, eax
mov ecx, 0x3f
lea edi, [esp + 0xa9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor ebp, ebp
stosb byte es:[edi], al
mov esi, dword [ebx + 0x348]
mov dword [esp + 0x20], ebp
mov eax, dword [ebx + 0x348]
cmp eax, ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], ebp
je 0x40edc4
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40ec77
sub eax, edx
cmp eax, 1
jbe 0x40edc4
mov eax, esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40ec90
sub eax, edx
cmp eax, 0x16
jae 0x40eca5
mov eax, 0x16
jmp 0x40ecb9
mov eax, esi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40ecb0
sub eax, edx
inc eax
push 1
push eax
call dword [0x43b048]
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x40ecdc
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x99c
ret
cmp byte [esi], 0x3a
jne 0x40ed87
mov edi, esi
test edi, edi
je 0x40ed4e
push 0x3a
push edi
call fcn.0041fd60
mov esi, eax
add esp, 8
test esi, esi
je 0x40ed4e
push 0xa
lea edx, [esi + 1]
push 0
push edx
call fcn.004202db
push eax
call fcn.00417880
push 0x2d
push esi
mov edi, eax
mov dword [esp + 0x34], edi
call fcn.0041fd60
xor esi, esi
add esp, 0x18
cmp eax, esi
je 0x40edbe
push 0xa
inc eax
push esi
push eax
call fcn.004202db
push eax
call fcn.00417880
add esp, 0x10
cmp di, ax
mov dword [esp + 0x18], eax
jbe 0x40ed4e
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
cmp byte [ebp], 0
je 0x40edc4
mov esi, dword [esp + 0x9b0]
mov ecx, dword [esi + 0x34]
mov edx, dword [ecx + 4]
push 0x401
lea eax, [esp + 0x1ac]
push eax
push ebp
push edx
call fcn.00419460
add esp, 0x10
test eax, eax
jne 0x40ee53
mov eax, ebp
jmp 0x40ee5a
push 0x3a
push esi
call fcn.0041fd60
mov edi, eax
add esp, 8
test edi, edi
je 0x40edac
mov ecx, edi
sub ecx, esi
push ecx
push esi
push ebp
call fcn.0041f0f0
add esp, 0xc
jmp 0x40ece7
mov edx, ebp
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40edb2
jmp 0x40ed4e
mov dword [esp + 0x18], edi
jmp 0x40ed4e
mov esi, dword [esp + 0x9b0]
mov edx, dword [esi + 0x128]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x2c]
push ecx
push edx
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x40ee2c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.00418c70
push eax
push str.getsockname___failed:__s
push ebx
call fcn.00403490
add esp, 0x14
test ebp, ebp
je 0x40f10d
push ebp
call dword [0x43b03c]
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
movzx edx, word [esp + 0x28]
push 0x401
lea eax, [esp + 0x1ac]
push eax
lea ecx, [esp + 0x34]
push ecx
push edx
call fcn.004046c0
mov esi, dword [esp + 0x9c0]
add esp, 0x10
lea eax, [esp + 0x1a8]
lea ecx, [esp + 0x20]
push ecx
push 0
push eax
push esi
call fcn.00402260
add esp, 0x10
cmp eax, 1
jne 0x40ee7e
lea edx, [esp + 0x20]
push edx
push esi
call fcn.00406a20
add esp, 8
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40ee94
mov esi, dword [eax]
push eax
push ebx
call fcn.00402430
add esp, 8
jmp 0x40ee96
xor esi, esi
test ebp, ebp
je 0x40eea4
push ebp
call dword [0x43b03c]
add esp, 4
test esi, esi
jne 0x40eec6
push str.Curl_resolv_failed__we_can_not_recover_
push ebx
call fcn.00403490
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, esi
mov esi, dword [sym.imp.WS2_32.dll_socket]
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40eee8
mov eax, dword [esp + 0x9b0]
mov ecx, dword [eax + 0x6c]
mov dword [ebp + 8], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 4]
push edx
push eax
push ecx
call esi
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x40ef35
call edi
mov ebp, dword [ebp + 0x1c]
test ebp, ebp
jne 0x40eed4
mov edx, dword [esp + 0x9b0]
push eax
push edx
call fcn.00418c70
push eax
push str.socket_failure:__s
push ebx
call fcn.00403490
add esp, 0x14
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebp + 0x18]
mov eax, ecx
shr ecx, 2
lea edi, [esp + 0x28]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x1c]
cmp si, word [esp + 0x18]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x14], ecx
ja 0x40f07e
mov edi, dword [esp + 0x9b0]
lea ebx, [ebx]
cmp word [esp + 0x28], 2
jne 0x40ef84
push esi
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2a], ax
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push edx
lea eax, [esp + 0x2c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x40f077
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2741
jne 0x40eff1
push eax
push edi
call fcn.00418c70
push eax
movzx edx, si
push edx
push str.bind_port_hu__failed:__s
push ebx
call fcn.00403490
mov edx, dword [edi + 0x128]
add esp, 0x18
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x2c]
push ecx
push edx
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40f00b
mov esi, dword [esp + 0x1c]
jmp 0x40effe
cmp eax, 0x2740
je 0x40effd
cmp eax, 0xd
jne 0x40f042
inc esi
cmp si, word [esp + 0x18]
jbe 0x40ef70
jmp 0x40f07e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.00418c70
push eax
push str.getsockname___failed:__s
push ebx
call fcn.00403490
mov eax, dword [esp + 0x24]
add esp, 0x14
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
push eax
push edi
call fcn.00418c70
push eax
movzx ecx, si
push ecx
push str.bind_port_hu__failed:__s
push ebx
call fcn.00403490
mov edx, dword [esp + 0x28]
add esp, 0x18
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
cmp si, word [esp + 0x18]
jbe 0x40f0a7
push str.bind___failed__we_ran_out_of_ports_
push ebx
call fcn.00403490
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x2c]
push edx
push esi
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x40f0dd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.00418c70
push eax
push str.getsockname___failed:__s
jmp 0x40f0fd
push 1
push esi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x40f11d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.00418c70
push eax
push str.socket_failure:__s
push ebx
call fcn.00403490
add esp, 0x14
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0x1e
pop ebx
add esp, 0x99c
ret
push pe_nt_image_headers32
lea eax, [esp + 0xac]
push eax
push ebp
call fcn.004020e0
mov ebp, dword [esp + 0x9c0]
add esp, 0xc
cmp ebp, 2
je 0x40f294
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esp + 0x28]
mov edi, edi
mov eax, dword [edi + 0x1d4]
test eax, eax
jne 0x40f15e
test ebp, ebp
je 0x40f18a
cmp ebp, 1
jne 0x40f169
cmp cx, 2
jne 0x40f18a
movzx eax, cx
sub eax, 2
jne 0x40f18a
mov ecx, dword [esp + 0x2a]
push ecx
call esi
test ebp, ebp
je 0x40f1d7
cmp ebp, 1
je 0x40f21a
mov cx, word [esp + 0x28]
inc ebp
cmp ebp, 2
jne 0x40f150
mov ebx, dword [esp + 0x24]
mov esi, dword [esp + 0x10]
mov dword [edi + 0x42c], ebp
mov eax, dword [edi + 0x12c]
cmp eax, 0xffffffff
je 0x40f1b0
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi + 0x12c], esi
mov dword [edi + 0x1b4], 1
mov dword [edi + 0x438], 0x1c
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x99c
ret
xor ecx, ecx
cmp word [esp + 0x28], 2
movzx edx, ax
setne cl
push edx
lea eax, [esp + 0xac]
push eax
lea eax, [edi + 0x3c8]
inc ecx
push ecx
push str.EPRT
push str._s__d_s_hu
push eax
call fcn.00419870
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x40f194
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x99c
ret
lea ecx, [esp + 0x5ac]
lea esi, [esp + 0xa8]
mov dl, byte [esi]
test dl, dl
je 0x40f23e
cmp dl, 0x2e
jne 0x40f238
mov byte [ecx], 0x2c
jmp 0x40f23a
mov byte [ecx], dl
inc ecx
inc esi
jne 0x40f228
movzx eax, ax
mov edx, eax
and edx, 0xff
push edx
shr eax, 8
push eax
push str.__d__d
push 0x14
push ecx
mov byte [ecx], 0
call fcn.00404e30
lea eax, [esp + 0x5c0]
push eax
push str.PORT
lea eax, [edi + 0x3c8]
push str._s__s
push eax
call fcn.00419870
mov ebx, eax
add esp, 0x24
test ebx, ebx
je 0x40f194
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x99c
ret
mov ebx, dword [esp + 0x24]
jmp 0x40f198