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

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0xb0
mov r13b, dl
xor esi, esi
mov rdx, qword [rcx + 0x18]
mov rbx, rcx
test rdx, rdx
jne 0x1400020b9
mov rdx, qword [rcx + 0x20]
mov r8d, dword [rcx + 0x10]
test r8d, r8d
je 0x14000211b
mov al, 1
lea rcx, [0x1400170e0]
mov r9d, esi
bt r8d, r9d
jae 0x1400020f9
test al, al
jne 0x1400020e2
mov dword [rcx], 0x20002c
add rcx, 4
lea eax, [r9 + 0x41]
mov word [rcx], ax
mov eax, 0x3a
mov word [rcx + 2], ax
add rcx, 4
mov al, sil
inc r9d
cmp r9d, 0x19
jbe 0x1400020ce
mov word [rcx], si
mov r8, rdx
lea rdx, [0x1400170e0]
mov ecx, 0x1011
call fcn.140003408
jmp 0x140002125
mov ecx, 0x1012
call fcn.140003408
mov ecx, 0x101d
call fcn.140003408
mov rdi, qword [rbx + 0x20]
lea rcx, [rbp - 0x29]
mov rdx, rdi
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
nop dword [rax + rax]
mov r14d, 0x30
mov dword [rsp + 0x28], 0x2a
lea rax, [rbp - 0x29]
mov dword [rbp - 0x19], r14d
xorps xmm0, xmm0
mov qword [rbp - 0x11], rsi
lea r9, [rbp + 0x17]
mov qword [rbp - 9], rax
lea r15d, [r14 + 0x10]
mov dword [rsp + 0x20], 7
lea r8, [rbp - 0x19]
mov dword [rbp - 1], r15d
mov edx, 0xc0100080
lea rcx, [rbp - 0x51]
movdqu xmmword [rbp + 7], xmm0
call qword [sym.imp.ntdll.dll_NtOpenFile]
nop dword [rax + rax]
mov ebx, eax
test eax, eax
jns 0x1400021c3
mov ecx, 0x1013
call fcn.140003408
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.140003484
jmp 0x140002521
lea r9, [rbp + 0x77]
mov rcx, rdi
lea r8, [0x14000c188]
call fcn.140004344
mov ebx, eax
test eax, eax
jns 0x140002200
mov ecx, 0x1014
call fcn.140003408
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.140003484
jmp 0x140002507
mov rdx, qword [rbp + 0x77]
lea rcx, [rbp - 0x29]
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
nop dword [rax + rax]
lea rax, [rbp - 0x29]
mov dword [rsp + 0x28], 0x4021
xorps xmm0, xmm0
mov qword [rbp - 9], rax
lea r9, [rbp + 0x17]
mov dword [rbp - 0x19], r14d
lea r8, [rbp - 0x19]
mov qword [rbp - 0x11], rsi
mov edx, 0x100000
mov dword [rbp - 1], r15d
lea rcx, [rbp - 0x31]
mov dword [rsp + 0x20], esi
movdqu xmmword [rbp + 7], xmm0
call qword [sym.imp.ntdll.dll_NtOpenFile]
nop dword [rax + rax]
mov rcx, qword gs:[0x60]
xor edx, edx
mov r8, qword [rbp + 0x77]
mov ebx, eax
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
nop dword [rax + rax]
test ebx, ebx
jns 0x140002288
mov ecx, 0x1015
jmp 0x1400021e1
mov rcx, qword [rbp - 0x31]
lea r8, [rbp + 0x67]
lea rdx, [rbp - 0x41]
call fcn.140001a78
mov rcx, qword [rbp - 0x31]
mov ebx, eax
call qword [sym.imp.ntdll.dll_NtClose]
nop dword [rax + rax]
test ebx, ebx
jns 0x1400022b9
mov ecx, 0x1016
jmp 0x1400021e1
mov r9d, dword [rbp - 0x41]
mov ebx, 0x200
mov r8d, dword [rbp + 0x67]
mov rdx, qword [0x1400171b0]
cmp r9d, 1
jne 0x1400022ec
cmp r8d, ebx
je 0x140002305
mov ecx, 0x108b
call fcn.140003408
mov ebx, 0xc0000001
jmp 0x140002507
cmp r9d, 3
jne 0x140002305
lea rax, [0x140010060]
cmp rdx, rax
jne 0x140002305
mov ecx, 0x108c
jmp 0x1400022dd
mov ecx, r9d
test r9d, r9d
je 0x140002344
sub ecx, 1
je 0x140002339
sub ecx, 1
je 0x14000232e
cmp ecx, 1
je 0x140002323
mov ecx, 0x1017
jmp 0x1400022dd
mov r15, qword [rdx + 0x20]
mov ebx, 0x600
jmp 0x140002347
mov r15, qword [rdx + 0x10]
mov ebx, 0x2000
jmp 0x140002347
mov r15, qword [rdx + 8]
mov ebx, 0x600
jmp 0x140002347
mov r15, qword [rdx]
xor edx, edx
mov eax, ebx
div r8d
mov r14d, ebx
test edx, edx
je 0x14000235b
sub r14d, edx
add r14d, r8d
cmp r9d, 3
jne 0x140002369
lea r14d, [r8 + r8*2]
shl r14d, 3
mov rcx, qword gs:[0x60]
add r8d, r14d
xor edx, edx
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
nop dword [rax + rax]
mov qword [rbp - 0x49], rax
mov rdi, rax
test rax, rax
jne 0x1400023a7
mov ecx, 0x1018
call fcn.140003408
mov ebx, 0xc000009a
jmp 0x140002507
mov r12d, dword [rbp + 0x67]
xor edx, edx
div r12
test edx, edx
je 0x1400023be
mov esi, r12d
sub esi, edx
add rsi, rdi
jmp 0x1400023c1
mov rsi, rdi
mov rcx, qword [rbp - 0x51]
xor eax, eax
mov edx, 0x90018
mov dword [rbp - 0x3d], eax
mov dword [rbp - 0x39], eax
mov byte [rbp + 0x77], al
mov byte [rbp + 0x7f], al
mov byte [rbp + 0x67], al
call fcn.140001c20
test eax, eax
jns 0x1400023f7
test r13b, r13b
mov r13b, 1
jne 0x1400023f1
mov dword [rbp - 0x3d], eax
jmp 0x140002434
mov byte [rbp + 0x77], r13b
jmp 0x1400023fb
mov r13b, byte [rbp + 0x77]
mov rcx, qword [rbp - 0x51]
mov edx, 0x90020
call fcn.140001c20
test eax, eax
jns 0x140002416
mov byte [rbp + 0x7f], 1
mov dword [rbp - 0x39], eax
jmp 0x140002430
cmp r13b, 1
jne 0x140002430
mov ecx, 0x101e
call fcn.140003408
mov ecx, 0x101d
call fcn.140003408
mov r13b, byte [rbp + 0x67]
mov rcx, qword [rbp - 0x51]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
nop dword [rax + rax]
cmp eax, 0xffffffff
jne 0x140002470
mov ecx, 0x1019
call fcn.140003408
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ecx, eax
call fcn.140003484
jmp 0x1400024cb
and qword [rsp + 0x20], 0
lea r9, [rbp - 0x59]
mov edi, dword [rbp - 0x41]
mov rdx, rsi
mov rcx, qword [rbp - 0x51]
cmp edi, 3
jne 0x14000253f
mov r8d, r14d
call qword [sym.imp.KERNEL32.dll_ReadFile]
nop dword [rax + rax]
test eax, eax
je 0x1400024aa
cmp dword [rbp - 0x59], r14d
je 0x140002560
mov ecx, 0x101a
call fcn.140003408
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ecx, eax
call fcn.140003484
mov rdi, qword [rbp - 0x49]
mov ebx, 0xc0000001
cmp byte [rbp + 0x77], 0
jne 0x1400024e9
test r13b, r13b
jne 0x1400024e9
mov rcx, qword [rbp - 0x51]
mov edx, 0x9001c
call fcn.140001c20
mov rcx, qword gs:[0x60]
mov r8, rdi
xor edx, edx
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
nop dword [rax + rax]
mov rcx, qword [rbp - 0x51]
call qword [sym.imp.ntdll.dll_NtClose]
nop dword [rax + rax]
mov ecx, 0x101d
call fcn.140003408
mov eax, ebx
mov rbx, qword [rsp + 0xf8]
add rsp, 0xb0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov r8d, r12d
call qword [sym.imp.KERNEL32.dll_ReadFile]
nop dword [rax + rax]
test eax, eax
je 0x1400024aa
cmp dword [rbp - 0x59], r12d
jne 0x1400024aa
xor ecx, ecx
test edi, edi
js 0x140002580
cmp edi, 1
jle 0x140002579
cmp edi, 2
je 0x1400026a8
cmp edi, 3
jne 0x140002580
movzx ecx, byte [rsi + 1]
add ecx, 2
mov eax, ecx
lea rdx, [rax + r15]
lea r9, [rax + rsi]
cmp edi, 3
jne 0x1400026e5
mov ebx, 0x200
mov r8d, ebx
sub r8d, ecx
mov rcx, r9
call sub.msvcrt.dll_memcpy
lea r11d, [rdi + 1]
mov edx, r11d
lea rax, [rsi + r12]
lea rcx, [r15 + 0x200]
lea r8d, [rdi + 0x7d]
movups xmm0, xmmword [rcx]
movups xmmword [rax], xmm0
movups xmm1, xmmword [rcx + 0x10]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [rcx + 0x20]
movups xmmword [rax + 0x20], xmm0
movups xmm1, xmmword [rcx + 0x30]
movups xmmword [rax + 0x30], xmm1
movups xmm0, xmmword [rcx + 0x40]
movups xmmword [rax + 0x40], xmm0
movups xmm1, xmmword [rcx + 0x50]
movups xmmword [rax + 0x50], xmm1
movups xmm0, xmmword [rcx + 0x60]
movups xmmword [rax + 0x60], xmm0
add rax, r8
movups xmm1, xmmword [rcx + 0x70]
add rcx, r8
movups xmmword [rax - 0x10], xmm1
sub rdx, 1
jne 0x1400025bc
lea eax, [r12 + r12]
mov rdx, r11
add rax, rsi
lea rcx, [r15 + 0x400]
movups xmm0, xmmword [rcx]
movups xmmword [rax], xmm0
movups xmm1, xmmword [rcx + 0x10]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [rcx + 0x20]
movups xmmword [rax + 0x20], xmm0
movups xmm1, xmmword [rcx + 0x30]
movups xmmword [rax + 0x30], xmm1
movups xmm0, xmmword [rcx + 0x40]
movups xmmword [rax + 0x40], xmm0
movups xmm1, xmmword [rcx + 0x50]
movups xmmword [rax + 0x50], xmm1
movups xmm0, xmmword [rcx + 0x60]
movups xmmword [rax + 0x60], xmm0
add rax, r8
movups xmm1, xmmword [rcx + 0x70]
add rcx, r8
movups xmmword [rax - 0x10], xmm1
sub rdx, 1
jne 0x140002617
imul edx, r12d, 0xb
xor r9d, r9d
xor r8d, r8d
test edx, edx
je 0x14000269f
mov r10, rsi
lea eax, [r8 - 0x6a]
cmp eax, 1
jbe 0x140002694
cmp r8d, 0x70
je 0x140002694
movzx eax, byte [r10]
mov ecx, r9d
shr ecx, 1
shl r9d, 0x1f
add r9d, ecx
add r9d, eax
inc r8d
inc r10
cmp r8d, edx
jb 0x140002672
lea ecx, [r12 + r12*2]
shl ecx, 2
jmp 0x1400026d1
lea rax, [0x140010038]
mov ecx, 0x54
cmp qword [0x1400171b0], rax
je 0x140002580
mov byte [rsi + 0x24], 0x80
jmp 0x140002580
mov dword [rdx + rsi], r9d
add edx, r11d
cmp edx, ecx
jb 0x1400026ca
mov r8d, ecx
mov rdx, rsi
add rcx, rsi
call sub.msvcrt.dll_memcpy
jmp 0x1400026f7
sub ebx, ecx
mov rcx, r9
mov r8d, ebx
call sub.msvcrt.dll_memcpy
mov ebx, 0x200
mov rcx, qword [rbp - 0x51]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
nop dword [rax + rax]
or r15d, 0xffffffff
cmp eax, r15d
jne 0x140002722
mov ecx, 0x1019
jmp 0x1400024af
and qword [rsp + 0x20], 0
lea r9, [rbp - 0x59]
mov rcx, qword [rbp - 0x51]
mov rdx, rsi
cmp edi, 1
jne 0x1400027a7
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x14000279d
cmp dword [rbp - 0x59], ebx
jne 0x14000279d
mov rcx, qword [rbp - 0x51]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1800
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
nop dword [rax + rax]
cmp eax, r15d
je 0x140002718
mov rcx, qword [rbp - 0x51]
lea rdx, [rsi + 0x400]
and qword [rsp + 0x20], 0
lea r9, [rbp - 0x59]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x14000279d
cmp dword [rbp - 0x59], ebx
je 0x1400027c0
mov ecx, 0x101b
jmp 0x1400024af
mov r8d, r14d
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x14000279d
cmp dword [rbp - 0x59], r14d
jne 0x14000279d
xor ebx, ebx
xor edx, edx
test edi, edi
je 0x1400027f2
sub edi, 1
je 0x1400027e9
sub edi, 1
je 0x1400027e0
cmp edi, 1
jne 0x1400027f9
lea rdx, str.exFAT
jmp 0x1400027f9
lea rdx, [0x14000c310]
jmp 0x1400027f9
lea rdx, str.FAT32
jmp 0x1400027f9
lea rdx, [0x14000c2f8]
cmp r13b, 1
jne 0x14000280e
mov ecx, 0x101f
call fcn.140003408
mov ecx, dword [rbp - 0x3d]
jmp 0x140002821
cmp byte [rbp + 0x7f], 1
jne 0x14000283d
mov ecx, 0x1020
call fcn.140003408
mov ecx, dword [rbp - 0x39]
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.140003484
mov rdi, qword [rbp - 0x49]
jmp 0x1400024d0
mov ecx, 0x101c
call fcn.140003408
jmp 0x140002834