Function at 0x140130360
Capabilities:
Read file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
mov rbp, rsp
sub rsp, 0x60
mov qword [rbp - 0x40], 0xfffffffffffffffe
mov qword [rsp + 0xa0], rbx
mov rax, qword [0x14045cbf0]
xor rax, rsp
mov qword [rbp - 0x10], rax
mov rdi, rdx
mov rsi, rcx
test rdx, rdx
jne 0x1401303dc
cmp byte [rcx + 0x70], dl
jne 0x1401303d5
mov byte [rcx + 0x70], 1
mov dword [rcx + 0x74], 2
mov rdx, qword [str.Failed_to_open_file]
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsi + 0x78]
call fcn.1400031c0
mov qword [rsi + 0xa4], 0xffffffffffffffff
xor al, al
jmp 0x140130680
call fcn.14012f120
mov qword [rsi + 8], 0xffffffffffffffff
xor edx, edx
lea r8d, [rdx + 2]
mov rcx, rdi
call fcn.1400c657c
mov rcx, rdi
call fcn.1400c6470
movsxd r12, eax
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.1400c657c
test r12d, r12d
jg 0x14013042e
cmp byte [rsi + 0x70], 0
jne 0x1401303d5
mov byte [rsi + 0x70], 1
mov dword [rsi + 0x74], 0xd
mov rdx, qword [str.Error_document_empty.]
jmp 0x1401303af
mov qword [rbp - 0x20], 0xf
xor r13d, r13d
mov qword [rbp - 0x28], r13
mov byte [rbp - 0x38], r13b
mov rbx, r12
cmp r12, 0xf
je 0x140130472
mov r8b, 1
mov rdx, rbx
lea rcx, [rbp - 0x38]
call fcn.140003520
test al, al
je 0x140130472
mov qword [rbp - 0x28], r13
lea rax, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax], r13b
lea eax, [r12 + 1]
movsxd rcx, eax
call fcn.1400b9290
mov r12, rax
mov byte [rax], 0
mov r9, rdi
mov r8d, 1
mov rdx, rbx
mov rcx, rax
call fcn.1400c6140
cmp rax, 1
je 0x1401304fe
mov rcx, r12
call fcn.1400bee7c
cmp byte [rsi + 0x70], 0
jne 0x1401304e5
mov byte [rsi + 0x70], 1
mov dword [rsi + 0x74], 2
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdx, qword [str.Failed_to_open_file]
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsi + 0x78]
call fcn.1400031c0
mov qword [rsi + 0xa4], 0xffffffffffffffff
cmp qword [rbp - 0x20], 0x10
jb 0x1401303d5
mov rcx, qword [rbp - 0x38]
call fcn.1400be0f4
jmp 0x1401303d5
mov rdx, r12
mov rdi, r12
mov byte [rbx + r12], 0
cmp byte [r12], 0
je 0x140130619
movzx eax, byte [rdi]
cmp al, 0xa
jne 0x140130538
mov r8, rdi
sub r8, rdx
inc r8
lea rcx, [rbp - 0x38]
call fcn.1400032b8
inc rdi
mov rdx, rdi
jmp 0x1401305f7
cmp al, 0xd
jne 0x1401305f4
mov r8, rdi
sub r8, rdx
test r8, r8
jle 0x140130554
lea rcx, [rbp - 0x38]
call fcn.1400032b8
or rax, 0xffffffffffffffff
mov r8, qword [rbp - 0x28]
sub rax, r8
cmp rax, 1
jbe 0x14013060c
lea rbx, [r8 + 1]
cmp rbx, 0xfffffffffffffffe
ja 0x1401305ff
cmp qword [rbp - 0x20], rbx
jae 0x14013058b
mov rdx, rbx
lea rcx, [rbp - 0x38]
call fcn.1400033e4
jmp 0x1401305a4
test rbx, rbx
jne 0x1401305a7
mov qword [rbp - 0x28], r13
lea rax, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax], bl
test rbx, rbx
setne al
test al, al
je 0x1401305da
lea rcx, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rcx, qword [rbp - 0x38]
mov rax, qword [rbp - 0x28]
mov byte [rcx + rax], 0xa
mov qword [rbp - 0x28], rbx
lea rax, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax + rbx], 0
lea rax, [rdi + 1]
cmp byte [rax], 0xa
jne 0x1401305ec
add rdi, 2
mov rdx, rdi
jmp 0x1401305f7
mov rdi, rax
mov rdx, rax
jmp 0x1401305f7
inc rdi
cmp byte [rdi], 0
jmp 0x14013050e
lea rcx, str.string_too_long
call fcn.1400b8738
int3
lea rcx, str.string_too_long
call fcn.1400b8738
int3
sub rdi, rdx
je 0x14013062a
mov r8, rdi
lea rcx, [rbp - 0x38]
call fcn.1400032b8
mov rcx, r12
call fcn.1400bee7c
lea rdx, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rdx, qword [rbp - 0x38]
mov rax, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov rcx, rsi
call qword [rax + 0x10]
cmp byte [rsi + 0x70], 0
je 0x14013066e
cmp qword [rbp - 0x20], 0x10
jb 0x1401303d5
mov rcx, qword [rbp - 0x38]
call fcn.1400be0f4
jmp 0x1401303d5
cmp qword [rbp - 0x20], 0x10
jb 0x14013067e
mov rcx, qword [rbp - 0x38]
call fcn.1400be0f4
mov al, 1
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.1400be110
mov rbx, qword [rsp + 0xa0]
add rsp, 0x60
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret