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

Disassembly:
sub esp, 0x9b4
mov eax, dword [0x5b3094]
xor eax, esp
mov dword [esp + 0x9b0], eax
push ebx
mov ebx, dword [esp + 0x9c0]
lea eax, [esp + 0xb0]
push ebp
push esi
push edi
mov edi, dword [esp + 0x9c8]
push 0x100
push 0
push eax
mov ebp, dword [edi]
mov dword [esp + 0x44], edi
mov dword [esp + 0x24], ebp
mov dword [esp + 0x20], 0xffffffff
call sub.VCRUNTIME140.dll_memset
mov esi, dword [ebp + 0x370]
xor eax, eax
mov dword [esp + 0x38], eax
add esp, 0xc
mov ecx, dword [ebp + 0x370]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x1c], eax
mov byte [esp + 0x13], 1
test ecx, ecx
je 0x5392e2
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5390c0
sub ecx, edx
cmp ecx, 1
jbe 0x5392e2
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5390d7
sub ecx, edx
cmp ecx, 0x41
jae 0x5390ec
mov ecx, 0x41
jmp 0x5390fa
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5390f1
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x5b3028]
add esp, 8
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x53911b
mov eax, 0x1b
jmp 0x5397f4
mov al, byte [esi]
mov ecx, dword [sym.imp.VCRUNTIME140.dll_strchr]
cmp al, 0x5b
jne 0x539152
push 0x5d
push esi
call ecx
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x5391c2
lea eax, [esi + 1]
mov ecx, ebp
sub ecx, eax
push ecx
push eax
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
jmp 0x5391c2
cmp al, 0x3a
jne 0x53915a
mov ebp, esi
jmp 0x5391c8
push 0x3a
push esi
call ecx
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x5391af
lea eax, [esp + 0x3c]
push eax
push esi
push 0x17
call fcn.0052c9e0
add esp, 0xc
cmp eax, 1
jne 0x539199
mov ecx, dword [esp + 0x1c]
sub ecx, esi
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x539183
xor esi, esi
xor edx, edx
jmp 0x539222
mov eax, ebp
sub eax, esi
push eax
mov eax, dword [esp + 0x20]
push esi
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
add esp, 0xc
jmp 0x5391c2
mov ecx, dword [esp + 0x1c]
sub ecx, esi
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x5391b5
mov ecx, dword [sym.imp.VCRUNTIME140.dll_strchr]
xor esi, esi
xor edx, edx
test ebp, ebp
je 0x539222
push 0x3a
push ebp
call ecx
mov ebp, eax
add esp, 8
xor edx, edx
test ebp, ebp
je 0x539222
push 0xa
push edx
lea ecx, [ebp + 1]
push ecx
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtoul]
push eax
call fcn.005139b0
push 0x2d
push ebp
movzx esi, ax
call dword [sym.imp.VCRUNTIME140.dll_strchr]
add esp, 0x18
test eax, eax
je 0x539220
push 0xa
inc eax
push 0
push eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtoul]
push eax
call fcn.005139b0
add esp, 0x10
movzx edx, ax
jmp 0x539222
mov edx, esi
xor ecx, ecx
movzx eax, dx
cmp si, dx
cmovbe ecx, eax
movzx eax, cx
mov ecx, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ecx
xor ecx, ecx
cmp si, dx
movzx eax, si
mov esi, dword [esp + 0x1c]
cmovbe ecx, eax
movzx ebp, cx
cmp byte [esi], 0
je 0x5392cb
push 0x401
lea eax, [esp + 0x1c0]
push eax
mov eax, dword [edi + 0x4c]
push esi
push dword [edi + 0x88]
push dword [eax + 0x18]
call fcn.0053e650
add esp, 4
push eax
mov eax, dword [edi + 0x4c]
push dword [eax + 4]
call fcn.005097b0
add esp, 0x18
sub eax, 0
je 0x5392a2
sub eax, 1
je 0x5397ef
sub eax, 1
jne 0x5392aa
lea ecx, [esp + 0x1bc]
mov dword [esp + 0x24], ecx
jmp 0x5392ac
mov ecx, esi
mov dword [esp + 0x24], ecx
jmp 0x5392ac
xor ecx, ecx
mov eax, ebp
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x30]
movzx ebp, ax
mov dword [esp + 0x1c], ebp
test ecx, ecx
jne 0x539378
mov ebp, dword [esp + 0x18]
jmp 0x5392e4
mov eax, ebp
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x34]
movzx eax, ax
mov dword [esp + 0x1c], eax
jmp 0x5392e4
xor esi, esi
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0x80
push eax
lea eax, [esp + 0x40]
push eax
push dword [edi + 0x168]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x53932e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.0052ba10
push eax
push str.getsockname___failed:__s
push ebp
call fcn.00511c10
push esi
call dword [0x5b301c]
add esp, 0x18
jmp 0x5397ef
mov ax, word [esp + 0x3c]
push 0x401
cmp ax, 0x17
je 0x539351
lea ecx, [esp + 0x1c0]
movzx eax, ax
push ecx
lea ecx, [esp + 0x48]
push ecx
push eax
jmp 0x539360
lea eax, [esp + 0x1c0]
push eax
lea eax, [esp + 0x4c]
push eax
push 0x17
call fcn.0052d230
lea ecx, [esp + 0x1cc]
mov byte [esp + 0x23], 0
add esp, 0x10
mov dword [esp + 0x24], ecx
lea eax, [esp + 0x2c]
push eax
push 0
push ecx
push edi
call fcn.00515f60
add esp, 0x10
cmp eax, 1
jne 0x53939c
lea eax, [esp + 0x2c]
push eax
push edi
call fcn.005155d0
add esp, 8
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x5397d2
mov ebp, dword [eax]
push eax
push dword [esp + 0x1c]
call fcn.005160f0
add esp, 8
test ebp, ebp
je 0x5397d2
push esi
call dword [0x5b301c]
add esp, 4
mov dword [esp + 0x14], 0xffffffff
xor esi, esi
lea eax, [esp + 0x14]
push eax
push 0
push ebp
push edi
call fcn.0051e510
add esp, 0x10
mov dword [esp + 0x24], eax
test eax, eax
je 0x5393fd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, dword [ebp + 0x1c]
mov esi, eax
test ebp, ebp
jne 0x5393d3
jmp 0x539401
test ebp, ebp
jne 0x53941f
push esi
push edi
call fcn.0052ba10
push eax
push str.socket_failure:__s
push dword [esp + 0x28]
call fcn.00511c10
add esp, 0x14
jmp 0x5397ef
push dword [ebp + 0x10]
lea eax, [esp + 0x40]
push dword [ebp + 0x18]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x28]
cmp ax, word [esp + 0x1c]
movzx esi, ax
ja 0x5397b8
mov eax, dword [sym.imp.WS2_32.dll_htons]
push esi
call eax
push dword [esp + 0x20]
mov word [esp + 0x42], ax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x53954b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp byte [esp + 0x13], 0
je 0x5394dd
cmp eax, 0x2741
jne 0x5394dd
push eax
push edi
call fcn.0052ba10
push eax
movzx eax, si
mov esi, dword [esp + 0x24]
push eax
push str.bind_port_hu__on_non_local_address_failed:__s_n
push esi
call fcn.00511ce0
add esp, 0x18
mov dword [esp + 0x20], 0x80
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x40]
push eax
push dword [edi + 0x168]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x5394f4
mov eax, dword [esp + 0x28]
movzx esi, ax
cmp si, word [esp + 0x1c]
mov byte [esp + 0x13], 0
jmp 0x539445
cmp eax, 0x2740
je 0x5394e9
cmp eax, 0xd
jne 0x53951f
inc esi
cmp si, word [esp + 0x1c]
jmp 0x539445
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.0052ba10
push eax
push str.getsockname___failed:__s
push esi
call fcn.00511c10
push dword [esp + 0x28]
push edi
call fcn.0051dcd0
add esp, 0x1c
jmp 0x5397ef
push eax
push edi
call fcn.0052ba10
push eax
movzx eax, si
push eax
push str.bind_port_hu__failed:__s
push dword [esp + 0x2c]
call fcn.00511c10
push dword [esp + 0x2c]
push edi
call fcn.0051dcd0
add esp, 0x20
jmp 0x5397ef
cmp si, word [esp + 0x1c]
ja 0x5397b8
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0x80
push eax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x539592
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.0052ba10
push eax
push str.getsockname___failed:__s
push dword [esp + 0x28]
jmp 0x539508
push 1
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x5395be
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.0052ba10
push eax
push str.socket_failure:__s
push dword [esp + 0x28]
jmp 0x539508
push 0x100
lea eax, [esp + 0xc0]
push eax
push ebp
call fcn.00515f10
add esp, 0xc
cmp byte [edi + 0x22c], 0
jne 0x5395ed
cmp byte [edi + 0x222], 0
je 0x5395ed
mov byte [edi + 0x22c], 1
cmp ebx, 2
je 0x539646
mov esi, dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esp + 0x3c]
nop dword [eax]
cmp byte [edi + 0x22c], 0
jne 0x53960d
test ebx, ebx
je 0x539640
cmp ebx, 1
jne 0x539618
cmp cx, 2
jne 0x539640
movzx eax, cx
sub eax, 2
je 0x539625
sub eax, 0x15
jne 0x539640
push dword [esp + 0x3e]
call esi
movzx ebp, ax
test ebx, ebx
je 0x539745
cmp ebx, 1
je 0x53969e
mov cx, word [esp + 0x3c]
inc ebx
cmp ebx, 2
jne 0x539600
mov ebp, dword [esp + 0x24]
lea esi, [edi + 0x478]
mov dword [esi + 0x5c], ebx
mov eax, dword [edi + 0x16c]
cmp eax, 0xffffffff
je 0x539672
push eax
push edi
call fcn.0051dcd0
add esp, 8
mov dword [edi + 0x16c], 0xffffffff
mov eax, dword [esp + 0x14]
mov dword [edi + 0x16c], eax
mov eax, ebp
mov dword [edi + 0x528], 0
mov byte [edi + 0x225], 1
mov dword [edi + 0x4e0], 0x1c
jmp 0x5397f4
lea edx, [esp + 0x5c0]
mov edi, 0x2c
lea esi, [esp + 0xbc]
mov cl, byte [esi]
test cl, cl
je 0x5396c8
cmp cl, 0x2e
movzx eax, cl
cmove eax, edi
mov byte [edx], al
inc edx
add esi, 1
jne 0x5396b1
movzx ecx, bp
movzx eax, cl
push eax
shr ecx, 8
push ecx
push str.__d__d
push 0x14
push edx
mov byte [edx], 0
call fcn.00512660
mov edi, dword [esp + 0x4c]
lea eax, [esp + 0x5d4]
push eax
push str.PORT
push str._s__s
lea esi, [edi + 0x478]
push esi
call fcn.00541bd0
mov ebp, eax
add esp, 0x24
test ebp, ebp
je 0x539650
push ebp
call fcn.0052baf0
push eax
push str.Failure_sending_PORT_command:__s
push dword [esp + 0x24]
call fcn.00511c10
push dword [esp + 0x24]
push edi
call fcn.0051dcd0
add esp, 0x18
mov dword [edi + 0x4e0], 0
mov eax, ebp
jmp 0x5397f4
movzx eax, bp
lea esi, [edi + 0x478]
push eax
lea eax, [esp + 0xc0]
push eax
xor eax, eax
cmp word [esp + 0x44], 2
setne al
inc eax
push eax
push str.EPRT
push str._s__d_s_hu
push esi
call fcn.00541bd0
mov ebp, eax
add esp, 0x18
test ebp, ebp
je 0x539650
push ebp
call fcn.0052baf0
push eax
push str.Failure_sending_EPRT_command:__s
push dword [esp + 0x24]
call fcn.00511c10
push dword [esp + 0x24]
push edi
call fcn.0051dcd0
mov dword [esi + 0x5c], 1
add esp, 0x18
mov dword [edi + 0x4e0], 0
mov eax, ebp
jmp 0x5397f4
push str.bind___failed__we_ran_out_of_ports_
push dword [esp + 0x1c]
call fcn.00511c10
push dword [esp + 0x1c]
push edi
call fcn.0051dcd0
jmp 0x5397ec
mov eax, dword [esp + 0x24]
push eax
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push dword [esp + 0x20]
call fcn.00511c10
push esi
call dword [0x5b301c]
add esp, 0x10
mov eax, 0x1e
mov ecx, dword [esp + 0x9c0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00547055
add esp, 0x9b4
ret