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

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x590]
sub rsp, 0x690
mov rax, qword [0x14011f7a8]
xor rax, rsp
mov qword [rbp + 0x580], rax
mov rax, qword [rcx + 0x20]
xorps xmm0, xmm0
mov rbx, qword [rcx + 0x778]
mov edi, edx
mov qword [rsp + 0x48], rax
mov r14, rcx
xor eax, eax
mov qword [rsp + 0x58], 0xffffffffffffffff
mov byte [rbp - 0x10], 0
mov r12d, eax
mov qword [rbp + 0x11], rax
movzx r15d, ax
mov dword [rbp + 0x19], eax
mov r13b, 1
mov word [rbp + 0x1d], ax
mov qword [rsp + 0x68], rax
mov word [rsp + 0x50], ax
mov qword [rsp + 0x60], rax
movups xmmword [rbp - 0xf], xmm0
movups xmmword [rbp + 1], xmm0
test rbx, rbx
je 0x140041199
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], r12b
jne 0x140040f63
cmp rax, 1
jbe 0x140041199
mov rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp byte [rbx + rax], r12b
jne 0x140040f80
cmp rax, 0x41
jae 0x140040f96
mov ecx, 0x41
jmp 0x140040fa9
mov rcx, 0xffffffffffffffff
nop dword [rax]
inc rcx
cmp byte [rbx + rcx], r12b
jne 0x140040fa0
inc rcx
mov edx, 1
call qword [str.4_r_]
mov qword [rsp + 0x60], rax
mov r15, rax
test rax, rax
jne 0x140040fd1
mov rbx, qword [rsp + 0x48]
lea esi, [rax + 0x1b]
jmp 0x14004169c
movzx eax, byte [rbx]
cmp al, 0x5b
jne 0x140041005
mov edx, 0x5d
lea r15, [rbx + 1]
mov rcx, rbx
call fcn.1400c9818
mov rsi, rax
test rax, rax
je 0x1400410fe
mov rcx, qword [rsp + 0x60]
mov r8, rax
sub r8, r15
mov rdx, r15
jmp 0x140041075
cmp al, 0x3a
jne 0x14004100e
mov rsi, rbx
jmp 0x14004107a
mov edx, 0x3a
mov rcx, rbx
call fcn.1400c9818
mov rsi, rax
test rax, rax
je 0x1400410e1
lea r8, [rsp + 0x78]
mov rdx, rbx
mov ecx, reloc.WS2_32.dll_socket
call qword [sym.imp.WS2_32.dll_inet_pton]
mov rcx, r15
cmp eax, 1
jne 0x14004106c
sub rcx, rbx
nop word [rax + rax]
movzx eax, byte [rbx]
mov byte [rbx + rcx], al
lea rbx, [rbx + 1]
test al, al
jne 0x140041050
xor r15d, r15d
mov ebx, r15d
mov eax, r15d
jmp 0x140041109
mov r8, rsi
mov rdx, rbx
sub r8, rbx
call fcn.1400d11d0
mov edx, 0x3a
mov rcx, rsi
call fcn.1400c9818
xor r15d, r15d
mov rsi, rax
movzx ebx, r15w
movzx eax, r15w
test rsi, rsi
je 0x140041109
lea rcx, [rsi + 1]
xor edx, edx
lea r8d, [r15 + 0xa]
call fcn.1400d5090
mov ecx, eax
call fcn.14001c800
lea edx, [r15 + 0x2d]
mov rcx, rsi
movzx ebx, ax
call fcn.1400c9818
test rax, rax
je 0x1400410dc
lea rcx, [rax + 1]
xor edx, edx
lea r8d, [r15 + 0xa]
call fcn.1400d5090
mov ecx, eax
call fcn.14001c800
jmp 0x140041109
movzx eax, bx
jmp 0x140041109
mov rcx, r15
sub rcx, rbx
nop word [rax + rax]
movzx eax, byte [rbx]
mov byte [rbx + rcx], al
lea rbx, [rbx + 1]
test al, al
jne 0x1400410f0
xor r15d, r15d
movzx eax, r15w
movzx ebx, r15w
cmp bx, ax
mov esi, r15d
cmovbe si, ax
cmovbe r15w, bx
mov rax, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x48]
mov dword [rsp + 0x50], esi
cmp byte [rax], r12b
je 0x140041193
mov rcx, qword [rbx + 0x58]
add rcx, 0x10
call fcn.14005de10
mov rcx, qword [rbx + 0x58]
mov edx, eax
mov rsi, qword [rsp + 0x60]
lea rax, [rbp + 0x170]
mov r8d, dword [rbx + 0x700]
mov r9, rsi
mov dword [rsp + 0x28], 0x401
mov ecx, dword [rcx]
mov qword [rsp + 0x20], rax
call fcn.14000d0d0
mov ecx, eax
test eax, eax
je 0x140041185
sub ecx, 1
je 0x140041697
cmp ecx, 1
jne 0x140041188
lea r12, [rbp + 0x170]
jmp 0x140041188
mov r12, rsi
test r12, r12
jne 0x14004122b
jmp 0x14004119e
mov dword [rsp + 0x50], esi
jmp 0x14004119e
mov rbx, qword [rsp + 0x48]
mov dword [rsp + 0x40], 0x80
lea r8, [rsp + 0x40]
mov rcx, qword [rbx + 0x1a8]
lea rdx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x1400411e7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r8, rax
lea rdx, str.getsockname___failed:__s
jmp 0x14004168f
movzx eax, word [rsp + 0x70]
cmp ax, 0x17
je 0x1400411f9
lea rdx, [rsp + 0x74]
jmp 0x140041203
lea rdx, [rsp + 0x78]
mov eax, reloc.WS2_32.dll_socket
movzx ecx, ax
lea r8, [rbp + 0x170]
mov r9d, 0x401
call sub.WS2_32.dll_inet_ntop
test rax, rax
je 0x140041697
lea r12, [rbp + 0x170]
xor r13b, r13b
lea rax, [rsp + 0x68]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, r12
mov rcx, r14
call fcn.140023b00
cmp eax, 1
jne 0x140041258
lea rdx, [rsp + 0x68]
mov rcx, r14
call fcn.14000d2b0
mov rdx, qword [rsp + 0x68]
test rdx, rdx
je 0x140041685
mov rsi, qword [rdx]
mov rcx, r14
call fcn.1400240a0
test rsi, rsi
je 0x140041685
nop word [rax + rax]
movzx r9d, byte [rbx + 0x70b]
lea rax, [rsp + 0x58]
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rdx, rsi
mov rcx, r14
call fcn.14004ff10
test eax, eax
je 0x1400412d3
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rsi, qword [rsi + 0x28]
test rsi, rsi
jne 0x140041280
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r8, rax
lea rdx, str.socket_failure:__s
jmp 0x14004168f
movsxd r8, dword [rsi + 0x10]
lea rcx, [rsp + 0x70]
mov rdx, qword [rsi + 0x20]
call fcn.1400c98d0
mov r12d, dword [rsp + 0x50]
movzx ebx, r15w
mov eax, dword [rsi + 0x10]
mov dword [rsp + 0x40], eax
cmp r15w, r12w
ja 0x1400413b5
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 + 0x58]
mov word [rsp + 0x72], ax
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x1400413ff
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test r13b, r13b
je 0x14004139c
cmp eax, 0x2741
jne 0x14004139c
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r9, rax
movzx r8d, bx
lea rdx, str.bind_port_hu__on_non_local_address_failed:__s
mov rcx, r14
call fcn.14001a550
mov rbx, qword [rsp + 0x48]
lea r8, [rsp + 0x40]
mov dword [rsp + 0x40], 0x80
lea rdx, [rsp + 0x70]
mov rcx, qword [rbx + 0x1a8]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x1400411c1
movzx ebx, r15w
xor r13b, r13b
jmp 0x140041300
cmp eax, 0x2740
je 0x1400413a8
cmp eax, 0xd
jne 0x1400413ce
inc bx
cmp bx, r12w
jbe 0x140041300
lea rdx, str.bind___failed__we_ran_out_of_ports
mov rcx, r14
call fcn.14001a470
mov rbx, qword [rsp + 0x48]
jmp 0x140041697
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r9, rax
movzx r8d, bx
lea rdx, str.bind_port_hu__failed:__s
mov rcx, r14
call fcn.14001a470
mov rbx, qword [rsp + 0x48]
jmp 0x140041697
cmp bx, r12w
ja 0x1400413b5
mov rcx, qword [rsp + 0x58]
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x70]
mov dword [rsp + 0x40], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x140041459
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r8, rax
lea rdx, str.getsockname___failed:__s
mov rcx, r14
call fcn.14001a470
mov rbx, qword [rsp + 0x48]
jmp 0x140041697
mov rcx, qword [rsp + 0x58]
mov edx, 1
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x1400414a0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov ecx, eax
call fcn.14002e5e0
mov r8, rax
lea rdx, str.socket_failure:__s
mov rcx, r14
call fcn.14001a470
mov rbx, qword [rsp + 0x48]
jmp 0x140041697
mov r8d, 0x2f
lea rdx, [rbp - 0x10]
mov rcx, rsi
call fcn.140023ac0
mov rbx, qword [rsp + 0x48]
cmp byte [rbx + 0x2da], 0
jne 0x1400414d0
cmp byte [rbx + 0x2d4], 0
je 0x1400414d0
mov byte [rbx + 0x2da], 1
cmp edi, 2
je 0x14004152d
movzx eax, word [rsp + 0x70]
nop word [rax + rax]
cmp byte [rbx + 0x2da], 0
jne 0x1400414ed
test edi, edi
je 0x140041526
cmp edi, 1
jne 0x1400414f8
cmp ax, 2
jne 0x140041526
movzx ecx, ax
cmp ecx, 2
je 0x140041505
cmp ecx, 0x17
jne 0x140041526
movzx ecx, word [rsp + 0x72]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
test edi, edi
je 0x140041617
cmp edi, 1
je 0x140041574
movzx eax, word [rsp + 0x70]
inc edi
cmp edi, 2
jne 0x1400414e0
lea r15, [rbx + 0x5d0]
lea r9, [rsp + 0x58]
mov dword [r15 + 0xe8], edi
mov r8d, 1
mov rdx, rbx
mov rcx, r14
call fcn.14004fcd0
mov esi, eax
test eax, eax
jne 0x14004169c
mov rax, qword [r14 + 0x20]
mov qword [rsp + 0x58], 0xffffffffffffffff
mov byte [rax + 0x6c6], 0x1c
jmp 0x1400416a7
lea r10, [rbp + 0x20]
mov r9d, 0x2c
lea rdx, [rbp - 0x10]
movzx ecx, byte [rdx]
test cl, cl
je 0x14004159e
cmp cl, 0x2e
mov eax, ecx
cmove eax, r9d
mov byte [r10], al
inc r10
add rdx, 1
jne 0x140041582
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 sym.freemem.exe_curl_msnprintf
lea rax, [rbp + 0x20]
mov rcx, r14
lea r15, [rbx + 0x5d0]
mov qword [rsp + 0x20], rax
mov rdx, r15
lea r9, str.PORT
lea r8, [0x1400f9bb0]
call fcn.14005c6f0
mov esi, eax
test eax, eax
je 0x140041534
mov ecx, eax
call sym.freemem.exe_curl_easy_strerror
mov r8, rax
lea rdx, str.Failure_sending_PORT_command:__s
mov rcx, r14
call fcn.14001a470
jmp 0x14004169c
cmp word [rsp + 0x70], 2
lea r9, str.EPRT
movzx eax, r8w
mov r15d, 0
mov dword [rsp + 0x30], eax
lea r8, str._s__d_s_hu
setne r15b
lea rax, [rbp - 0x10]
inc r15d
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], r15d
mov rcx, r14
lea r15, [rbx + 0x5d0]
mov rdx, r15
call fcn.14005c6f0
mov esi, eax
test eax, eax
je 0x140041534
mov ecx, eax
call sym.freemem.exe_curl_easy_strerror
mov r8, rax
lea rdx, str.Failure_sending_EPRT_command:__s
mov rcx, r14
call fcn.14001a470
jmp 0x14004169c
mov r8, r12
lea rdx, str.failed_to_resolve_the_address_provided_to_PORT:__s
mov rcx, r14
call fcn.14001a470
mov esi, 0x1e
mov rax, qword [r14 + 0x20]
mov byte [rax + 0x6c6], 0
mov r8, qword [rsp + 0x58]
cmp r8, 0xffffffffffffffff
je 0x1400416bd
mov rdx, rbx
mov rcx, r14
call fcn.14004fee0
mov rcx, qword [rsp + 0x60]
call qword [str._f__r_]
mov eax, esi
mov rcx, qword [rbp + 0x580]
xor rcx, rsp
call fcn.1400c8a50
mov rbx, qword [rsp + 0x6e0]
add rsp, 0x690
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret