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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x9b4
mov eax, dword [0x5c31c8]
xor eax, esp
mov dword [esp + 0x9b0], eax
push ebx
push esi
push edi
mov esi, ecx
mov dword [esp + 0x28], edx
push 0xff
lea eax, [esp + 0xb5]
mov byte [esp + 0xb4], 0
push 0
mov ebx, dword [esi]
push eax
mov dword [esp + 0x18], ebx
call sub.MSVCR120.dll_memset
mov ebx, dword [ebx + 0x364]
xor eax, eax
add esp, 0xc
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], eax
mov edi, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x2c], 1
test ebx, ebx
je 0x522dd7
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x522cc6
sub ecx, edx
cmp ecx, 1
jbe 0x522dd7
mov edx, ebx
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x522cdd
sub edx, ecx
push 0x16
pop ecx
cmp edx, ecx
jb 0x522cfb
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x522cf2
sub ecx, edx
lea eax, [ecx + 1]
push 1
push eax
call dword [0x5c6c48]
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x522d16
push 0x1b
jmp 0x523272
cmp byte [ebx], 0x3a
jne 0x522d1f
mov ecx, ebx
jmp 0x522d56
push 0x3a
push ebx
call dword [sym.imp.MSVCR120.dll_strchr]
pop ecx
pop ecx
mov ecx, eax
mov dword [esp + 0x20], ecx
test ecx, ecx
je 0x522d48
sub ecx, ebx
push ecx
push ebx
push edi
call dword [sym.imp.MSVCR120.dll_strncpy]
mov ecx, dword [esp + 0x2c]
add esp, 0xc
jmp 0x522d56
mov edx, edi
sub edx, ebx
mov al, byte [ebx]
mov byte [edx + ebx], al
inc ebx
test al, al
jne 0x522d4c
test ecx, ecx
je 0x522dc4
push 0x3a
push ecx
call dword [sym.imp.MSVCR120.dll_strchr]
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x522dc4
push 0xa
lea ecx, [ebx + 1]
push 0
push ecx
call dword [sym.imp.MSVCR120.dll_strtoul]
add esp, 0xc
movzx eax, ax
mov dword [esp + 0x24], eax
push 0x2d
push ebx
call dword [sym.imp.MSVCR120.dll_strchr]
pop ecx
pop ecx
test eax, eax
je 0x522daa
push 0xa
inc eax
push 0
push eax
call dword [sym.imp.MSVCR120.dll_strtoul]
movzx ecx, ax
add esp, 0xc
mov eax, dword [esp + 0x24]
jmp 0x522db1
mov eax, dword [esp + 0x24]
movzx ecx, ax
mov dword [esp + 0x1c], ecx
cmp ax, cx
jbe 0x522dc4
and dword [esp + 0x1c], 0
and dword [esp + 0x24], 0
xor eax, eax
cmp byte [edi], al
cmovne eax, edi
mov dword [esp + 0x14], eax
test eax, eax
jne 0x522e5c
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0x80
push eax
lea eax, [esp + 0x34]
push eax
push dword [esi + 0x130]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x522e2f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, esi
call fcn.0052922c
push eax
push str.getsockname___failed:__s
push dword [esp + 0x14]
call fcn.00510cc2
add esp, 0xc
test edi, edi
je 0x523270
push edi
call dword [0x5c6c40]
pop ecx
jmp 0x523270
movzx ecx, word [esp + 0x30]
lea eax, [esp + 0x5b0]
push 0x401
push eax
lea edx, [esp + 0x3c]
call fcn.00528b46
and dword [esp + 0x34], 0
lea eax, [esp + 0x5b8]
pop ecx
pop ecx
mov dword [esp + 0x14], eax
lea ecx, [esp + 0x10]
mov edx, eax
push ecx
push 0
mov ecx, esi
call fcn.005102fc
pop ecx
pop ecx
cmp eax, 1
jne 0x522e7e
lea edx, [esp + 0x10]
mov ecx, esi
call fcn.005109d5
mov edx, dword [esp + 0x10]
test edx, edx
je 0x522e93
mov ecx, dword [esp + 0xc]
mov ebx, dword [edx]
call fcn.0051045b
jmp 0x522e95
xor ebx, ebx
test ebx, ebx
jne 0x522ea7
push dword [esp + 0x14]
push str.failed_to_resolve_the_address_provided_to_PORT:__s
jmp 0x522e0e
test edi, edi
je 0x522eb3
push edi
call dword [0x5c6c40]
pop ecx
or dword [esp + 0x14], 0xffffffff
xor edi, edi
lea eax, [esp + 0x14]
mov edx, ebx
push eax
push 0
mov ecx, esi
call fcn.0051000c
mov dword [esp + 0x28], eax
pop ecx
pop ecx
test eax, eax
je 0x522ee3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [ebx + 0x1c]
mov edi, eax
test ebx, ebx
jne 0x522eba
test ebx, ebx
jne 0x522f07
mov edx, edi
mov ecx, esi
call fcn.0052922c
push eax
push str.socket_failure:__s
push dword [esp + 0x14]
call fcn.00510cc2
add esp, 0xc
jmp 0x523270
push dword [ebx + 0x10]
lea eax, [esp + 0x34]
push dword [ebx + 0x18]
push eax
call sub.MSVCR120.dll_memcpy
mov eax, dword [ebx + 0x10]
add esp, 0xc
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
cmp dx, cx
mov edi, dword [esp + 0x14]
mov dword [esp + 0x18], eax
movzx eax, dx
mov dword [esp + 0x10], eax
ja 0x523257
push 2
pop ecx
cmp word [esp + 0x30], cx
jne 0x522f53
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x32], ax
push dword [esp + 0x18]
lea eax, [esp + 0x34]
push eax
push edi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x52303f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [esp + 0x2c], 0
je 0x522fd4
mov ecx, 0x2741
cmp eax, ecx
jne 0x522fd4
mov edx, ecx
mov ecx, esi
call fcn.0052922c
push eax
mov eax, dword [esp + 0x14]
movzx eax, ax
push eax
push str.bind_port_hu__on_non_local_address_failed:__s_n
push dword [esp + 0x18]
call fcn.00510c4e
add esp, 0x10
mov dword [esp + 0x18], 0x80
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x34]
push eax
push dword [esi + 0x130]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x522ff1
mov eax, dword [esp + 0x24]
and dword [esp + 0x2c], 0
movzx eax, ax
jmp 0x522fe5
cmp eax, 0x2740
je 0x522fe0
cmp eax, 0xd
jne 0x523017
mov eax, dword [esp + 0x10]
inc eax
mov ecx, dword [esp + 0x1c]
cmp ax, cx
jmp 0x522f33
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, esi
call fcn.0052922c
push eax
push str.getsockname___failed:__s
push dword [esp + 0x14]
call fcn.00510cc2
add esp, 0xc
jmp 0x523267
mov edx, eax
mov ecx, esi
call fcn.0052922c
push eax
mov eax, dword [esp + 0x14]
movzx eax, ax
push eax
push str.bind_port_hu__failed:__s
push dword [esp + 0x18]
call fcn.00510cc2
add esp, 0x10
jmp 0x523267
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
cmp ax, cx
ja 0x523257
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0x80
push eax
lea eax, [esp + 0x34]
push eax
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x522ff1
push 1
push edi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x523094
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, esi
call fcn.0052922c
push eax
push str.socket_failure:__s
jmp 0x523006
push 0x100
lea edx, [esp + 0xb4]
mov ecx, ebx
call fcn.005100b7
mov ebx, dword [esp + 0x2c]
pop ecx
push 2
pop edx
cmp ebx, edx
je 0x523105
mov cx, word [esp + 0x30]
cmp dword [esi + 0x208], 0
jne 0x5230c5
test ebx, ebx
je 0x5230fc
cmp ebx, 1
jne 0x5230cf
cmp cx, dx
jne 0x5230fc
movzx eax, cx
sub eax, edx
jne 0x5230fc
push dword [esp + 0x32]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x5231e2
cmp ebx, 1
je 0x523144
mov cx, word [esp + 0x30]
push 2
pop edx
inc ebx
mov dword [esp + 0x28], ebx
cmp ebx, edx
jne 0x5230b8
mov ebx, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
mov dword [esi + 0x460], edx
mov edx, dword [esi + 0x134]
cmp edx, 0xffffffff
je 0x523125
mov ecx, esi
call fcn.0050ffd8
mov dword [esi + 0x134], edi
mov dword [esi + 0x1ec], 1
mov dword [esi + 0x46c], 0x1c
jmp 0x523253
lea edx, [esp + 0x1b0]
lea ebx, [esp + 0xb0]
mov cl, byte [ebx]
test cl, cl
je 0x523171
cmp cl, 0x2e
movzx eax, cl
mov dword [esp + 0x20], 0x2c
cmove eax, dword [esp + 0x20]
mov byte [edx], al
inc edx
inc ebx
jne 0x523152
mov eax, dword [esp + 0x14]
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.0051b484
add esp, 0x14
lea eax, [esp + 0x1b0]
push eax
push str.PORT
lea eax, [esi + 0x3f8]
push str._s__s
push eax
call fcn.0052e31c
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x523109
mov ecx, ebx
call fcn.00528b6e
push eax
push str.Failure_sending_PORT_command:__s
push dword [esp + 0x14]
call fcn.00510cc2
add esp, 0xc
mov edx, edi
mov ecx, esi
call fcn.0050ffd8
jmp 0x52324c
movzx eax, ax
push eax
lea eax, [esp + 0xb4]
push eax
push 2
pop ecx
xor eax, eax
cmp word [esp + 0x38], cx
setne al
inc eax
push eax
push str.EPRT
lea eax, [esi + 0x3f8]
push str._s__d_s_hu
push eax
call fcn.0052e31c
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x523109
mov ecx, ebx
call fcn.00528b6e
push eax
push str.Failure_sending_EPRT_command:__s
push dword [esp + 0x14]
call fcn.00510cc2
add esp, 0xc
mov edx, edi
mov ecx, esi
call fcn.0050ffd8
mov dword [esi + 0x460], 1
and dword [esi + 0x46c], 0
mov eax, ebx
jmp 0x523273
push str.bind___failed__we_ran_out_of_ports_
push dword [esp + 0x10]
call fcn.00510cc2
pop ecx
pop ecx
mov edx, edi
mov ecx, esi
call fcn.0050ffd8
push 0x1e
pop eax
mov ecx, dword [esp + 0x9bc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0055daac
mov esp, ebp
pop ebp
ret