Function at 0x140022de8
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
movsxd rbp, ecx
lea r11, [0x140000000]
mov r14, rbp
mov r15, rbp
sar r15, 6
and r14d, 0x3f
mov r12, r9
mov rdi, rdx
mov rax, qword [r11 + r15*8 + 0x48c20]
lea rsi, [r14 + r14*8]
mov r10, qword [rax + rsi*8 + 0x28]
test r8, r8
je 0x140022e3c
cmp byte [rdx], 0xa
jne 0x140022e3c
or byte [rax + rsi*8 + 0x38], 4
jmp 0x140022e41
and byte [rax + rsi*8 + 0x38], 0xfb
lea r9, [rdx + r8]
mov rax, rdi
mov rbx, rdi
mov r13d, 1
cmp rdi, r9
jae 0x140022f54
mov cl, byte [rax]
cmp cl, 0x1a
je 0x140022f31
lea rdx, [rax + 1]
cmp cl, 0xd
jne 0x140022e81
cmp rdx, r9
jae 0x140022e93
cmp byte [rdx], 0xa
jne 0x140022e81
add rax, 2
mov byte [rbx], 0xa
jmp 0x140022e86
mov byte [rbx], cl
mov rax, rdx
inc rbx
cmp rax, r9
jb 0x140022e5a
jmp 0x140022f54
xor eax, eax
lea r9, [rsp + 0x78]
mov r8d, r13d
mov byte [rsp + 0x70], al
lea rdx, [rsp + 0x70]
mov dword [rsp + 0x78], eax
mov rcx, r10
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140022f25
cmp dword [rsp + 0x78], 0
je 0x140022f25
lea r11, [0x140000000]
mov rax, qword [r11 + r15*8 + 0x48c20]
test byte [rax + rsi*8 + 0x38], 0x48
je 0x140022ef8
mov cl, byte [rsp + 0x70]
cmp cl, 0xa
jne 0x140022ee7
mov byte [rbx], 0xa
jmp 0x140022f51
mov byte [rbx], 0xd
mov rax, qword [r11 + r15*8 + 0x48c20]
mov byte [rax + rsi*8 + 0x3a], cl
jmp 0x140022f51
cmp byte [rsp + 0x70], 0xa
jne 0x140022f04
cmp rbx, rdi
je 0x140022ee2
mov r8d, r13d
or rdx, 0xffffffffffffffff
mov ecx, ebp
call fcn.14002390c
cmp byte [rsp + 0x70], 0xa
lea r11, [0x140000000]
je 0x140022f54
mov byte [rbx], 0xd
jmp 0x140022f51
mov byte [rbx], 0xd
lea r11, [0x140000000]
jmp 0x140022f51
mov r8, qword [r11 + r15*8 + 0x48c20]
lea rdx, [r14 + r14*8]
mov al, byte [r8 + rdx*8 + 0x38]
test al, 0x40
jne 0x140022f4f
or al, 2
mov byte [r8 + rdx*8 + 0x38], al
jmp 0x140022f54
mov byte [rbx], cl
add rbx, r13
sub ebx, edi
jne 0x140022f5f
xor eax, eax
jmp 0x1400230ff
mov rcx, qword [r11 + r15*8 + 0x48c20]
lea rdx, [r14 + r14*8]
cmp byte [rcx + rdx*8 + 0x39], 0
jne 0x140022f79
mov eax, ebx
jmp 0x1400230ff
movsxd rcx, ebx
add rcx, rdi
lea rbx, [rcx - 1]
cmp byte [rbx], 0
jl 0x140022f90
mov rbx, rcx
jmp 0x140023084
mov r8d, r13d
jmp 0x140022fa6
cmp r8d, 4
ja 0x140022fb4
cmp rbx, rdi
jb 0x140022fb4
sub rbx, r13
add r8d, r13d
movzx eax, byte [rbx]
cmp byte [rax + r11 + 0x46540], 0
je 0x140022f95
movzx edx, byte [rbx]
movsx eax, byte [rdx + r11 + 0x46540]
test eax, eax
jne 0x140022fd7
call fcn.140016bc8
mov dword [rax], 0x2a
or eax, 0xffffffff
jmp 0x1400230ff
inc eax
cmp eax, r8d
jne 0x140022fe9
mov eax, r8d
add rbx, rax
jmp 0x140023084
mov rcx, rbp
mov rax, rbp
sar rax, 6
and ecx, 0x3f
mov r9, qword [r11 + rax*8 + 0x48c20]
lea rax, [rcx + rcx*8]
test byte [r9 + rax*8 + 0x38], 0x48
je 0x140023074
mov rax, rbp
add rbx, r13
and eax, 0x3f
lea rax, [rax + rax*8]
mov byte [r9 + rax*8 + 0x3a], dl
cmp r8d, 2
jb 0x140023044
mov dl, byte [rbx]
mov rcx, rbp
mov rax, rbp
add rbx, r13
sar rax, 6
and ecx, 0x3f
mov rax, qword [r11 + rax*8 + 0x48c20]
lea rcx, [rcx + rcx*8]
mov byte [rax + rcx*8 + 0x3b], dl
cmp r8d, 3
jne 0x14002306c
mov dl, byte [rbx]
mov rcx, rbp
mov rax, rbp
add rbx, r13
sar rax, 6
and ecx, 0x3f
mov rax, qword [r11 + rax*8 + 0x48c20]
lea rcx, [rcx + rcx*8]
mov byte [rax + rcx*8 + 0x3c], dl
mov eax, r8d
sub rbx, rax
jmp 0x140023084
neg r8d
mov ecx, ebp
movsxd rdx, r8d
mov r8d, r13d
call fcn.14002390c
mov eax, dword [rsp + 0x90]
sub ebx, edi
mov dword [rsp + 0x28], eax
mov r9d, ebx
mov r8, rdi
mov qword [rsp + 0x20], r12
xor edx, edx
mov ecx, 0xfde9
call fcn.14002571c
mov r9d, eax
test eax, eax
jne 0x1400230c1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140016b58
jmp 0x140022fcf
mov rcx, rbp
lea rdx, [0x140000000]
and ecx, 0x3f
mov rax, rbp
sar rax, 6
lea r8, [rcx + rcx*8]
mov rdx, qword [rdx + rax*8 + 0x48c20]
mov eax, r9d
sub eax, ebx
neg eax
mov al, byte [rdx + r8*8 + 0x3d]
sbb cl, cl
and al, 0xfd
and cl, 2
or cl, al
lea eax, [r9 + r9]
mov byte [rdx + r8*8 + 0x3d], cl
mov rbx, qword [rsp + 0x80]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret