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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x62c
mov eax, dword [0x624500]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, dword [ebp + 8]
push 0x2f
push 0
mov dword [ebp - 0x62c], edi
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x604], eax
add eax, 0x420
mov dword [ebp - 0x624], eax
lea eax, [ebp - 0x34]
push eax
mov dword [ebp - 0x60c], 0xffffffff
call fcn.0058d810
mov esi, dword [edi + 0x530]
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x61c], eax
mov dword [ebp - 0x628], eax
mov dword [ebp - 0x620], eax
mov dword [ebp - 0x608], eax
mov byte [ebp - 0x5fd], 1
mov dword [ebp - 0x610], eax
test esi, esi
je 0x521552
mov ecx, esi
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5212d0
sub ecx, edx
cmp ecx, 1
jbe 0x521552
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5212e7
sub ecx, edx
cmp ecx, 0x41
jae 0x5212fc
mov ecx, 0x41
jmp 0x52130a
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x521301
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x6244d4]
add esp, 8
mov dword [ebp - 0x610], eax
test eax, eax
jne 0x521339
pop edi
pop esi
mov eax, 0x1b
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00539e65
mov esp, ebp
pop ebp
ret
mov al, byte [esi]
cmp al, 0x5b
jne 0x52137b
push 0x5d
push esi
call fcn.0058f240
mov ecx, eax
add esp, 8
mov dword [ebp - 0x608], ecx
test ecx, ecx
je 0x52140d
lea eax, [esi + 1]
sub ecx, eax
push ecx
push eax
mov eax, dword [ebp - 0x610]
push eax
call fcn.005a9280
mov ecx, dword [ebp - 0x608]
add esp, 0xc
jmp 0x52140d
cmp al, 0x3a
jne 0x521386
mov ecx, esi
jmp 0x52140d
push 0x3a
push esi
call fcn.0058f240
mov ecx, eax
add esp, 8
mov dword [ebp - 0x608], ecx
test ecx, ecx
je 0x5213f7
lea eax, [ebp - 0x5fc]
push eax
push esi
push 0x17
call fcn.0052db60
add esp, 0xc
cmp eax, 1
jne 0x5213d6
mov ecx, dword [ebp - 0x610]
sub ecx, esi
nop dword [eax]
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [esi + ecx - 1], al
test al, al
jne 0x5213c0
xor esi, esi
xor edx, edx
jmp 0x521470
mov eax, dword [ebp - 0x608]
sub eax, esi
push eax
mov eax, dword [ebp - 0x610]
push esi
push eax
call fcn.005a9280
mov ecx, dword [ebp - 0x608]
add esp, 0xc
jmp 0x52140d
mov edx, dword [ebp - 0x610]
sub edx, esi
nop
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [esi + edx - 1], al
test al, al
jne 0x521400
xor esi, esi
xor edx, edx
test ecx, ecx
je 0x521470
push 0x3a
push ecx
call fcn.0058f240
add esp, 8
mov dword [ebp - 0x614], eax
xor edx, edx
test eax, eax
je 0x521470
push 0xa
push edx
lea ecx, [eax + 1]
push ecx
call fcn.005a7bc3
push eax
call fcn.00503630
push 0x2d
push dword [ebp - 0x614]
movzx esi, ax
call fcn.0058f240
add esp, 0x18
test eax, eax
je 0x52146e
push 0xa
inc eax
push 0
push eax
call fcn.005a7bc3
push eax
call fcn.00503630
add esp, 0x10
movzx edx, ax
jmp 0x521470
mov edx, esi
xor ecx, ecx
movzx eax, dx
cmp si, dx
cmovbe ecx, eax
movzx eax, cx
xor ecx, ecx
mov dword [ebp - 0x608], eax
cmp si, dx
movzx eax, si
mov esi, dword [ebp - 0x610]
cmovbe ecx, eax
movzx eax, cx
mov dword [ebp - 0x614], eax
cmp byte [esi], 0
je 0x521538
push 0x401
lea eax, [ebp - 0x57c]
push eax
mov eax, dword [ebp - 0x604]
push esi
push dword [eax + 0x500]
mov eax, dword [eax + 0x48]
push dword [eax + 0x18]
call fcn.0052d760
add esp, 4
push eax
mov eax, dword [ebp - 0x604]
mov eax, dword [eax + 0x48]
push dword [eax + 4]
call fcn.00480280
add esp, 0x18
sub eax, 0
je 0x521504
sub eax, 1
je 0x521b64
sub eax, 1
jne 0x52150e
lea ecx, [ebp - 0x57c]
mov dword [ebp - 0x61c], ecx
jmp 0x521510
mov ecx, esi
mov dword [ebp - 0x61c], ecx
jmp 0x521510
xor ecx, ecx
mov eax, dword [ebp - 0x614]
movzx edx, ax
mov eax, dword [ebp - 0x608]
movzx eax, ax
mov dword [ebp - 0x620], edx
mov dword [ebp - 0x608], eax
test ecx, ecx
jne 0x521604
jmp 0x521554
movzx ecx, ax
mov eax, dword [ebp - 0x608]
movzx eax, ax
mov dword [ebp - 0x620], ecx
mov dword [ebp - 0x608], eax
jmp 0x521554
xor esi, esi
lea eax, [ebp - 0x618]
mov dword [ebp - 0x618], 0x80
push eax
lea eax, [ebp - 0x5fc]
push eax
mov eax, dword [ebp - 0x604]
push dword [eax + 0x130]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x5215b5
push 0x100
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00512d60
push eax
push str.getsockname___failed:__s
push edi
call fcn.00500ec0
push esi
call dword [0x6244c8]
add esp, 0x1c
jmp 0x521b64
cmp word [ebp - 0x5fc], 0x17
lea edx, [ebp - 0x5f4]
movzx eax, word [ebp - 0x5fc]
lea ecx, [ebp - 0x5f8]
cmove ecx, edx
lea edx, [ebp - 0x57c]
push 0x401
push edx
push ecx
push eax
call fcn.0052d830
add esp, 0x10
test eax, eax
je 0x521b64
lea ecx, [ebp - 0x57c]
mov byte [ebp - 0x5fd], 0
mov dword [ebp - 0x61c], ecx
lea eax, [ebp - 0x628]
push eax
push 0
push 0
push ecx
push edi
call fcn.00508820
add esp, 0x14
cmp eax, 1
jne 0x52162e
lea eax, [ebp - 0x628]
push eax
push edi
call fcn.004fbbe0
add esp, 8
mov eax, dword [ebp - 0x628]
test eax, eax
je 0x521b42
mov esi, dword [eax]
push eax
push edi
mov dword [ebp - 0x614], esi
call fcn.00508ae0
add esp, 8
test esi, esi
je 0x521b42
mov eax, dword [ebp - 0x610]
push eax
call dword [0x6244c8]
add esp, 4
mov dword [ebp - 0x61c], 0
lea eax, [ebp - 0x60c]
push eax
push 0
push esi
push edi
call fcn.00502540
add esp, 0x10
mov dword [ebp - 0x610], eax
test eax, eax
je 0x5216a8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [esi + 0x1c]
mov dword [ebp - 0x61c], eax
mov dword [ebp - 0x614], esi
test esi, esi
jne 0x521670
jmp 0x5216b2
test esi, esi
jne 0x5216d8
mov eax, dword [ebp - 0x61c]
push 0x100
lea ecx, [ebp - 0x178]
push ecx
push eax
call fcn.00512d60
push eax
push str.socket_failure:__s
push edi
call fcn.00500ec0
add esp, 0x18
jmp 0x521b64
push dword [esi + 0x10]
lea eax, [ebp - 0x5fc]
push dword [esi + 0x18]
push eax
call fcn.0058cce0
mov eax, dword [esi + 0x10]
add esp, 0xc
mov dword [ebp - 0x618], eax
mov eax, dword [ebp - 0x620]
cmp ax, word [ebp - 0x608]
movzx esi, ax
ja 0x521b20
mov eax, dword [sym.imp.WS2_32.dll_htons]
push esi
call eax
push dword [ebp - 0x618]
movzx eax, ax
mov word [ebp - 0x5fa], ax
lea eax, [ebp - 0x5fc]
push eax
push dword [ebp - 0x60c]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x521856
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp byte [ebp - 0x5fd], 0
je 0x5217c8
cmp eax, 0x2741
jne 0x5217c8
push 0x100
lea eax, [ebp - 0x178]
push eax
push 0x2741
call fcn.00512d60
push eax
movzx eax, si
push eax
push str.bind_port_hu__on_non_local_address_failed:__s
push edi
call fcn.00500f80
mov esi, dword [ebp - 0x604]
lea eax, [ebp - 0x618]
add esp, 0x1c
mov dword [ebp - 0x618], 0x80
push eax
lea eax, [ebp - 0x5fc]
push eax
push dword [esi + 0x130]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x5217e1
mov eax, dword [ebp - 0x620]
movzx esi, ax
cmp si, word [ebp - 0x608]
mov byte [ebp - 0x5fd], 0
jmp 0x521706
cmp eax, 0x2740
je 0x5217d4
cmp eax, 0xd
jne 0x52181a
inc esi
cmp si, word [ebp - 0x608]
jmp 0x521706
push 0x100
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00512d60
push eax
push str.getsockname___failed:__s
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push esi
push edi
call fcn.00501890
add esp, 0x24
jmp 0x521b64
push 0x100
lea ecx, [ebp - 0x178]
push ecx
push eax
call fcn.00512d60
push eax
movzx eax, si
push eax
push str.bind_port_hu__failed:__s
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push dword [ebp - 0x604]
push edi
call fcn.00501890
add esp, 0x28
jmp 0x521b64
cmp si, word [ebp - 0x608]
ja 0x521b20
lea eax, [ebp - 0x618]
mov dword [ebp - 0x618], 0x80
push eax
lea eax, [ebp - 0x5fc]
push eax
push dword [ebp - 0x60c]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x5218c9
push 0x100
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00512d60
push eax
push str.getsockname___failed:__s
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push dword [ebp - 0x604]
push edi
call fcn.00501890
add esp, 0x24
jmp 0x521b64
push 1
push dword [ebp - 0x60c]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x5218fb
push 0x100
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00512d60
push eax
push str.socket_failure:__s
jmp 0x5218a9
push 0x2f
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x614]
call fcn.005087d0
mov eax, dword [ebp - 0x604]
add esp, 0xc
cmp byte [eax + 0x253], 0
jne 0x52192e
cmp byte [eax + 0x24c], 0
je 0x52192e
mov byte [eax + 0x253], 1
cmp ebx, 2
je 0x521996
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [ebp - 0x5fc]
cmp byte [eax + 0x253], 0
jne 0x52194d
test ebx, ebx
je 0x521990
cmp ebx, 1
jne 0x521958
cmp cx, 2
jne 0x521990
movzx eax, cx
sub eax, 2
je 0x521965
sub eax, 0x15
jne 0x52198a
push dword [ebp - 0x5fa]
call esi
movzx eax, ax
mov dword [ebp - 0x614], eax
test ebx, ebx
je 0x521a97
cmp ebx, 1
je 0x5219e3
mov cx, word [ebp - 0x5fc]
mov eax, dword [ebp - 0x604]
inc ebx
cmp ebx, 2
jne 0x521940
mov esi, dword [ebp - 0x610]
mov eax, dword [ebp - 0x624]
mov dword [eax + 0x78], ebx
mov ebx, dword [ebp - 0x604]
push ebx
push edi
call fcn.0051ee90
mov eax, dword [ebp - 0x60c]
push 0x1c
push edi
mov dword [ebx + 0x134], eax
mov byte [ebx + 0x23d], 1
call fcn.0051ee70
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00539e65
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x78]
mov edi, 0x2c
lea esi, [ebp - 0x34]
nop
mov cl, byte [esi]
test cl, cl
je 0x521a07
cmp cl, 0x2e
movzx eax, cl
cmove eax, edi
mov byte [edx], al
inc edx
add esi, 1
jne 0x5219f0
mov eax, dword [ebp - 0x614]
movzx ecx, ax
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.00510fc0
mov edi, dword [ebp - 0x62c]
lea eax, [ebp - 0x78]
push eax
push str.PORT
push 0x5e60c8
push dword [ebp - 0x624]
push edi
call fcn.00535a60
mov esi, eax
add esp, 0x28
test esi, esi
je 0x52199c
push esi
call fcn.00512ee0
push eax
push str.Failure_sending_PORT_command:__s
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push dword [ebp - 0x604]
push edi
call fcn.00501890
push 0
push edi
call fcn.0051ee70
add esp, 0x24
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00539e65
mov esp, ebp
pop ebp
ret
movzx eax, ax
push eax
lea eax, [ebp - 0x34]
push eax
xor eax, eax
cmp word [ebp - 0x5fc], 2
setne al
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push dword [ebp - 0x624]
push edi
call fcn.00535a60
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x52199c
push esi
call fcn.00512ee0
push eax
push str.Failure_sending_EPRT_command:__s
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push dword [ebp - 0x604]
push edi
call fcn.00501890
mov eax, dword [ebp - 0x624]
push 0
push edi
mov dword [eax + 0x78], 1
call fcn.0051ee70
add esp, 0x24
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00539e65
mov esp, ebp
pop ebp
ret
push str.bind___failed__we_ran_out_of_ports
push edi
call fcn.00500ec0
push dword [ebp - 0x60c]
push dword [ebp - 0x604]
push edi
call fcn.00501890
add esp, 0x14
jmp 0x521b64
mov eax, dword [ebp - 0x61c]
push eax
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push edi
call fcn.00500ec0
mov eax, dword [ebp - 0x610]
push eax
call dword [0x6244c8]
add esp, 0x10
mov ecx, dword [ebp - 4]
mov eax, 0x1e
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00539e65
mov esp, ebp
pop ebp
ret