Function at 0x14001a770
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
push rbp
sub rsp, 0xc8
xor r14d, r14d
movzx eax, byte [rcx + 0x49]
xor edi, edi
mov qword [rsp + 0xa0], r8
xor r12d, r12d
mov qword [rsp + 0xb0], rcx
mov r15, r9
mov dword [rsp + 0xa8], eax
mov rsi, rdx
mov qword [rsp + 0x98], rdi
lea ebp, [rax + 1]
xor r13d, r13d
xor bl, bl
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [rsp + 0xb8], r14d
xor al, al
lea rdx, [rdi + rdi*2]
shl rdx, 6
lea r14, [rsi + rdx + 0x40]
cmp dword [r14], 0
je 0x14001ab28
inc al
add r14, 0x30
cmp al, 2
jb 0x14001a7d9
mov dword [rsp + 0x88], r13d
mov dword [rsp + 0x90], r12d
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x78], r15
mov r12, qword [rsp + 0x98]
mov r13, qword [rsp + 0xb0]
mov r14, qword [rsp + 0xa0]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, ebp
mov rdx, r14
xor r8d, r8d
mov r9d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov r15d, eax
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rdi, [r15 + r15*2]
shl rdi, 6
cmp dword [rdi + rsi + 0x20], 0
jne 0x14001a881
mov r11d, dword [rdi + rsi + 0x24]
xor r10b, r10b
xor r9d, r9d
lea r8, [rsi + rdi + 0x40]
lea rax, [r8 + r9]
cmp dword [rax], 1
je 0x14001aaef
inc r10b
add r9, 0x30
cmp r10b, 2
jl 0x14001a867
cmp r15d, r12d
jne 0x14001a8c3
mov r8d, dword [rsp + 0x88]
mov eax, dword [rsp + 0x90]
xor r11b, r11b
lea r10, [r12 + r12*2]
shl r10, 6
xor r9d, r9d
add r10, rsi
cmp dword [r9 + r10 + 0x40], 2
je 0x14001a8f2
inc r11b
add r9, 0x30
cmp r11b, 2
jb 0x14001a8a6
mov dword [rsp + 0x88], r8d
test bl, bl
jne 0x14001a81f
mov qword [rsp + 0x98], r12
mov r13d, dword [rsp + 0x88]
mov rdi, qword [rsp + 0x70]
mov r12d, dword [rsp + 0x90]
mov r15, qword [rsp + 0x78]
jmp 0x14001a7ca
cmp r8d, dword [r9 + r10 + 0x44]
jne 0x14001a8ae
mov dword [r9 + r10 + 0x40], 0
lea r11, [r12 + r12*2]
shl r11, 6
mov r15d, dword [r9 + r10 + 0x4c]
mov edx, dword [r9 + r10 + 0x48]
mov rcx, qword [r11 + rsi + 0x10]
test r15, r15
je 0x14001aaba
mov qword [rsp + 0x68], rsi
mov byte [rsp + 0x40], bl
mov rbx, rcx
mov qword [rsp + 0x48], rdi
mov qword [rsp + 0x98], r12
mov dword [rsp + 0x88], r8d
mov dword [rsp + 0x60], ebp
mov rbp, rdx
mov rsi, qword [rsp + 0x78]
mov rdi, rbp
mov r12, rbp
shr rdi, 0x18
and r12, 0xffffff
mov eax, dword [rbx + 0x9a8]
mov r9, qword [rbx + rdi*8 + 0x4a8]
mov rdi, r12
neg rdi
add r12, r9
add rdi, 0x1000000
cmp rdi, r15
cmovae rdi, r15
add rbp, rdi
sub r15, rdi
mov r8, rbp
sub r8, rax
mov eax, dword [rsi + 0x28c]
cmovns rbp, r8
cmp eax, 1
jne 0x14001a9cd
mov rax, rsp
mov rdx, r12
mov rcx, qword [rsi + 0x298]
mov r8d, edi
lea r9, [rsp + 0x54]
mov qword [rax + 0x20], 0
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r14d, dword [rsp + 0x54]
jmp 0x14001aa6a
cmp eax, 2
je 0x14001a9fd
mov r14d, 0xffffffff
mov rcx, qword [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, r14d
add rsp, 0xc8
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov r13, rdi
test rdi, rdi
je 0x14001aa67
mov qword [rsp + 0x58], rbx
mov rax, qword [rsi + 0x48]
cmp rax, r13
mov rdx, r12
cmovae rax, r13
mov ebx, eax
mov r8, rbx
mov rcx, qword [rsi + 0x40]
mov r14, qword [rsi + 0x28]
call fcn.14002ef20
mov dword [r14], 2
mov dword [r14 + 4], ebx
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [rsi + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r14d, dword [r14 + 8]
test r14d, r14d
jl 0x14001aae5
add r12, rbx
sub r13, rbx
jne 0x14001aa0a
mov rbx, qword [rsp + 0x58]
mov r14d, edi
test r14d, r14d
jl 0x14001a9d8
test r15, r15
jne 0x14001a94f
mov qword [rsp + 0x78], rsi
mov bl, byte [rsp + 0x40]
mov rdi, qword [rsp + 0x48]
mov r12, qword [rsp + 0x98]
mov r8d, dword [rsp + 0x88]
mov eax, dword [rsp + 0x90]
mov ebp, dword [rsp + 0x60]
mov r13, qword [rsp + 0xb0]
mov rsi, qword [rsp + 0x68]
mov r14, qword [rsp + 0xa0]
xor r9d, r9d
inc r8d
inc r12d
cmp r12d, ebp
cmovae r12, r9
test bl, bl
je 0x14001a895
cmp r8d, eax
jne 0x14001a895
mov r14d, dword [rdi + rsi + 0x28]
jmp 0x14001a9d8
mov rbx, qword [rsp + 0x58]
jmp 0x14001aa6a
cmp r11d, dword [rax + 4]
jne 0x14001a874
mov r8d, dword [rsp + 0xa8]
mov rcx, qword [rdi + rsi + 0x30]
mov dword [rdi + rsi + 0x20], 1
mov qword [rdi + rsi + 0x18], rax
lea r9d, [r11 + r8 + 1]
mov dword [rdi + rsi + 0x24], r9d
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x14001a881
mov eax, dword [r15 + 0x28c]
cmp eax, 1
jne 0x14001ab7a
mov rax, rsp
lea rdx, [rsp + 0x84]
mov rcx, qword [r15 + 0x290]
mov r8d, 4
lea r9, [rsp + 0x80]
mov qword [rax + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [rsp + 0x80]
mov r8d, dword [rsp + 0x84]
test eax, eax
jl 0x14001ab84
jmp 0x14001ac40
cmp eax, 2
je 0x14001ab8c
mov eax, 0xffffffff
mov r14d, eax
jmp 0x14001a9d8
lea rcx, [rsp + 0x84]
cmp rcx, qword [r15 + 0x30]
je 0x14001ae4d
mov eax, 4
mov qword [rsp + 0x70], rdi
mov rdi, rax
mov dword [rsp + 0x90], r12d
mov dword [rsp + 0x60], ebp
mov qword [rsp + 0x68], rsi
mov rsi, rcx
mov rdx, qword [r15 + 0x38]
cmp rdx, rdi
cmovae rdx, rdi
mov ebp, edx
test rbp, rbp
je 0x14001ac1a
mov r12, qword [r15 + 0x28]
mov dword [r12], 1
mov dword [r12 + 4], ebp
mov rcx, qword [r15]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r15 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [r12 + 8]
test eax, eax
jg 0x14001ac0b
jl 0x14001adca
jmp 0x14001ac1a
mov rcx, rsi
mov r8, rbp
mov rdx, qword [r15 + 0x30]
call fcn.14002ef20
add rsi, rbp
sub rdi, rbp
jne 0x14001abbf
mov rdi, qword [rsp + 0x70]
mov r12d, dword [rsp + 0x90]
mov ebp, dword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
mov r8d, dword [rsp + 0x84]
test r8d, r8d
jne 0x14001ac55
cmp r13d, r12d
je 0x14001ade5
mov bl, 1
jmp 0x14001a7ed
mov r9d, dword [r15 + 0x28c]
mov rdx, qword [r14 + 0x18]
mov eax, r8d
cmp r9d, 1
jne 0x14001ac90
mov rax, rsp
lea r9, [rsp + 0x50]
mov rcx, qword [r15 + 0x290]
mov qword [rax + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r8d, dword [rsp + 0x50]
jmp 0x14001ad61
cmp r9d, 2
je 0x14001aca4
mov r8d, 0xffffffff
mov r14d, r8d
jmp 0x14001a9d8
cmp rdx, qword [r15 + 0x30]
je 0x14001ae15
test rax, rax
je 0x14001ad61
mov dword [rsp + 0x88], r13d
mov qword [rsp + 0x70], rdi
mov edi, r8d
mov dword [rsp + 0x90], r12d
mov r12, rax
mov dword [rsp + 0x60], ebp
mov qword [rsp + 0x68], rsi
mov rsi, rdx
mov rbp, qword [r15 + 0x38]
cmp rbp, r12
cmovae rbp, r12
mov ebp, ebp
test rbp, rbp
je 0x14001ad38
mov r13, qword [r15 + 0x28]
mov dword [r13], 1
mov dword [r13 + 4], ebp
mov rcx, qword [r15]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r15 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r8d, dword [r13 + 8]
test r8d, r8d
jg 0x14001ad29
jl 0x14001adf2
jmp 0x14001ad38
mov rcx, rsi
mov r8, rbp
mov rdx, qword [r15 + 0x30]
call fcn.14002ef20
add rsi, rbp
sub r12, rbp
jne 0x14001acde
mov r13d, dword [rsp + 0x88]
mov r8d, edi
mov rdi, qword [rsp + 0x70]
mov r12d, dword [rsp + 0x90]
mov ebp, dword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
test r8d, r8d
jl 0x14001ac9c
mov dword [r14], 1
lea r8, [rdi + rdi*2]
shl r8, 6
mov dword [r14 + 4], r12d
cmp dword [r8 + rsi + 0x20], 0
jne 0x14001adb8
mov eax, dword [r8 + rsi + 0x24]
cmp r12d, eax
jne 0x14001adb8
mov edx, dword [rsp + 0xa8]
mov rcx, qword [r8 + rsi + 0x30]
mov dword [r8 + rsi + 0x20], 1
mov qword [r8 + rsi + 0x18], r14
lea eax, [rax + rdx + 1]
mov dword [r8 + rsi + 0x24], eax
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
inc r12d
inc edi
cmp edi, ebp
cmovae rdi, rax
jmp 0x14001a7ca
mov rdi, qword [rsp + 0x70]
mov r12d, dword [rsp + 0x90]
mov ebp, dword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
jmp 0x14001ab69
mov r14d, dword [rsp + 0xb8]
jmp 0x14001a9d8
mov r13d, dword [rsp + 0x88]
mov rdi, qword [rsp + 0x70]
mov r12d, dword [rsp + 0x90]
mov ebp, dword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
jmp 0x14001ad61
mov rdx, qword [r15 + 0x28]
mov qword [rsp + 0x30], rdx
mov dword [rdx], 1
mov dword [rdx + 4], eax
mov rcx, qword [r15]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r15 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rax, qword [rsp + 0x30]
mov r8d, dword [rax + 8]
jmp 0x14001ad61
mov rax, qword [r15 + 0x28]
mov qword [rsp + 0x38], rax
mov dword [rax], 1
mov dword [rax + 4], 4
mov rcx, qword [r15]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r15 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rax, qword [rsp + 0x38]
mov eax, dword [rax + 8]
jmp 0x14001ab69