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

Disassembly:
mov r11, rsp
push rbp
push rbx
push r13
push r15
lea rbp, [r11 - 0x608]
sub rsp, 0x6e8
mov rax, qword [0x1400b5700]
xor rax, rsp
mov qword [rbp + 0x5c0], rax
mov r13, qword [rcx + 0x20]
xor eax, eax
mov qword [r11 + 0x18], rsi
xorps xmm0, xmm0
mov qword [r11 - 0x28], rdi
mov r15, rcx
mov qword [r11 - 0x30], r12
mov edi, edx
mov qword [r11 - 0x38], r14
mov r12b, 1
mov r14, qword [rcx + 0x760]
mov esi, eax
mov qword [rsp + 0x48], 0xffffffffffffffff
mov byte [rbp - 0x10], 0
mov qword [rbp + 0x11], rax
mov dword [rbp + 0x19], eax
mov word [rbp + 0x1d], ax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x58], rax
mov word [rsp + 0x40], ax
mov word [rsp + 0x44], ax
mov qword [rsp + 0x50], rax
movups xmmword [rbp - 0xf], xmm0
movups xmmword [rbp + 1], xmm0
test r14, r14
je 0x140040f23
mov rax, 0xffffffffffffffff
nop dword [rax + rax]
inc rax
cmp byte [r14 + rax], sil
jne 0x140040d50
cmp rax, 1
jbe 0x140040f23
movzx eax, byte [r14]
cmp al, 0x5b
jne 0x140040da2
lea rsi, [r14 + 1]
mov edx, 0x5d
mov rcx, rsi
mov rbx, rsi
call fcn.1400650d0
mov r14, rax
test rax, rax
mov eax, 0
cmove rsi, rax
mov qword [rsp + 0x50], rsi
mov rsi, r14
sub rsi, rbx
test r14, r14
cmove rsi, rax
jmp 0x140040de9
cmp al, 0x3a
je 0x140040df1
mov edx, 0x3a
mov rcx, r14
call fcn.1400650d0
mov rdx, r14
mov rbx, rax
mov qword [rsp + 0x50], rdx
mov rsi, rax
test rax, rax
je 0x140040eec
lea r8, [rsp + 0x78]
mov ecx, reloc.WS2_32.dll_socket
sub rsi, r14
call qword [sym.imp.WS2_32.dll_inet_pton]
xor r14d, r14d
cmp eax, 1
cmovne r14, rbx
xor eax, eax
movzx ebx, ax
test r14, r14
je 0x140040e4f
mov edx, 0x3a
mov rcx, r14
call fcn.1400650d0
mov r14, rax
xor eax, eax
mov ebx, eax
test r14, r14
je 0x140040e4f
lea rcx, [r14 + 1]
xor edx, edx
lea r8d, [rax + 0xa]
call fcn.1400725ac
mov ecx, eax
call fcn.14001c3f0
mov edx, 0x2d
mov rcx, r14
movzx ebx, ax
call fcn.1400650d0
test rax, rax
je 0x140040ee4
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.1400725ac
mov ecx, eax
call fcn.14001c3f0
mov rdx, qword [rsp + 0x50]
xor r14d, r14d
cmp bx, ax
mov ecx, r14d
cmovbe cx, ax
cmovbe r14w, bx
mov dword [rsp + 0x44], ecx
test rsi, rsi
je 0x140040f1d
cmp rsi, 0x32
jae 0x1400413d9
mov r8, rsi
lea rcx, [rbp + 0x20]
call fcn.14008d980
mov byte [rbp + rsi + 0x20], 0
mov rcx, qword [r13 + 0x38]
add rcx, 0x10
call fcn.14005d620
mov rcx, qword [r13 + 0x38]
lea r9, [rbp + 0x20]
mov r8d, dword [r13 + 0x6d8]
mov edx, eax
lea rax, [rbp + 0x1b0]
mov dword [rsp + 0x28], 0x401
mov qword [rsp + 0x20], rax
mov ecx, dword [rcx]
call fcn.14000cd10
mov ecx, eax
test eax, eax
je 0x140040f07
sub ecx, 1
je 0x1400413d9
cmp ecx, 1
jne 0x140040f0d
lea rbx, [rbp + 0x1b0]
jmp 0x140040f12
movzx eax, bx
jmp 0x140040e4f
mov rsi, 0xffffffffffffffff
inc rsi
cmp byte [r14 + rsi], 0
jne 0x140040ef3
xor eax, eax
movzx ebx, ax
jmp 0x140040e54
lea rbx, [rbp + 0x20]
jmp 0x140040f12
mov rbx, qword [rsp + 0x60]
test rbx, rbx
jne 0x140040fb8
jmp 0x140040f28
mov dword [rsp + 0x44], ecx
jmp 0x140040f28
mov r14d, dword [rsp + 0x40]
mov dword [rsp + 0x40], 0x80
lea r8, [rsp + 0x40]
mov rcx, qword [r13 + 0x188]
lea rdx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x140040f74
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0xb0]
mov ecx, eax
call fcn.14002e120
mov r8, rax
lea rdx, str.getsockname___failed:__s
jmp 0x1400413d1
movzx eax, word [rsp + 0x70]
cmp ax, 0x17
je 0x140040f86
lea rdx, [rsp + 0x74]
jmp 0x140040f90
lea rdx, [rsp + 0x78]
mov eax, reloc.WS2_32.dll_socket
movzx ecx, ax
lea r8, [rbp + 0x1b0]
mov r9d, 0x401
call sub.WS2_32.dll_inet_ntop
test rax, rax
je 0x1400413d9
lea rbx, [rbp + 0x1b0]
xor r12b, r12b
lea rax, [rsp + 0x58]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, r15
call fcn.140024520
cmp eax, 1
jne 0x140040fe5
lea rdx, [rsp + 0x58]
mov rcx, r15
call fcn.14000cf30
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x1400413c7
mov rsi, qword [rdx]
mov rcx, r15
call fcn.140024b10
test rsi, rsi
je 0x1400413c7
nop word [rax + rax]
movzx r9d, byte [r13 + 0x6e2]
lea rax, [rsp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, rsi
mov rcx, r15
call fcn.14004fb00
test eax, eax
je 0x140041066
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rsi, qword [rsi + 0x28]
test rsi, rsi
jne 0x140041010
mov r8d, 0x100
lea rdx, [rbp + 0xb0]
mov ecx, eax
call fcn.14002e120
mov r8, rax
lea rdx, str.socket_failure:__s
jmp 0x1400413d1
movsxd r8, dword [rsi + 0x10]
lea rcx, [rsp + 0x70]
mov rdx, qword [rsi + 0x20]
call fcn.14008d980
movzx ebx, r14w
mov eax, dword [rsi + 0x10]
mov dword [rsp + 0x40], eax
cmp r14w, word [rsp + 0x44]
ja 0x140041144
nop
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov r8d, dword [rsp + 0x40]
lea rdx, [rsp + 0x70]
mov rcx, qword [rsp + 0x48]
mov word [rsp + 0x72], ax
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x140041187
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test r12b, r12b
je 0x14004112a
cmp eax, 0x2741
jne 0x14004112a
mov r8d, 0x100
lea rdx, [rbp + 0xb0]
mov ecx, eax
call fcn.14002e120
mov r9, rax
movzx r8d, bx
lea rdx, str.bind_port_hu__on_non_local_address_failed:__s
mov rcx, r15
call fcn.140019830
mov dword [rsp + 0x40], 0x80
lea r8, [rsp + 0x40]
mov rcx, qword [r13 + 0x188]
lea rdx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x140040f4b
movzx ebx, r14w
xor r12b, r12b
jmp 0x140041090
cmp eax, 0x2740
je 0x140041136
cmp eax, 0xd
jne 0x140041158
inc bx
cmp bx, word [rsp + 0x44]
jbe 0x140041090
lea rdx, str.bind___failed__we_ran_out_of_ports
mov rcx, r15
call fcn.140019740
jmp 0x1400413d9
mov r8d, 0x100
lea rdx, [rbp + 0xb0]
mov ecx, eax
call fcn.14002e120
mov r9, rax
movzx r8d, bx
lea rdx, str.bind_port_hu__failed:__s
mov rcx, r15
call fcn.140019740
jmp 0x1400413d9
cmp bx, word [rsp + 0x44]
ja 0x140041144
mov rcx, qword [rsp + 0x48]
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x70]
mov dword [rsp + 0x40], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x140040f4b
mov rcx, qword [rsp + 0x48]
lea edx, [rax + 1]
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x1400411ee
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0xb0]
mov ecx, eax
call fcn.14002e120
mov r8, rax
lea rdx, str.socket_failure:__s
jmp 0x1400413d1
mov r8d, 0x2f
lea rdx, [rbp - 0x10]
mov rcx, rsi
call fcn.1400244e0
cmp byte [r13 + 0x2ba], 0
jne 0x14004121c
cmp byte [r13 + 0x2b4], 0
je 0x14004121c
mov byte [r13 + 0x2ba], 1
cmp edi, 2
je 0x140041274
movzx eax, word [rsp + 0x70]
cmp byte [r13 + 0x2ba], 0
jne 0x140041234
test edi, edi
je 0x14004126d
cmp edi, 1
jne 0x14004123f
cmp ax, 2
jne 0x14004126d
movzx ecx, ax
cmp ecx, 2
je 0x14004124c
cmp ecx, 0x17
jne 0x14004126d
movzx ecx, word [rsp + 0x72]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
test edi, edi
je 0x14004135d
cmp edi, 1
je 0x1400412ba
movzx eax, word [rsp + 0x70]
inc edi
cmp edi, 2
jne 0x140041226
lea rsi, [r13 + 0x590]
lea r9, [rsp + 0x48]
mov dword [rsi + 0x100], edi
mov r8d, 1
mov rdx, r13
mov rcx, r15
call fcn.14004f8c0
mov ebx, eax
test eax, eax
jne 0x1400413de
mov rax, qword [r15 + 0x20]
mov qword [rsp + 0x48], 0xffffffffffffffff
mov byte [rax + 0x69e], 0x1c
jmp 0x1400413e9
lea r10, [rbp + 0x60]
mov r9d, 0x2c
lea rdx, [rbp - 0x10]
movzx ecx, byte [rdx]
test cl, cl
je 0x1400412e4
cmp cl, 0x2e
mov eax, ecx
cmove eax, r9d
mov byte [r10], al
inc r10
add rdx, 1
jne 0x1400412c8
movzx r9d, r8w
mov edx, reloc.WS2_32.dll_sendto
movzx eax, r9b
lea r8, str.__d__d
shr r9d, 8
mov rcx, r10
mov dword [rsp + 0x20], eax
mov byte [r10], 0
call fcn.140021c60
lea rax, [rbp + 0x60]
mov rcx, r15
lea rsi, [r13 + 0x590]
mov qword [rsp + 0x20], rax
mov rdx, rsi
lea r9, str.PORT
lea r8, [0x140098da0]
call fcn.14005bf30
mov ebx, eax
test eax, eax
je 0x14004127b
mov ecx, eax
call fcn.14002e300
mov r8, rax
lea rdx, str.Failure_sending_PORT_command:__s
mov rcx, r15
call fcn.140019740
jmp 0x1400413de
cmp word [rsp + 0x70], 2
lea rsi, [r13 + 0x590]
movzx eax, r8w
lea r9, str.EPRT
mov dword [rsp + 0x30], eax
lea r8, str._s__d_s_hu
mov ecx, 0
lea rax, [rbp - 0x10]
setne cl
mov qword [rsp + 0x28], rax
inc ecx
mov rdx, rsi
mov dword [rsp + 0x20], ecx
mov rcx, r15
call fcn.14005bf30
mov ebx, eax
test eax, eax
je 0x14004127b
mov ecx, eax
call fcn.14002e300
mov r8, rax
lea rdx, str.Failure_sending_EPRT_command:__s
mov rcx, r15
call fcn.140019740
jmp 0x1400413de
mov r8, rbx
lea rdx, str.failed_to_resolve_the_address_provided_to_PORT:__s
mov rcx, r15
call fcn.140019740
mov ebx, 0x1e
mov rax, qword [r15 + 0x20]
mov byte [rax + 0x69e], 0
mov r8, qword [rsp + 0x48]
mov r14, qword [rsp + 0x6d0]
mov r12, qword [rsp + 0x6d8]
mov rdi, qword [rsp + 0x6e0]
mov rsi, qword [rsp + 0x720]
cmp r8, 0xffffffffffffffff
je 0x14004141f
mov rdx, r13
mov rcx, r15
call fcn.14004fad0
mov eax, ebx
mov rcx, qword [rbp + 0x5c0]
xor rcx, rsp
call fcn.1400633b0
add rsp, 0x6e8
pop r15
pop r13
pop rbx
pop rbp
ret