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

Disassembly:
sub esp, 0x9a8
mov eax, dword [0x580ca0]
xor eax, esp
mov dword [esp + 0x9a4], eax
push ebx
push ebp
mov ebp, dword [esi]
push edi
xor ebx, ebx
push 0xff
lea eax, [esp + 0xb1]
push ebx
push eax
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], 0xffffffff
mov byte [esp + 0xb8], bl
call fcn.004ba280
mov edi, dword [ebp + 0x3b8]
mov dword [esp + 0x2c], ebx
mov eax, dword [ebp + 0x3b8]
add esp, 0xc
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], 1
cmp eax, ebx
je 0x508aee
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5089c0
sub eax, edx
cmp eax, 1
jbe 0x508aee
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5089d7
sub eax, edx
cmp eax, 0x16
jae 0x5089ec
mov eax, 0x16
jmp 0x5089fa
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5089f1
sub eax, edx
inc eax
push 1
push eax
call dword [0x582a98]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x508a28
pop edi
pop ebp
lea eax, [ebx + 0x1b]
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
cmp byte [edi], 0x3a
jne 0x508b59
mov ebp, edi
test ebp, ebp
je 0x508a9e
push 0x3a
push ebp
call fcn.004d1530
mov edi, eax
add esp, 8
test edi, edi
je 0x508a9e
push 0xa
lea edx, [edi + 1]
push 0
push edx
call fcn.004c9796
push eax
call fcn.00510ad0
movzx ebp, ax
push 0x2d
push edi
mov dword [esp + 0x34], ebp
call fcn.004d1530
xor edi, edi
add esp, 0x18
cmp eax, edi
je 0x508b93
push 0xa
inc eax
push edi
push eax
call fcn.004c9796
push eax
call fcn.00510ad0
movzx eax, ax
add esp, 0x10
mov dword [esp + 0x18], eax
cmp bp, ax
jbe 0x508a9e
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
cmp byte [ebx], 0
je 0x508aee
mov edx, dword [esi + 0x88]
mov eax, dword [esi + 0x4c]
push 0x401
lea ecx, [esp + 0x1b0]
push ecx
mov ecx, dword [eax + 0x18]
push ebx
push edx
push ecx
call fcn.00415bc0
mov edx, dword [esi + 0x4c]
add esp, 4
push eax
mov eax, dword [edx + 4]
push eax
call fcn.00415bc0
add esp, 0x18
sub eax, 0
je 0x508b9f
sub eax, 1
je 0x508b3c
sub eax, 1
je 0x508bcb
mov eax, dword [esi + 0x154]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x30]
push edx
push eax
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x508ba3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004edba0
mov ecx, dword [esp + 0x18]
push eax
push str.getsockname___failed:__s
push ecx
call fcn.004f9190
push ebx
call dword [0x582a8c]
add esp, 0x18
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
push 0x3a
push edi
call fcn.004d1530
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x508b7e
mov ecx, ebp
sub ecx, edi
push ecx
push edi
push ebx
call fcn.004c2030
add esp, 0xc
jmp 0x508a33
mov edx, ebx
mov eax, edi
sub edx, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x508b84
jmp 0x508a9e
movzx eax, bp
mov dword [esp + 0x18], eax
jmp 0x508a9e
mov edi, ebx
jmp 0x508bd2
movzx ecx, word [esp + 0x2c]
push 0x401
lea edx, [esp + 0x1b0]
push edx
lea eax, [esp + 0x38]
push eax
push ecx
call fcn.004fe700
add esp, 0x10
mov dword [esp + 0x24], 0
lea edi, [esp + 0x1ac]
lea edx, [esp + 0x20]
push edx
push 0
push edi
push esi
call fcn.004eff80
add esp, 0x10
cmp eax, 1
jne 0x508bf6
lea eax, [esp + 0x20]
push eax
push esi
call fcn.004ef950
add esp, 8
mov eax, dword [esp + 0x20]
test eax, eax
je 0x508c12
mov ecx, dword [esp + 0x10]
mov ebp, dword [eax]
push eax
push ecx
call fcn.004f0450
add esp, 8
test ebp, ebp
jne 0x508c49
mov edx, dword [esp + 0x10]
push edi
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push edx
call fcn.004f9190
push ebx
call dword [0x582a8c]
add esp, 0x10
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
push ebx
call dword [0x582a8c]
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
add esp, 4
mov dword [esp + 0xc], 0xffffffff
xor edi, edi
lea eax, [esp + 0xc]
push eax
push 0
push ebp
push esi
call fcn.004fbbd0
add esp, 0x10
mov dword [esp + 0x28], eax
test eax, eax
je 0x508c89
call ebx
mov ebp, dword [ebp + 0x1c]
mov edi, eax
test ebp, ebp
jne 0x508c63
jmp 0x508c8d
test ebp, ebp
jne 0x508cc4
push edi
push esi
call fcn.004edba0
mov ecx, dword [esp + 0x18]
push eax
push str.socket_failure:__s
push ecx
call fcn.004f9190
add esp, 0x14
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x18]
push edx
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.004bf1d0
mov eax, dword [esp + 0x28]
mov edx, dword [ebp + 0x10]
add esp, 0xc
mov dword [esp + 0x14], edx
movzx edi, ax
cmp ax, word [esp + 0x18]
ja 0x508e30
mov ebx, dword [esp + 0x24]
cmp word [esp + 0x2c], 2
jne 0x508d0a
push edi
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2e], ax
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0xc]
push eax
lea ecx, [esp + 0x30]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x508e29
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test ebx, ebx
je 0x508d82
cmp eax, 0x2741
jne 0x508d82
push eax
push esi
call fcn.004edba0
push eax
movzx eax, di
mov edi, dword [esp + 0x1c]
push eax
push str.bind_port_hu__on_non_local_address_failed:__s_n
push edi
call fcn.004f9100
mov eax, dword [esi + 0x154]
add esp, 0x18
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x30]
push edx
push eax
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x508d9f
movzx edi, word [esp + 0x1c]
xor ebx, ebx
jmp 0x508d8f
cmp eax, 0x2740
je 0x508d8e
cmp eax, 0xd
jne 0x508de3
inc edi
cmp di, word [esp + 0x18]
jbe 0x508cf6
jmp 0x508e30
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004edba0
push eax
push str.getsockname___failed:__s
push edi
call fcn.004f9190
mov ecx, dword [esp + 0x20]
push ecx
push esi
call fcn.004fbb70
add esp, 0x1c
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
push eax
push esi
call fcn.004edba0
push eax
mov eax, dword [esp + 0x1c]
movzx edx, di
push edx
push str.bind_port_hu__failed:__s
push eax
call fcn.004f9190
mov ecx, dword [esp + 0x24]
push ecx
push esi
call fcn.004fbb70
add esp, 0x20
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
cmp di, word [esp + 0x18]
jbe 0x508e6a
mov edx, dword [esp + 0x10]
push str.bind___failed__we_ran_out_of_ports_
push edx
call fcn.004f9190
mov eax, dword [esp + 0x14]
push eax
push esi
call fcn.004fbb70
add esp, 0x10
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
mov eax, dword [esp + 0xc]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x30]
push edx
push eax
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x508ed3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004edba0
push eax
push str.getsockname___failed:__s
mov ecx, dword [esp + 0x20]
push ecx
call fcn.004f9190
mov edx, dword [esp + 0x20]
push edx
push esi
call fcn.004fbb70
add esp, 0x1c
pop edi
pop ebp
mov eax, 0x1e
pop ebx
mov ecx, dword [esp + 0x9a4]
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
mov eax, dword [esp + 0xc]
push 1
push eax
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x508ef9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004edba0
push eax
push str.socket_failure:__s
jmp 0x508e9e
push 0x100
lea eax, [esp + 0xb0]
push eax
push ebp
call fcn.004efc80
mov ebp, dword [esp + 0x9c4]
add esp, 0xc
cmp ebp, 2
je 0x508f68
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esp + 0x2c]
cmp dword [esi + 0x218], 0
jne 0x508f33
test ebp, ebp
je 0x508f62
cmp ebp, 1
jne 0x508f3e
cmp cx, 2
jne 0x508f62
movzx eax, cx
sub eax, 2
jne 0x508f62
mov ecx, dword [esp + 0x2e]
push ecx
call ebx
movzx edi, ax
test ebp, ebp
je 0x508fc1
cmp ebp, 1
je 0x50902f
mov cx, word [esp + 0x2c]
inc ebp
cmp ebp, 2
jne 0x508f26
mov ebx, dword [esp + 0x28]
mov dword [esi + 0x468], ebp
mov eax, dword [esi + 0x158]
cmp eax, 0xffffffff
je 0x508f87
push eax
push esi
call fcn.004fbb70
add esp, 8
mov eax, dword [esp + 0xc]
mov dword [esi + 0x158], eax
mov dword [esi + 0x1fc], 1
mov eax, 0x1c
mov ecx, esi
call fcn.00508830
mov ecx, dword [esp + 0x9b0]
pop edi
pop ebp
mov eax, ebx
pop ebx
xor ecx, esp
call fcn.004ba1db
add esp, 0x9a8
ret
xor ecx, ecx
cmp word [esp + 0x2c], 2
movzx edx, di
setne cl
push edx
lea eax, [esp + 0xb0]
push eax
lea edi, [esi + 0x400]
inc ecx
push ecx
push str.EPRT
push str._s__d_s_hu
push edi
call fcn.005175f0
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x508f6c
push ebx
call fcn.004ed200
mov edx, dword [esp + 0x14]
push eax
push str.Failure_sending_EPRT_command:__s
push edx
call fcn.004f9190
mov eax, dword [esp + 0x1c]
push eax
push esi
call fcn.004fbb70
add esp, 0x18
mov dword [edi + 0x68], 1
xor eax, eax
jmp 0x508fa0
lea ecx, [esp + 0x5b0]
lea edx, [esp + 0xac]
lea ecx, [ecx]
mov al, byte [edx]
test al, al
je 0x509057
cmp al, 0x2e
jne 0x50904f
mov byte [ecx], 0x2c
jmp 0x509051
mov byte [ecx], al
inc ecx
add edx, 1
jne 0x509040
movzx eax, di
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.004fcc50
lea eax, [esp + 0x5c4]
push eax
push str.PORT
lea eax, [esi + 0x400]
push 0x5435e4
push eax
call fcn.005175f0
mov ebx, eax
add esp, 0x24
test ebx, ebx
je 0x508f6c
push ebx
call fcn.004ed200
mov ecx, dword [esp + 0x14]
push eax
push str.Failure_sending_PORT_command:__s
push ecx
call fcn.004f9190
mov edx, dword [esp + 0x1c]
push edx
push esi
call fcn.004fbb70
add esp, 0x18
xor eax, eax
jmp 0x508fa0