Function at 0x140057f64
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
lea rbp, [rsp - 0x27]
sub rsp, 0xd0
mov rax, qword [0x1401f5698]
xor rax, rsp
mov qword [rbp + 0x17], rax
xor r12d, r12d
mov rbx, rdx
mov r14, rcx
cmp byte [rcx + 4], r12b
je 0x140057fa7
mov rcx, qword [rdx + 0x48]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
xor ecx, ecx
mov dword [rbx + 0x74], 6
mov dword [rbp - 0x79], r12d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov al, byte [r14 + 4]
lea r13, [rbx + 0x50]
neg al
lea r9, [rbp - 0x79]
mov r8d, 0x80
lea rdx, [rbp - 0x69]
sbb rcx, rcx
and rcx, r13
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [r14 + 4], r12b
je 0x140058056
cmp eax, 0x6d
je 0x140058026
test edi, edi
je 0x140058005
mov edi, dword [rbp - 0x79]
test edi, edi
jne 0x140058064
lea r8, [rbp - 0x79]
mov rdx, rbx
mov rcx, r14
call fcn.1400591c0
cmp eax, 1
jne 0x140058021
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140058061
cmp eax, 2
jne 0x14005802d
mov dword [rbx + 0x40], 1
xor eax, eax
mov rcx, qword [rbp + 0x17]
xor rcx, rsp
call fcn.14012bda0
mov rbx, qword [rsp + 0x120]
add rsp, 0xd0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
test edi, edi
jne 0x140058061
cmp eax, 0xea
jne 0x14005802d
mov edi, dword [rbp - 0x79]
cmp edi, 4
jb 0x14005802d
cmp byte [r14 + 1], r12b
jne 0x14005802d
mov esi, dword [rbp - 0x69]
cmp esi, edi
ja 0x1400580cb
mov rax, qword [rbx + 0x198]
test rax, rax
je 0x140058092
cmp dword [rbx + 0x194], edi
jae 0x1400580ae
mov rcx, rax
call fcn.140113e18
mov ecx, edi
call fcn.140113e8c
mov qword [rbx + 0x198], rax
mov dword [rbx + 0x194], edi
test rax, rax
je 0x14005802d
mov edi, dword [rbp - 0x79]
mov r8d, edi
lea rdx, [rbp - 0x69]
mov rcx, rax
call fcn.14012d940
mov eax, dword [rbp - 0x79]
mov dword [rbx + 0x190], eax
jmp 0x1400581f4
cmp esi, 0x7fffffff
jae 0x14005802d
mov r15, qword [rbx + 0x198]
test r15, r15
je 0x1400580eb
cmp dword [rbx + 0x194], esi
jae 0x140058123
lfence
mov rcx, qword [rbx + 0x198]
test rcx, rcx
je 0x1400580ff
call fcn.140113e18
mov rcx, rsi
call fcn.140113e8c
mov qword [rbx + 0x198], rax
mov r15, rax
mov dword [rbx + 0x194], esi
test rax, rax
je 0x14005802d
mov edi, dword [rbp - 0x79]
mov r8d, edi
lea rdx, [rbp - 0x69]
mov rcx, r15
call fcn.14012d940
mov edi, dword [rbp - 0x79]
add rdi, r15
sub esi, dword [rbp - 0x79]
test esi, esi
jle 0x1400581eb
cmp byte [r14 + 4], r12b
je 0x140058153
mov rcx, qword [rbx + 0x48]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov al, byte [r14 + 4]
lea r9, [rbp - 0x79]
neg al
mov r8d, esi
mov rdx, rdi
sbb rcx, rcx
and rcx, r13
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r12d, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [r14 + 4], 0
je 0x1400581c5
cmp eax, 0x6d
je 0x140058026
test r12d, r12d
je 0x1400581a5
mov ecx, dword [rbp - 0x79]
test ecx, ecx
jne 0x1400581d4
lea r8, [rbp - 0x79]
mov rdx, rbx
mov rcx, r14
call fcn.1400591c0
cmp eax, 1
jne 0x14005802d
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1400581d1
test r12d, r12d
jne 0x1400581d1
cmp eax, 0xea
jne 0x1400581e3
mov ecx, dword [rbp - 0x79]
mov eax, ecx
sub esi, ecx
add rdi, rax
xor r12d, r12d
jmp 0x14005813b
test esi, esi
jne 0x14005802d
sub edi, r15d
mov dword [rbx + 0x190], edi
mov eax, 1
jmp 0x14005802f