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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa2c
mov eax, dword [0x590cc0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [edi]
push esi
push 0xff
lea ecx, [ebp - 0x183]
push 0
push ecx
mov dword [ebp - 0xa20], eax
mov dword [ebp - 0xa10], ebx
mov dword [ebp - 0xa0c], 0xffffffff
mov byte [ebp - 0x184], 0
call fcn.004ba010
mov esi, dword [ebx + 0x95c]
xor ecx, ecx
mov dword [ebp - 0xa2c], ecx
mov eax, dword [ebx + 0x95c]
add esp, 0xc
mov dword [ebp - 0xa24], ecx
mov dword [ebp - 0xa1c], ecx
mov dword [ebp - 0xa28], 1
mov dword [ebp - 0xa14], ecx
cmp eax, ecx
je 0x502925
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5027e8
sub eax, edx
cmp eax, 1
jbe 0x502925
mov eax, esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x502800
sub eax, edx
cmp eax, 0x16
jae 0x502815
mov eax, 0x16
jmp 0x502829
mov eax, esi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x502820
sub eax, edx
inc eax
push 1
push eax
call dword [0x592314]
add esp, 8
mov dword [ebp - 0xa14], eax
test eax, eax
jne 0x502855
pop esi
mov eax, 0x1b
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
cmp byte [esi], 0x3a
jne 0x5029a1
mov ebx, esi
test ebx, ebx
je 0x5028d4
push 0x3a
push ebx
call fcn.004be4d0
mov esi, eax
add esp, 8
test esi, esi
je 0x5028d4
push 0xa
lea ecx, [esi + 1]
push 0
push ecx
call fcn.004d025a
push eax
call fcn.004ef580
movzx ebx, ax
push 0x2d
push esi
mov dword [ebp - 0xa24], ebx
call fcn.004be4d0
add esp, 0x18
test eax, eax
je 0x5029e5
push 0xa
inc eax
push 0
push eax
call fcn.004d025a
push eax
call fcn.004ef580
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0xa1c], eax
cmp bx, ax
jbe 0x5028d4
xor eax, eax
mov dword [ebp - 0xa1c], eax
mov dword [ebp - 0xa24], eax
mov ebx, dword [ebp - 0xa14]
cmp byte [ebx], 0
je 0x502925
mov ecx, dword [edi + 0x8c]
mov edx, dword [edi + 0x50]
push 0x401
lea eax, [ebp - 0x588]
push eax
mov eax, dword [edx + 0x18]
push ebx
push ecx
push eax
call fcn.00516cf0
mov ecx, dword [edi + 0x50]
mov edx, dword [ecx + 4]
add esp, 4
push eax
push edx
call fcn.00516cf0
add esp, 0x18
sub eax, 0
je 0x5029f3
dec eax
je 0x50298c
dec eax
je 0x502a2a
mov edx, dword [edi + 0x1a8]
lea eax, [ebp - 0xa18]
push eax
lea ecx, [ebp - 0xa08]
push ecx
push edx
mov dword [ebp - 0xa18], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x5029f7
push 0x80
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00514fd0
mov ecx, dword [ebp - 0xa10]
push eax
push str.getsockname___failed:__s
push ecx
call fcn.004ed150
mov edx, dword [ebp - 0xa14]
push edx
call dword [0x592308]
add esp, 0x1c
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
push 0x3a
push esi
call fcn.004be4d0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x5029cc
mov eax, dword [ebp - 0xa14]
mov edx, ebx
sub edx, esi
push edx
push esi
push eax
call fcn.004bb4f0
add esp, 0xc
jmp 0x502860
mov edx, dword [ebp - 0xa14]
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x5029d6
jmp 0x5028d4
movzx edx, bx
mov dword [ebp - 0xa1c], edx
jmp 0x5028d4
mov esi, ebx
jmp 0x502a30
movzx edx, word [ebp - 0xa08]
push 0x401
lea eax, [ebp - 0x588]
push eax
lea ecx, [ebp - 0xa04]
push ecx
push edx
call fcn.004f5ad0
mov ebx, dword [ebp - 0xa14]
add esp, 0x10
mov dword [ebp - 0xa28], 0
lea esi, [ebp - 0x588]
lea eax, [ebp - 0xa2c]
push eax
push 0
push esi
push edi
call fcn.004e4ef0
add esp, 0x10
cmp eax, 1
jne 0x502a58
lea ecx, [ebp - 0xa2c]
push ecx
push edi
call fcn.004e3b30
add esp, 8
mov eax, dword [ebp - 0xa2c]
test eax, eax
je 0x502a7e
mov edx, dword [ebp - 0xa10]
mov ebx, dword [eax]
push eax
push edx
call fcn.004e5100
add esp, 8
test ebx, ebx
jne 0x502aaf
mov ebx, dword [ebp - 0xa14]
mov eax, dword [ebp - 0xa10]
push esi
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push eax
call fcn.004ed150
push ebx
call dword [0x592308]
add esp, 0x10
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xa14]
push ecx
call dword [0x592308]
add esp, 4
mov dword [ebp - 0xa0c], 0xffffffff
xor esi, esi
jmp 0x502ad0
lea edx, [ebp - 0xa0c]
push edx
push 0
push ebx
push edi
call fcn.004f2580
add esp, 0x10
mov dword [ebp - 0xa14], eax
test eax, eax
je 0x502afe
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [ebx + 0x1c]
mov esi, eax
test ebx, ebx
jne 0x502ad0
jmp 0x502b02
test ebx, ebx
jne 0x502b3e
push 0x80
lea eax, [ebp - 0x84]
push eax
push esi
call fcn.00514fd0
mov ecx, dword [ebp - 0xa10]
push eax
push str.socket_failure:__s
push ecx
call fcn.004ed150
add esp, 0x18
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
mov edx, dword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
push edx
push eax
lea ecx, [ebp - 0xa08]
push ecx
call fcn.004b9350
mov ax, word [ebp - 0xa1c]
mov edx, dword [ebx + 0x10]
movzx esi, word [ebp - 0xa24]
add esp, 0xc
mov dword [ebp - 0xa18], edx
cmp word [ebp - 0xa24], ax
ja 0x502cf8
lea esp, [esp]
cmp word [ebp - 0xa08], 2
jne 0x502b98
push esi
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xa06], ax
mov ecx, dword [ebp - 0xa18]
mov eax, dword [ebp - 0xa0c]
push ecx
lea edx, [ebp - 0xa08]
push edx
push eax
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x502cef
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp - 0xa28], 0
je 0x502c34
cmp eax, 0x2741
jne 0x502c34
push 0x80
lea ecx, [ebp - 0x84]
push ecx
push eax
call fcn.00514fd0
push eax
mov eax, dword [ebp - 0xa10]
movzx edx, si
push edx
push str.bind_port_hu__on_non_local_address_failed:__s_n
push eax
call fcn.004ed020
mov eax, dword [edi + 0x1a8]
add esp, 0x1c
lea ecx, [ebp - 0xa18]
push ecx
lea edx, [ebp - 0xa08]
push edx
push eax
mov dword [ebp - 0xa18], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x502c53
movzx esi, word [ebp - 0xa24]
mov dword [ebp - 0xa28], eax
jmp 0x502c41
cmp eax, 0x2740
je 0x502c40
cmp eax, 0xd
jne 0x502ca2
inc esi
cmp si, word [ebp - 0xa1c]
jbe 0x502b80
jmp 0x502cf8
push 0x80
lea ecx, [ebp - 0x84]
push ecx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00514fd0
mov edx, dword [ebp - 0xa10]
push eax
push str.getsockname___failed:__s
push edx
call fcn.004ed150
mov eax, dword [ebp - 0xa0c]
push eax
push edi
call fcn.004f2500
add esp, 0x20
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
push 0x80
lea ecx, [ebp - 0x84]
push ecx
push eax
call fcn.00514fd0
push eax
mov eax, dword [ebp - 0xa10]
movzx edx, si
push edx
push str.bind_port_hu__failed:__s
push eax
call fcn.004ed150
mov ecx, dword [ebp - 0xa0c]
push ecx
push edi
call fcn.004f2500
add esp, 0x24
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
cmp si, word [ebp - 0xa1c]
jbe 0x502d2e
mov edx, dword [ebp - 0xa10]
push str.bind___failed__we_ran_out_of_ports_
push edx
call fcn.004ed150
mov eax, dword [ebp - 0xa0c]
push eax
push edi
call fcn.004f2500
add esp, 0x10
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xa0c]
lea ecx, [ebp - 0xa18]
push ecx
lea edx, [ebp - 0xa08]
push edx
push eax
mov dword [ebp - 0xa18], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x502c53
mov ecx, dword [ebp - 0xa0c]
push 1
push ecx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x502dbd
push 0x80
lea edx, [ebp - 0x84]
push edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00514fd0
push eax
mov eax, dword [ebp - 0xa10]
push str.socket_failure:__s
push eax
call fcn.004ed150
mov ecx, dword [ebp - 0xa0c]
push ecx
push edi
call fcn.004f2500
add esp, 0x20
pop esi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
push 0x100
lea edx, [ebp - 0x184]
push edx
push ebx
call fcn.004e4340
mov esi, dword [ebp - 0xa20]
add esp, 0xc
cmp esi, 2
je 0x502e31
mov cx, word [ebp - 0xa08]
test dword [edi + 0x280], 0x40000
jne 0x502df4
test esi, esi
je 0x502e2b
cmp esi, 1
jne 0x502dff
cmp cx, 2
jne 0x502e2b
movzx eax, cx
sub eax, 2
jne 0x502e2b
mov eax, dword [ebp - 0xa06]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ebx, ax
test esi, esi
je 0x502e3c
cmp esi, 1
je 0x502ec7
mov cx, word [ebp - 0xa08]
inc esi
cmp esi, 2
jne 0x502de4
mov ebx, dword [ebp - 0xa14]
jmp 0x502f77
xor eax, eax
cmp word [ebp - 0xa08], 2
push ebx
setne al
lea edx, [ebp - 0x184]
push edx
mov dword [ebp - 0xa20], esi
lea esi, [edi + 0x388]
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push esi
call fcn.00517850
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x502f71
push ebx
call fcn.00514860
mov ecx, dword [ebp - 0xa10]
push eax
push str.Failure_sending_EPRT_command:__s
push ecx
call fcn.004ed150
mov edx, dword [ebp - 0xa0c]
push edx
push edi
call fcn.004f2500
add esp, 0x18
mov dword [esi + 0x78], 1
pop esi
mov eax, ebx
mov dword [edi + 0x40c], 0
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x988]
lea edx, [ebp - 0x184]
mov al, byte [edx]
test al, al
je 0x502ee8
cmp al, 0x2e
jne 0x502ee2
mov byte [ecx], 0x2c
jmp 0x502ee4
mov byte [ecx], al
inc ecx
inc edx
jne 0x502ed3
mov eax, ebx
mov edx, ebx
and edx, 0xff
push edx
shr eax, 8
push eax
push str.__d__d
push 0x14
push ecx
mov byte [ecx], 0
call fcn.004f47c0
lea eax, [ebp - 0x988]
push eax
push str.PORT
lea eax, [edi + 0x388]
push 0x565a34
push eax
call fcn.00517850
mov ebx, eax
add esp, 0x24
test ebx, ebx
je 0x502f77
push ebx
call fcn.00514860
mov ecx, dword [ebp - 0xa10]
push eax
push str.Failure_sending_PORT_command:__s
push ecx
call fcn.004ed150
mov edx, dword [ebp - 0xa0c]
push edx
push edi
call fcn.004f2500
add esp, 0x18
pop esi
mov eax, ebx
mov dword [edi + 0x40c], 0
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0xa20]
mov dword [edi + 0x400], esi
mov eax, dword [edi + 0x1ac]
cmp eax, 0xffffffff
je 0x502f9c
push eax
push edi
call fcn.004f2500
add esp, 8
mov dword [edi + 0x1ac], 0xffffffff
mov eax, dword [ebp - 0xa0c]
mov ecx, dword [ebp - 4]
mov dword [edi + 0x1ac], eax
pop esi
mov dword [edi + 0x27c], 1
mov eax, ebx
xor ecx, ebp
mov dword [edi + 0x40c], 0x1c
pop ebx
call fcn.004b9ff3
mov esp, ebp
pop ebp
ret