Function at 0x140002098
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 0x1400020c9
mov rdx, qword [rcx + 0x20]
mov r8d, dword [rcx + 0x10]
test r8d, r8d
je 0x14000212b
mov al, 1
lea rcx, [0x1400130e0]
mov r9d, esi
bt r8d, r9d
jae 0x140002109
test al, al
jne 0x1400020f2
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 0x1400020de
mov word [rcx], si
mov r8, rdx
lea rdx, [0x1400130e0]
mov ecx, 0x1011
call fcn.140003424
jmp 0x140002135
mov ecx, 0x1012
call fcn.140003424
mov ecx, 0x101d
call fcn.140003424
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 0x1400021d3
mov ecx, 0x1013
call fcn.140003424
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.1400034a0
jmp 0x140002531
lea r9, [rbp + 0x67]
mov rcx, rdi
lea r8, [0x140009988]
call fcn.140004340
mov ebx, eax
test eax, eax
jns 0x140002210
mov ecx, 0x1014
call fcn.140003424
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.1400034a0
jmp 0x140002517
mov rdx, qword [rbp + 0x67]
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 + 0x67]
mov ebx, eax
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
nop dword [rax + rax]
test ebx, ebx
jns 0x140002298
mov ecx, 0x1015
jmp 0x1400021f1
mov rcx, qword [rbp - 0x31]
lea r8, [rbp + 0x67]
lea rdx, [rbp - 0x41]
call fcn.140001a88
mov rcx, qword [rbp - 0x31]
mov ebx, eax
call qword [sym.imp.ntdll.dll_NtClose]
nop dword [rax + rax]
test ebx, ebx
jns 0x1400022c9
mov ecx, 0x1016
jmp 0x1400021f1
mov r9d, dword [rbp - 0x41]
mov ebx, 0x200
mov r8d, dword [rbp + 0x67]
mov rdx, qword [0x1400131b0]
cmp r9d, 1
jne 0x1400022fc
cmp r8d, ebx
je 0x140002315
mov ecx, 0x108b
call fcn.140003424
mov ebx, 0xc0000001
jmp 0x140002517
cmp r9d, 3
jne 0x140002315
lea rax, [0x14000c060]
cmp rdx, rax
jne 0x140002315
mov ecx, 0x108c
jmp 0x1400022ed
mov ecx, r9d
test r9d, r9d
je 0x140002354
sub ecx, 1
je 0x140002349
sub ecx, 1
je 0x14000233e
cmp ecx, 1
je 0x140002333
mov ecx, 0x1017
jmp 0x1400022ed
mov r15, qword [rdx + 0x20]
mov ebx, 0x600
jmp 0x140002357
mov r15, qword [rdx + 0x10]
mov ebx, 0x2000
jmp 0x140002357
mov r15, qword [rdx + 8]
mov ebx, 0x600
jmp 0x140002357
mov r15, qword [rdx]
xor edx, edx
mov eax, ebx
div r8d
mov r14d, ebx
test edx, edx
je 0x14000236b
sub r14d, edx
add r14d, r8d
cmp r9d, 3
jne 0x140002379
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 0x1400023b7
mov ecx, 0x1018
call fcn.140003424
mov ebx, 0xc000009a
jmp 0x140002517
mov r12d, dword [rbp + 0x67]
xor edx, edx
div r12
test edx, edx
je 0x1400023ce
mov esi, r12d
sub esi, edx
add rsi, rdi
jmp 0x1400023d1
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.140001c30
test eax, eax
jns 0x140002407
test r13b, r13b
mov r13b, 1
jne 0x140002401
mov dword [rbp - 0x3d], eax
jmp 0x140002444
mov byte [rbp + 0x77], r13b
jmp 0x14000240b
mov r13b, byte [rbp + 0x77]
mov rcx, qword [rbp - 0x51]
mov edx, 0x90020
call fcn.140001c30
test eax, eax
jns 0x140002426
mov byte [rbp + 0x7f], 1
mov dword [rbp - 0x39], eax
jmp 0x140002440
cmp r13b, 1
jne 0x140002440
mov ecx, 0x101e
call fcn.140003424
mov ecx, 0x101d
call fcn.140003424
mov r13b, byte [rbp + 0x67]
mov rcx, qword [rbp - 0x51]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
nop dword [rax + rax]
cmp eax, 0xffffffff
jne 0x140002480
mov ecx, 0x1019
call fcn.140003424
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
nop dword [rax + rax]
mov ecx, eax
call fcn.1400034a0
jmp 0x1400024db
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 0x14000254f
mov r8d, r14d
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
nop dword [rax + rax]
test eax, eax
je 0x1400024ba
cmp dword [rbp - 0x59], r14d
je 0x140002570
mov ecx, 0x101a
call fcn.140003424
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
nop dword [rax + rax]
mov ecx, eax
call fcn.1400034a0
mov rdi, qword [rbp - 0x49]
mov ebx, 0xc0000001
cmp byte [rbp + 0x77], 0
jne 0x1400024f9
test r13b, r13b
jne 0x1400024f9
mov rcx, qword [rbp - 0x51]
mov edx, 0x9001c
call fcn.140001c30
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.140003424
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.api_ms_win_core_file_l1_1_0.dll_ReadFile]
nop dword [rax + rax]
test eax, eax
je 0x1400024ba
cmp dword [rbp - 0x59], r12d
jne 0x1400024ba
xor edx, edx
mov ecx, edi
test edi, edi
je 0x14000258b
sub ecx, 1
je 0x14000258b
sub ecx, 1
je 0x1400026ba
cmp ecx, 1
jne 0x140002592
movzx edx, byte [rsi + 1]
add edx, 2
mov eax, edx
lea r9, [rax + r15]
lea rcx, [rax + rsi]
cmp edi, 3
jne 0x1400026f7
mov ebx, 0x200
mov r8d, ebx
sub r8d, edx
mov rdx, 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 0x1400025ce
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 0x140002629
imul edx, r12d, 0xb
xor r9d, r9d
xor r8d, r8d
test edx, edx
je 0x1400026b1
mov r10, rsi
lea eax, [r8 - 0x6a]
cmp eax, 1
jbe 0x1400026a6
cmp r8d, 0x70
je 0x1400026a6
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 0x140002684
lea ecx, [r12 + r12*2]
shl ecx, 2
jmp 0x1400026e3
lea rax, [0x14000c038]
mov edx, 0x54
cmp qword [0x1400131b0], rax
je 0x140002592
mov byte [rsi + 0x24], 0x80
jmp 0x140002592
mov dword [rdx + rsi], r9d
add edx, r11d
cmp edx, ecx
jb 0x1400026dc
mov r8d, ecx
mov rdx, rsi
add rcx, rsi
call sub.msvcrt.dll_memcpy
jmp 0x140002709
sub ebx, edx
mov rdx, 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.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
nop dword [rax + rax]
or r15d, 0xffffffff
cmp eax, r15d
jne 0x140002734
mov ecx, 0x1019
jmp 0x1400024bf
and qword [rsp + 0x20], 0
lea r9, [rbp - 0x59]
mov rcx, qword [rbp - 0x51]
mov rdx, rsi
cmp edi, 1
jne 0x1400027b9
mov r8d, ebx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x1400027af
cmp dword [rbp - 0x59], ebx
jne 0x1400027af
mov rcx, qword [rbp - 0x51]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1800
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
nop dword [rax + rax]
cmp eax, r15d
je 0x14000272a
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.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x1400027af
cmp dword [rbp - 0x59], ebx
je 0x1400027d2
mov ecx, 0x101b
jmp 0x1400024bf
mov r8d, r14d
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
nop dword [rax + rax]
test eax, eax
je 0x1400027af
cmp dword [rbp - 0x59], r14d
jne 0x1400027af
xor ebx, ebx
xor edx, edx
test edi, edi
je 0x140002804
sub edi, 1
je 0x1400027fb
sub edi, 1
je 0x1400027f2
cmp edi, 1
jne 0x14000280b
lea rdx, str.exFAT
jmp 0x14000280b
lea rdx, [0x140009b10]
jmp 0x14000280b
lea rdx, str.FAT32
jmp 0x14000280b
lea rdx, [0x140009af8]
cmp r13b, 1
jne 0x140002820
mov ecx, 0x101f
call fcn.140003424
mov ecx, dword [rbp - 0x3d]
jmp 0x140002833
cmp byte [rbp + 0x7f], 1
jne 0x14000284f
mov ecx, 0x1020
call fcn.140003424
mov ecx, dword [rbp - 0x39]
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ecx, eax
call fcn.1400034a0
mov rdi, qword [rbp - 0x49]
jmp 0x1400024e0
mov ecx, 0x101c
call fcn.140003424
jmp 0x140002846