Function at 0x47fa40
Capabilities:
Convert ip address from string
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x4dbfb4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov edi, dword [ebx]
push 0x2e
lea eax, [ebp - 0x33]
push 0
push eax
mov dword [ebp - 0x608], edi
mov dword [ebp - 0x600], 0xffffffff
mov byte [ebp - 0x34], 0
call fcn.0049e6e0
mov esi, dword [edi + 0x9cc]
xor ecx, ecx
mov dword [ebp - 0x618], ecx
mov eax, dword [edi + 0x9cc]
add esp, 0xc
mov dword [ebp - 0x614], ecx
mov dword [ebp - 0x610], ecx
mov dword [ebp - 0x61c], 1
mov dword [ebp - 0x604], ecx
cmp eax, ecx
je 0x47fc36
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x47fab6
sub eax, edx
cmp eax, 1
jbe 0x47fc36
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x47fad0
sub eax, edx
cmp eax, 0x41
jae 0x47fae5
mov eax, 0x41
jmp 0x47faf9
mov eax, esi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x47faf0
sub eax, edx
inc eax
push 1
push eax
call dword [0x4db934]
add esp, 8
mov dword [ebp - 0x604], eax
test eax, eax
jne 0x47fb25
pop edi
mov eax, 0x1b
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov al, byte [esi]
cmp al, 0x5b
jne 0x47fcb2
lea ecx, [esi + 1]
push 0x5d
push esi
mov dword [ebp - 0x620], ecx
call fcn.004a1bd0
mov edi, eax
add esp, 8
test edi, edi
je 0x47fbdb
mov eax, dword [ebp - 0x620]
mov edx, edi
sub edx, eax
push edx
push eax
mov eax, dword [ebp - 0x604]
push eax
call fcn.004a0810
add esp, 0xc
test edi, edi
je 0x47fbdb
push 0x3a
push edi
call fcn.004a1bd0
mov esi, eax
add esp, 8
test esi, esi
je 0x47fbdb
push 0xa
lea ecx, [esi + 1]
push 0
push ecx
call fcn.004a1b8e
push eax
call fcn.0046d4c0
movzx edi, ax
push 0x2d
push esi
mov dword [ebp - 0x614], edi
call fcn.004a1bd0
xor esi, esi
add esp, 0x18
cmp eax, esi
je 0x47fd33
push 0xa
inc eax
push esi
push eax
call fcn.004a1b8e
push eax
call fcn.0046d4c0
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x610], eax
cmp di, ax
jbe 0x47fbdb
mov dword [ebp - 0x610], esi
mov dword [ebp - 0x614], esi
mov edi, dword [ebp - 0x604]
cmp byte [edi], 0
je 0x47fc36
mov ecx, dword [ebx + 0x2f4]
mov edx, dword [ebx + 0x2b8]
push 0x401
lea eax, [ebp - 0x57c]
push eax
mov eax, dword [edx + 0x18]
push edi
push ecx
push eax
call fcn.00495030
mov ecx, dword [ebx + 0x2b8]
mov edx, dword [ecx + 4]
add esp, 4
push eax
push edx
call fcn.004950d0
add esp, 0x18
sub eax, 0
je 0x47fd41
sub eax, 1
je 0x47fc9d
sub eax, 1
je 0x47fd8f
mov edx, dword [ebx + 0x420]
lea eax, [ebp - 0x60c]
push eax
lea ecx, [ebp - 0x5fc]
push ecx
push edx
mov dword [ebp - 0x60c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x47fd45
push pe_nt_image_headers32
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00492ff0
mov ecx, dword [ebp - 0x608]
push eax
push str.getsockname___failed:__s
push ecx
call fcn.0046af40
mov edx, dword [ebp - 0x604]
push edx
call dword [0x4db928]
add esp, 0x1c
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
cmp al, 0x3a
jne 0x47fcbd
mov edi, esi
jmp 0x47fb68
push 0x3a
push esi
call fcn.004a1bd0
mov edi, eax
add esp, 8
test edi, edi
je 0x47fd1a
lea ecx, [ebp - 0x5fc]
push ecx
push esi
push 0x17
call dword [sym.imp.WS2_32.dll_inet_pton]
cmp eax, 1
jne 0x47fd0f
mov edx, dword [ebp - 0x604]
xor eax, eax
mov dword [ebp - 0x610], eax
mov dword [ebp - 0x614], eax
mov eax, esi
sub edx, esi
jmp 0x47fd00
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x47fd00
jmp 0x47fbdb
mov edx, edi
sub edx, esi
push edx
push esi
jmp 0x47fb59
mov edx, dword [ebp - 0x604]
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x47fd24
jmp 0x47fbdb
movzx edx, di
mov dword [ebp - 0x610], edx
jmp 0x47fbdb
mov esi, edi
jmp 0x47fd95
movzx eax, word [ebp - 0x5fc]
push 0x401
cmp eax, 0x17
je 0x47fd67
lea ecx, [ebp - 0x57c]
push ecx
lea edx, [ebp - 0x5f8]
push edx
push eax
jmp 0x47fd77
lea eax, [ebp - 0x57c]
push eax
lea ecx, [ebp - 0x5f4]
push ecx
push 0x17
call fcn.00495470
mov edi, dword [ebp - 0x604]
add esp, 0x10
mov dword [ebp - 0x61c], 0
lea esi, [ebp - 0x57c]
lea edx, [ebp - 0x618]
push edx
push 0
push 0
push esi
push ebx
call fcn.0048c390
add esp, 0x14
cmp eax, 1
jne 0x47fdbf
lea eax, [ebp - 0x618]
push eax
push ebx
call fcn.00462cf0
add esp, 8
mov eax, dword [ebp - 0x618]
test eax, eax
je 0x47fde5
mov ecx, dword [ebp - 0x608]
mov edi, dword [eax]
push eax
push ecx
call fcn.0048c610
add esp, 8
test edi, edi
jne 0x47fe16
mov edi, dword [ebp - 0x604]
mov edx, dword [ebp - 0x608]
push esi
push str.failed_to_resolve_the_address_provided_to_PORT:__s
push edx
call fcn.0046af40
push edi
call dword [0x4db928]
add esp, 0x10
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x604]
push eax
call dword [0x4db928]
add esp, 4
mov dword [ebp - 0x600], 0xffffffff
xor esi, esi
lea ecx, [ebp - 0x600]
push ecx
push 0
push edi
push ebx
call fcn.004703b0
add esp, 0x10
mov dword [ebp - 0x604], eax
test eax, eax
je 0x47fe60
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [edi + 0x1c]
mov esi, eax
test edi, edi
jne 0x47fe32
jmp 0x47fe64
test edi, edi
jne 0x47fea0
push pe_nt_image_headers32
lea edx, [ebp - 0x178]
push edx
push esi
call fcn.00492ff0
push eax
mov eax, dword [ebp - 0x608]
push str.socket_failure:__s
push eax
call fcn.0046af40
add esp, 0x18
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0x18]
push ecx
push edx
lea eax, [ebp - 0x5fc]
push eax
call fcn.0049f840
mov dx, word [ebp - 0x610]
mov ecx, dword [edi + 0x10]
movzx esi, word [ebp - 0x614]
add esp, 0xc
mov dword [ebp - 0x60c], ecx
cmp word [ebp - 0x614], dx
ja 0x480052
jmp 0x47fee0
push esi
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp - 0x600]
mov word [ebp - 0x5fa], ax
mov eax, dword [ebp - 0x60c]
push eax
lea ecx, [ebp - 0x5fc]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x480049
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp - 0x61c], 0
je 0x47ff8e
cmp eax, 0x2741
jne 0x47ff8e
push pe_nt_image_headers32
lea eax, [ebp - 0x178]
push eax
push 0x2741
call fcn.00492ff0
mov edx, dword [ebp - 0x608]
push eax
movzx ecx, si
push ecx
push str.bind_port_hu__on_non_local_address_failed:__s_n
push edx
call fcn.0046ae20
mov edx, dword [ebx + 0x420]
add esp, 0x1c
lea eax, [ebp - 0x60c]
push eax
lea ecx, [ebp - 0x5fc]
push ecx
push edx
mov dword [ebp - 0x60c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x47ffad
movzx esi, word [ebp - 0x614]
mov dword [ebp - 0x61c], eax
jmp 0x47ff9b
cmp eax, 0x2740
je 0x47ff9a
cmp eax, 0xd
jne 0x47fffc
inc esi
cmp si, word [ebp - 0x610]
jbe 0x47fee0
jmp 0x480052
push pe_nt_image_headers32
lea eax, [ebp - 0x178]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00492ff0
mov ecx, dword [ebp - 0x608]
push eax
push str.getsockname___failed:__s
push ecx
call fcn.0046af40
mov edx, dword [ebp - 0x600]
push edx
push ebx
call fcn.00470320
add esp, 0x20
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
push pe_nt_image_headers32
lea ecx, [ebp - 0x178]
push ecx
push eax
call fcn.00492ff0
push eax
mov eax, dword [ebp - 0x608]
movzx edx, si
push edx
push str.bind_port_hu__failed:__s
push eax
call fcn.0046af40
mov ecx, dword [ebp - 0x600]
push ecx
push ebx
call fcn.00470320
add esp, 0x24
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
cmp si, word [ebp - 0x610]
jbe 0x480088
mov edx, dword [ebp - 0x608]
push str.bind___failed__we_ran_out_of_ports_
push edx
call fcn.0046af40
mov eax, dword [ebp - 0x600]
push eax
push ebx
call fcn.00470320
add esp, 0x10
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x600]
lea ecx, [ebp - 0x60c]
push ecx
lea edx, [ebp - 0x5fc]
push edx
push eax
mov dword [ebp - 0x60c], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x480100
push pe_nt_image_headers32
lea ecx, [ebp - 0x178]
push ecx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00492ff0
mov edx, dword [ebp - 0x608]
push eax
push str.getsockname___failed:__s
push edx
call fcn.0046af40
mov eax, dword [ebp - 0x600]
push eax
push ebx
call fcn.00470320
add esp, 0x20
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x600]
push 1
push ecx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x480162
push pe_nt_image_headers32
lea edx, [ebp - 0x178]
push edx
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00492ff0
push eax
mov eax, dword [ebp - 0x608]
push str.socket_failure:__s
push eax
call fcn.0046af40
mov ecx, dword [ebp - 0x600]
push ecx
push ebx
call fcn.00470320
add esp, 0x20
pop edi
mov eax, 0x1e
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
push 0x2f
lea edx, [ebp - 0x34]
push edx
push edi
call fcn.0048b870
add esp, 0xc
cmp dword [ebx + 0x55c], 0
jne 0x48018d
cmp dword [ebx + 0x53c], 0
je 0x48018d
mov dword [ebx + 0x55c], 1
mov esi, dword [ebp + 8]
cmp esi, 2
je 0x4801f8
mov cx, word [ebp - 0x5fc]
lea esp, [esp]
cmp dword [ebx + 0x55c], 0
jne 0x4801ad
test esi, esi
je 0x4801f2
cmp esi, 1
jne 0x4801b8
cmp cx, 2
jne 0x4801f2
movzx eax, cx
sub eax, 2
je 0x4801ce
sub eax, 0x15
jne 0x4801f2
mov eax, dword [ebp - 0x5fa]
push eax
jmp 0x4801d5
mov ecx, dword [ebp - 0x5fa]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edi, ax
test esi, esi
je 0x480203
cmp esi, 1
je 0x48028b
mov cx, word [ebp - 0x5fc]
inc esi
cmp esi, 2
jne 0x4801a0
mov edi, dword [ebp - 0x604]
jmp 0x480332
xor ecx, ecx
cmp word [ebp - 0x5fc], 2
movzx edx, di
setne cl
push edx
lea eax, [ebp - 0x34]
push eax
mov dword [ebp + 8], esi
lea esi, [ebx + 0x670]
inc ecx
push ecx
push str.EPRT
push str._s__d_s_hu
push esi
call fcn.00495c20
mov edi, eax
add esp, 0x18
test edi, edi
je 0x48032f
push edi
call fcn.00492560
mov edx, dword [ebp - 0x608]
push eax
push str.Failure_sending_EPRT_command:__s
push edx
call fcn.0046af40
mov eax, dword [ebp - 0x600]
push eax
push ebx
call fcn.00470320
add esp, 0x18
mov eax, edi
mov dword [esi + 0x70], 1
pop edi
mov dword [ebx + 0x6ec], 0
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x78]
lea edx, [ebp - 0x34]
mov al, byte [edx]
test al, al
je 0x4802a8
cmp al, 0x2e
jne 0x4802a0
mov byte [ecx], 0x2c
jmp 0x4802a2
mov byte [ecx], al
inc ecx
add edx, 1
jne 0x480291
movzx eax, di
mov edx, eax
and edx, 0xff
push edx
shr eax, 8
push eax
push str.__d__d
push 0x14
push ecx
mov byte [ecx], 0
call fcn.00473180
lea eax, [ebp - 0x78]
push eax
push str.PORT
lea eax, [ebx + 0x670]
push 0x4c1750
push eax
call fcn.00495c20
mov edi, eax
add esp, 0x24
test edi, edi
je 0x480332
push edi
call fcn.00492560
mov ecx, dword [ebp - 0x608]
push eax
push str.Failure_sending_PORT_command:__s
push ecx
call fcn.0046af40
mov edx, dword [ebp - 0x600]
push edx
push ebx
call fcn.00470320
add esp, 0x18
mov eax, edi
pop edi
mov dword [ebx + 0x6ec], 0
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a1682
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
mov dword [ebx + 0x6e0], esi
mov eax, dword [ebx + 0x424]
cmp eax, 0xffffffff
je 0x480357
push eax
push ebx
call fcn.00470320
add esp, 8
mov dword [ebx + 0x424], 0xffffffff
mov eax, dword [ebp - 0x600]
mov ecx, dword [ebp - 4]
mov dword [ebx + 0x424], eax
mov eax, edi
pop edi
mov dword [ebx + 0x50c], 1
xor ecx, ebp
mov dword [ebx + 0x6ec], 0x1c
pop esi
call fcn.004a1682
mov esp, ebp
pop ebp
ret