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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9ac
mov eax, dword [0x52e030]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [esi]
push edi
push 0xff
lea ecx, [ebp - 0x103]
push 0
push ecx
mov dword [ebp - 0x9a4], eax
mov dword [ebp - 0x994], ebx
mov dword [ebp - 0x98c], 0xffffffff
mov byte [ebp - 0x104], 0
call sub.MSVCR100.dll_memset
mov edi, dword [ebx + 0x364]
xor ecx, ecx
mov dword [ebp - 0x9a8], ecx
mov eax, dword [ebx + 0x364]
add esp, 0xc
mov dword [ebp - 0x99c], ecx
mov dword [ebp - 0x9a0], ecx
mov dword [ebp - 0x9ac], 1
mov dword [ebp - 0x990], ecx
cmp eax, ecx
je 0x4c5b81
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c59f8
sub eax, edx
cmp eax, 1
jbe 0x4c5b81
mov eax, edi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c5a10
sub eax, edx
cmp eax, 0x16
jae 0x4c5a25
mov eax, 0x16
jmp 0x4c5a39
mov eax, edi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c5a30
sub eax, edx
inc eax
push 1
push eax
call dword [0x52fd98]
add esp, 8
mov dword [ebp - 0x990], eax
test eax, eax
jne 0x4c5a65
pop edi
mov eax, 0x1b
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
cmp byte [edi], 0x3a
jne 0x4c5b25
mov ebx, edi
test ebx, ebx
je 0x4c5ae9
push 0x3a
push ebx
call dword [sym.imp.MSVCR100.dll_strchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x4c5ae9
mov ebx, dword [sym.imp.MSVCR100.dll_strtoul]
push 0xa
lea ecx, [edi + 1]
push 0
push ecx
call ebx
push eax
call fcn.004abee0
movzx edx, ax
push 0x2d
push edi
mov dword [ebp - 0x99c], edx
call dword [sym.imp.MSVCR100.dll_strchr]
add esp, 0x18
test eax, eax
je 0x4c5b6f
push 0xa
xor edi, edi
inc eax
push edi
push eax
call ebx
push eax
call fcn.004abee0
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x9a0], eax
cmp word [ebp - 0x99c], ax
jbe 0x4c5ae9
mov dword [ebp - 0x9a0], edi
mov dword [ebp - 0x99c], edi
mov ecx, dword [ebp - 0x990]
cmp byte [ecx], 0
je 0x4c5b81
mov eax, dword [esi + 0x3c]
push 0x401
lea edx, [ebp - 0x508]
push edx
mov ebx, ecx
mov ecx, dword [eax + 4]
push ebx
push ecx
call fcn.004d27f0
add esp, 0x10
test eax, eax
jne 0x4c5c28
mov edi, ebx
jmp 0x4c5c2e
push 0x3a
push edi
call dword [sym.imp.MSVCR100.dll_strchr]
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4c5b52
mov eax, dword [ebp - 0x990]
mov edx, ebx
sub edx, edi
push edx
push edi
push eax
call dword [sym.imp.MSVCR100.dll_strncpy]
add esp, 0xc
jmp 0x4c5a70
mov edx, dword [ebp - 0x990]
mov eax, edi
sub edx, edi
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4c5b60
jmp 0x4c5ae9
movzx eax, word [ebp - 0x99c]
mov dword [ebp - 0x9a0], eax
jmp 0x4c5ae9
mov ecx, dword [esi + 0x130]
lea edx, [ebp - 0x998]
push edx
lea eax, [ebp - 0x988]
push eax
push ecx
mov dword [ebp - 0x998], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x4c5bf5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004b9360
mov edx, dword [ebp - 0x994]
push eax
push str.getsockname___failed:__s
push edx
call fcn.004b6c40
mov eax, dword [ebp - 0x990]
add esp, 0x14
test eax, eax
je 0x4c5be0
push eax
call dword [0x52fd8c]
add esp, 4
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
movzx edx, word [ebp - 0x988]
push 0x401
lea eax, [ebp - 0x508]
push eax
lea ecx, [ebp - 0x984]
push ecx
push edx
call fcn.004bbf70
mov ebx, dword [ebp - 0x990]
add esp, 0x10
mov dword [ebp - 0x9ac], 0
lea edi, [ebp - 0x508]
lea eax, [ebp - 0x9a8]
push eax
push 0
push edi
push esi
call fcn.004ac970
add esp, 0x10
cmp eax, 1
jne 0x4c5c56
lea ecx, [ebp - 0x9a8]
push ecx
push esi
call fcn.004ac340
add esp, 8
mov eax, dword [ebp - 0x9a8]
test eax, eax
je 0x4c5c7c
mov edx, dword [ebp - 0x994]
mov ebx, dword [eax]
push eax
push edx
call fcn.004acb40
add esp, 8
test ebx, ebx
jne 0x4c5cb8
mov ebx, dword [ebp - 0x990]
mov eax, dword [ebp - 0x994]
push edi
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push eax
call fcn.004b6c40
add esp, 0xc
test ebx, ebx
je 0x4c5be0
push ebx
call dword [0x52fd8c]
add esp, 4
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x990]
test eax, eax
je 0x4c5ccc
push eax
call dword [0x52fd8c]
add esp, 4
mov dword [ebp - 0x98c], 0xffffffff
xor edi, edi
jmp 0x4c5ce0
lea ecx, [ebp - 0x98c]
push ecx
push 0
push ebx
push esi
call fcn.004b7a60
add esp, 0x10
mov dword [ebp - 0x990], eax
test eax, eax
je 0x4c5d0e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [ebx + 0x1c]
mov edi, eax
test ebx, ebx
jne 0x4c5ce0
jmp 0x4c5d12
test ebx, ebx
jne 0x4c5d43
push edi
push esi
call fcn.004b9360
mov edx, dword [ebp - 0x994]
push eax
push str.socket_failure:__s
push edx
call fcn.004b6c40
add esp, 0x14
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x10]
mov ecx, dword [ebx + 0x18]
push eax
push ecx
lea edx, [ebp - 0x988]
push edx
call sub.MSVCR100.dll_memcpy
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x998], eax
mov eax, dword [ebp - 0x99c]
add esp, 0xc
movzx edi, ax
cmp ax, word [ebp - 0x9a0]
ja 0x4c5ed7
lea esp, [esp]
cmp word [ebp - 0x988], 2
jne 0x4c5d98
push edi
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x986], ax
mov ecx, dword [ebp - 0x998]
mov eax, dword [ebp - 0x98c]
push ecx
lea edx, [ebp - 0x988]
push edx
push eax
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x4c5ece
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp - 0x9ac], 0
je 0x4c5e29
cmp eax, 0x2741
jne 0x4c5e29
push eax
push esi
call fcn.004b9360
mov edx, dword [ebp - 0x994]
push eax
movzx ecx, di
push ecx
push str.bind_port_hu__on_non_local_address_failed:__s_n
push edx
call fcn.004b6bc0
mov edx, dword [esi + 0x130]
add esp, 0x18
lea eax, [ebp - 0x998]
push eax
lea ecx, [ebp - 0x988]
push ecx
push edx
mov dword [ebp - 0x998], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4c5e48
movzx edi, word [ebp - 0x99c]
mov dword [ebp - 0x9ac], eax
jmp 0x4c5e36
cmp eax, 0x2740
je 0x4c5e35
cmp eax, 0xd
jne 0x4c5e8c
inc edi
cmp di, word [ebp - 0x9a0]
jbe 0x4c5d80
jmp 0x4c5ed7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004b9360
push eax
mov eax, dword [ebp - 0x994]
push str.getsockname___failed:__s
push eax
call fcn.004b6c40
mov ecx, dword [ebp - 0x98c]
push ecx
push esi
call fcn.004b7a10
add esp, 0x1c
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
push eax
push esi
call fcn.004b9360
push eax
mov eax, dword [ebp - 0x994]
movzx edx, di
push edx
push str.bind_port_hu__failed:__s
push eax
call fcn.004b6c40
mov ecx, dword [ebp - 0x98c]
push ecx
push esi
call fcn.004b7a10
add esp, 0x20
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
cmp di, word [ebp - 0x9a0]
jbe 0x4c5f0d
mov edx, dword [ebp - 0x994]
push str.bind___failed__we_ran_out_of_ports_
push edx
call fcn.004b6c40
mov eax, dword [ebp - 0x98c]
push eax
push esi
call fcn.004b7a10
add esp, 0x10
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x98c]
lea ecx, [ebp - 0x998]
push ecx
lea edx, [ebp - 0x988]
push edx
push eax
mov dword [ebp - 0x998], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x4c5f7a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004b9360
push eax
push str.getsockname___failed:__s
mov ecx, dword [ebp - 0x994]
push ecx
call fcn.004b6c40
mov edx, dword [ebp - 0x98c]
push edx
push esi
call fcn.004b7a10
add esp, 0x1c
pop edi
mov eax, 0x1e
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00475360
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x98c]
push 1
push eax
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x4c5fa2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push esi
call fcn.004b9360
push eax
push str.socket_failure:__s
jmp 0x4c5f49
push 0x100
lea eax, [ebp - 0x104]
push eax
push ebx
call fcn.004ac6b0
mov edi, dword [ebp - 0x9a4]
add esp, 0xc
cmp edi, 2
je 0x4c601a
mov cx, word [ebp - 0x988]
lea esp, [esp]
cmp dword [esi + 0x1e4], 0
jne 0x4c5fdd
test edi, edi
je 0x4c6014
cmp edi, 1
jne 0x4c5fe8
cmp cx, 2
jne 0x4c6014
movzx eax, cx
sub eax, 2
jne 0x4c6014
mov ecx, dword [ebp - 0x986]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ebx, ax
test edi, edi
je 0x4c6025
cmp edi, 1
je 0x4c609b
mov cx, word [ebp - 0x988]
inc edi
cmp edi, 2
jne 0x4c5fd0
mov ebx, dword [ebp - 0x990]
jmp 0x4c6133
xor ecx, ecx
cmp word [ebp - 0x988], 2
push ebx
setne cl
lea eax, [ebp - 0x104]
push eax
mov dword [ebp - 0x9a4], edi
lea edi, [esi + 0x3d0]
inc ecx
push ecx
push str.EPRT
push str._s__d_s_hu
push edi
call fcn.004d2f40
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x4c612d
push ebx
call fcn.004b8890
mov edx, dword [ebp - 0x994]
push eax
push str.Failure_sending_EPRT_command:__s
push edx
call fcn.004b6c40
mov eax, dword [ebp - 0x98c]
push eax
push esi
call fcn.004b7a10
add esp, 0x18
mov dword [edi + 0x68], 1
xor eax, eax
jmp 0x4c6169
lea ecx, [ebp - 0x908]
lea edx, [ebp - 0x104]
mov al, byte [edx]
test al, al
je 0x4c60bc
cmp al, 0x2e
jne 0x4c60b6
mov byte [ecx], 0x2c
jmp 0x4c60b8
mov byte [ecx], al
inc ecx
inc edx
jne 0x4c60a7
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.004ab180
lea eax, [ebp - 0x908]
push eax
push str.PORT
lea eax, [esi + 0x3d0]
push 0x4f56f4
push eax
call fcn.004d2f40
mov ebx, eax
add esp, 0x24
test ebx, ebx
je 0x4c6133
push ebx
call fcn.004b8890
mov ecx, dword [ebp - 0x994]
push eax
push str.Failure_sending_PORT_command:__s
push ecx
call fcn.004b6c40
mov edx, dword [ebp - 0x98c]
push edx
push esi
call fcn.004b7a10
add esp, 0x18
xor eax, eax
jmp 0x4c6169
mov edi, dword [ebp - 0x9a4]
mov dword [esi + 0x438], edi
mov eax, dword [esi + 0x134]
cmp eax, 0xffffffff
je 0x4c614e
push eax
push esi
call fcn.004b7a10
add esp, 8
mov eax, dword [ebp - 0x98c]
mov dword [esi + 0x134], eax
mov dword [esi + 0x1c8], 1
mov eax, 0x1c
mov ecx, esi
call fcn.004c5860
mov ecx, dword [ebp - 4]
pop edi
mov eax, ebx
xor ecx, ebp
pop ebx
call fcn.00475360
mov esp, ebp
pop ebp
ret