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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9b4
mov eax, dword [0x1009d350]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
or dword [ebp - 0x990], 0xffffffff
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov ebx, dword [esi]
push 0xff
mov dword [ebp - 0x9ac], eax
lea eax, [ebp - 0x103]
push 0
push eax
mov dword [ebp - 0x994], ebx
mov byte [ebp - 0x104], 0
call fcn.1004e5f0
mov edi, dword [ebx + 0x484]
xor eax, eax
mov dword [ebp - 0x9b4], eax
mov ecx, dword [ebx + 0x484]
add esp, 0xc
mov dword [ebp - 0x9a0], eax
mov dword [ebp - 0x9a8], eax
mov dword [ebp - 0x9b0], 1
mov dword [ebp - 0x98c], eax
test ecx, ecx
je 0x1004052d
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100403a4
sub ecx, edx
cmp ecx, 1
jbe 0x10040525
mov edx, edi
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x100403bb
sub edx, ecx
push 0x16
pop ecx
cmp edx, ecx
jb 0x100403d9
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100403d0
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x1009d010]
pop ecx
pop ecx
mov dword [ebp - 0x98c], eax
test eax, eax
jne 0x100403f9
push 0x1b
pop eax
jmp 0x10040972
cmp byte [edi], 0x3a
jne 0x10040402
mov ecx, edi
jmp 0x10040445
push 0x3a
push edi
call fcn.1004f3b0
pop ecx
pop ecx
mov ecx, eax
mov dword [ebp - 0x998], ecx
test ecx, ecx
je 0x10040433
sub ecx, edi
push ecx
push edi
mov edi, dword [ebp - 0x98c]
push edi
call fcn.100513e0
mov ecx, dword [ebp - 0x998]
add esp, 0xc
jmp 0x1004044b
mov edx, dword [ebp - 0x98c]
sub edx, edi
mov al, byte [edi]
mov byte [edx + edi], al
inc edi
test al, al
jne 0x1004043b
mov edi, dword [ebp - 0x98c]
test ecx, ecx
je 0x100404d8
push 0x3a
push ecx
call fcn.1004f3b0
pop ecx
pop ecx
mov dword [ebp - 0x998], eax
test eax, eax
je 0x100404d8
push 0xa
lea ecx, [eax + 1]
push 0
push ecx
call fcn.1005241e
push eax
call fcn.1002ed0a
movzx eax, ax
push 0x2d
push dword [ebp - 0x998]
mov dword [ebp - 0x9a0], eax
call fcn.1004f3b0
add esp, 0x18
test eax, eax
je 0x100404b6
push 0xa
inc eax
push 0
push eax
call fcn.1005241e
push eax
call fcn.1002ed0a
mov ecx, dword [ebp - 0x9a0]
add esp, 0x10
movzx eax, ax
jmp 0x100404bf
mov ecx, dword [ebp - 0x9a0]
movzx eax, cx
mov dword [ebp - 0x9a8], eax
cmp cx, ax
jbe 0x100404d8
and dword [ebp - 0x9a8], 0
and dword [ebp - 0x9a0], 0
cmp byte [edi], 0
je 0x1004051b
push 0x401
lea eax, [ebp - 0x508]
push eax
mov eax, dword [esi + 0x54]
push edi
push dword [esi + 0x90]
push dword [eax + 0x18]
call fcn.10006055
pop ecx
push eax
mov eax, dword [esi + 0x54]
push dword [eax + 4]
call fcn.10006055
add esp, 0x18
sub eax, 0
je 0x1004051d
dec eax
je 0x1004057a
dec eax
jne 0x1004052f
jmp 0x100405ab
xor edi, edi
test edi, edi
jne 0x100405b1
mov edi, dword [ebp - 0x98c]
jmp 0x1004052f
mov edi, eax
lea eax, [ebp - 0x9a4]
push eax
lea eax, [ebp - 0x988]
push eax
push dword [esi + 0x1a8]
mov dword [ebp - 0x9a4], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x10040581
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.10031aa6
push eax
push str.getsockname___failed:__s
push ebx
call fcn.10025321
push edi
call dword [0x1009d004]
add esp, 0x18
push 0x1e
jmp 0x100403f3
push 0x401
lea eax, [ebp - 0x508]
push eax
lea eax, [ebp - 0x984]
push eax
movzx eax, word [ebp - 0x988]
push eax
call fcn.10032390
add esp, 0x10
and dword [ebp - 0x9b0], 0
lea edi, [ebp - 0x508]
lea eax, [ebp - 0x9b4]
push eax
push 0
push edi
push esi
call fcn.1001d2e8
add esp, 0x10
cmp eax, 1
jne 0x100405d8
lea eax, [ebp - 0x9b4]
push eax
push esi
call fcn.1001cac9
pop ecx
pop ecx
mov eax, dword [ebp - 0x9b4]
test eax, eax
je 0x100405f4
mov ebx, dword [eax]
push eax
push dword [ebp - 0x994]
call fcn.1001d433
pop ecx
pop ecx
jmp 0x100405f6
xor ebx, ebx
test ebx, ebx
jne 0x10040620
push edi
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push dword [ebp - 0x994]
call fcn.10025321
mov eax, dword [ebp - 0x98c]
push eax
call dword [0x1009d004]
add esp, 0x10
jmp 0x1004057a
mov eax, dword [ebp - 0x98c]
push eax
call dword [0x1009d004]
or dword [ebp - 0x990], 0xffffffff
and dword [ebp - 0x99c], 0
pop ecx
lea eax, [ebp - 0x990]
push eax
push 0
push ebx
push esi
call fcn.1002614f
mov edi, eax
add esp, 0x10
test edi, edi
je 0x1004066a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [ebx + 0x1c]
mov dword [ebp - 0x99c], eax
test ebx, ebx
jne 0x1004063c
jmp 0x10040670
mov eax, dword [ebp - 0x99c]
test ebx, ebx
jne 0x10040694
push eax
push esi
call fcn.10031aa6
push eax
push str.socket_failure:__s
push dword [ebp - 0x994]
call fcn.10025321
add esp, 0x14
jmp 0x1004057a
push dword [ebx + 0x10]
lea eax, [ebp - 0x988]
push dword [ebx + 0x18]
push eax
call fcn.1004e760
mov eax, dword [ebx + 0x10]
mov ecx, dword [ebp - 0x9a8]
mov dword [ebp - 0x9a4], eax
mov eax, dword [ebp - 0x9a0]
movzx eax, ax
movzx edx, cx
mov ecx, dword [ebp - 0x9a0]
add esp, 0xc
mov dword [ebp - 0x98c], eax
movzx ecx, cx
mov dword [ebp - 0x99c], 2
jmp 0x100407be
mov ecx, dword [ebp - 0x99c]
cmp word [ebp - 0x988], cx
jne 0x100406ff
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x986], ax
push dword [ebp - 0x9a4]
lea eax, [ebp - 0x988]
push eax
push dword [ebp - 0x990]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x10040836
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp - 0x9b0], 0
je 0x10040793
mov ecx, 0x2741
cmp eax, ecx
jne 0x10040793
push ecx
push esi
call fcn.10031aa6
push eax
push dword [ebp - 0x998]
push str.bind_port_hu__on_non_local_address_failed:__s_n
push dword [ebp - 0x994]
call fcn.100253dd
add esp, 0x18
lea eax, [ebp - 0x9a4]
push eax
lea eax, [ebp - 0x988]
push eax
push dword [esi + 0x1a8]
mov dword [ebp - 0x9a4], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x100407ce
mov eax, dword [ebp - 0x9a0]
and dword [ebp - 0x9b0], 0
movzx eax, ax
jmp 0x100407a6
cmp eax, 0x2740
je 0x1004079f
cmp eax, 0xd
jne 0x10040800
mov eax, dword [ebp - 0x98c]
inc eax
mov dword [ebp - 0x98c], eax
movzx ecx, ax
mov eax, dword [ebp - 0x9a8]
movzx edx, ax
mov eax, dword [ebp - 0x98c]
mov dword [ebp - 0x998], ecx
cmp ecx, edx
jle 0x100406e2
jmp 0x1004083c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.10031aa6
push eax
push str.getsockname___failed:__s
push dword [ebp - 0x994]
call fcn.10025321
push dword [ebp - 0x990]
push esi
call fcn.10025a4d
add esp, 0x1c
jmp 0x1004057a
push eax
push esi
call fcn.10031aa6
push eax
mov eax, dword [ebp - 0x98c]
movzx eax, ax
push eax
push str.bind_port_hu__failed:__s
push dword [ebp - 0x994]
call fcn.10025321
push dword [ebp - 0x990]
push esi
call fcn.10025a4d
add esp, 0x20
jmp 0x1004057a
mov eax, dword [ebp - 0x98c]
cmp ax, word [ebp - 0x9a8]
jbe 0x10040866
push str.bind___failed__we_ran_out_of_ports_
push dword [ebp - 0x994]
call fcn.10025321
push dword [ebp - 0x990]
push esi
call fcn.10025a4d
jmp 0x10040618
lea eax, [ebp - 0x9a4]
push eax
lea eax, [ebp - 0x988]
push eax
push dword [ebp - 0x990]
mov dword [ebp - 0x9a4], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x100407ce
push 1
push dword [ebp - 0x990]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x100408bc
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.10031aa6
push eax
push str.socket_failure:__s
jmp 0x100407e1
push 0x100
lea eax, [ebp - 0x104]
push eax
push ebx
call fcn.1001d2be
mov edx, dword [ebp - 0x9ac]
mov ebx, dword [ebp - 0x99c]
add esp, 0xc
cmp edx, ebx
je 0x10040940
mov cx, word [ebp - 0x988]
cmp dword [esi + 0x414], 0
jne 0x100408f5
test edx, edx
je 0x10040935
cmp edx, 1
jne 0x100408ff
cmp cx, bx
jne 0x10040935
movzx eax, cx
sub eax, ebx
jne 0x10040935
push dword [ebp - 0x986]
call dword [sym.imp.WS2_32.dll_ntohs]
mov edx, dword [ebp - 0x9ac]
movzx ebx, ax
test edx, edx
je 0x10040a27
cmp edx, 1
je 0x10040981
mov cx, word [ebp - 0x988]
mov ebx, dword [ebp - 0x99c]
inc edx
mov dword [ebp - 0x9ac], edx
cmp edx, ebx
jne 0x100408e8
lea ebx, [esi + 0x6b8]
push esi
mov dword [ebx + 0x74], edx
call fcn.1003e3eb
mov eax, dword [ebp - 0x990]
push 0x1c
push esi
mov dword [esi + 0x1ac], eax
mov dword [esi + 0x3f8], 1
call fcn.1003e3da
add esp, 0xc
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1004bbda
leave
ret
lea edx, [ebp - 0x908]
lea edi, [ebp - 0x104]
mov cl, byte [edi]
test cl, cl
je 0x100409b0
movzx eax, cl
cmp cl, 0x2e
mov dword [ebp - 0x998], 0x2c
cmove eax, dword [ebp - 0x998]
mov byte [edx], al
inc edx
inc edi
jne 0x1004098d
mov ecx, ebx
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.1002fd34
lea eax, [ebp - 0x908]
push eax
push str.PORT
push 0x10088860
lea ebx, [esi + 0x6b8]
push ebx
call fcn.10047519
mov edi, eax
add esp, 0x24
test edi, edi
je 0x10040a8e
push edi
call fcn.10031b9a
push eax
push str.Failure_sending_PORT_command:__s
push dword [ebp - 0x994]
call fcn.10025321
push dword [ebp - 0x990]
push esi
call fcn.10025a4d
push 0
push esi
call fcn.1003e3da
add esp, 0x20
jmp 0x10040970
mov ecx, dword [ebp - 0x99c]
push ebx
lea eax, [ebp - 0x104]
push eax
xor eax, eax
cmp word [ebp - 0x988], cx
lea ebx, [esi + 0x6b8]
setne al
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push ebx
call fcn.10047519
mov edi, eax
add esp, 0x18
test edi, edi
je 0x10040a8e
push edi
call fcn.10031b9a
push eax
push str.Failure_sending_EPRT_command:__s
push dword [ebp - 0x994]
call fcn.10025321
push dword [ebp - 0x990]
push esi
call fcn.10025a4d
mov dword [ebx + 0x74], 1
jmp 0x10040a17
mov edx, dword [ebp - 0x9ac]
jmp 0x10040946