Function at 0x140001e2c
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, 0x100
mov r13b, dl
xor esi, esi
mov rdx, qword [rcx + 0x18]
mov rbx, rcx
test rdx, rdx
jne 0x140001e5d
mov rdx, qword [rcx + 0x20]
mov r8d, dword [rcx + 0x10]
test r8d, r8d
je 0x140001ebf
mov al, 1
lea rcx, [0x1400160e0]
mov r9d, esi
bt r8d, r9d
jae 0x140001e9d
test al, al
jne 0x140001e86
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 0x140001e72
mov word [rcx], si
mov r8, rdx
lea rdx, [0x1400160e0]
mov ecx, 0x1011
call fcn.140003208
jmp 0x140001ec9
mov ecx, 0x1012
call fcn.140003208
mov ecx, 0x101d
call fcn.140003208
mov rdi, qword [rbx + 0x20]
lea rcx, [rbp - 0x59]
mov rdx, rdi
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
mov r14d, 0x30
mov dword [rsp + 0x28], 0x2a
lea rax, [rbp - 0x59]
mov dword [rbp - 0x49], r14d
xorps xmm0, xmm0
mov qword [rbp - 0x41], rsi
lea r9, [rbp - 0x19]
mov qword [rbp - 0x39], rax
lea r15d, [r14 + 0x10]
mov dword [rsp + 0x20], 7
lea r8, [rbp - 0x49]
mov dword [rbp - 0x31], r15d
mov edx, 0xc0100080
lea rcx, [rsp + 0x58]
movdqu xmmword [rbp - 0x29], xmm0
call qword [sym.imp.ntdll.dll_NtOpenFile]
mov ebx, eax
test eax, eax
jns 0x140001f56
mov ecx, 0x1013
call fcn.140003208
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ecx, eax
call fcn.140003280
jmp 0x1400022eb
lea r9, [rbp + 0x77]
mov rcx, rdi
lea r8, [0x14000b168]
call fcn.140003e5c
mov ebx, eax
test eax, eax
jns 0x140001f8d
mov ecx, 0x1014
call fcn.140003208
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ecx, eax
call fcn.140003280
jmp 0x1400022d6
mov rdx, qword [rbp + 0x77]
lea rcx, [rbp - 0x59]
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
lea rax, [rbp - 0x59]
mov dword [rsp + 0x28], 0x4021
xorps xmm0, xmm0
mov qword [rbp - 0x39], rax
lea r9, [rbp - 0x19]
mov dword [rbp - 0x49], r14d
lea r8, [rbp - 0x49]
mov qword [rbp - 0x41], rsi
mov edx, 0x100000
mov dword [rbp - 0x31], r15d
lea rcx, [rbp - 0x61]
mov dword [rsp + 0x20], esi
movdqu xmmword [rbp - 0x29], xmm0
call qword [sym.imp.ntdll.dll_NtOpenFile]
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]
test ebx, ebx
jns 0x140002003
mov ecx, 0x1015
jmp 0x140001f74
mov rcx, qword [rbp - 0x61]
lea r8, [rbp + 0x67]
lea rdx, [rbp - 0x71]
call fcn.1400018fc
mov rcx, qword [rbp - 0x61]
mov ebx, eax
call qword [sym.imp.ntdll.dll_NtClose]
test ebx, ebx
jns 0x14000202e
mov ecx, 0x1016
jmp 0x140001f74
mov r9d, dword [rbp - 0x71]
mov ebx, 0x200
mov r8d, dword [rbp + 0x67]
mov rdx, qword [0x1400161b0]
cmp r9d, 1
jne 0x140002061
cmp r8d, ebx
je 0x14000207a
mov ecx, 0x108b
call fcn.140003208
mov ebx, 0xc0000001
jmp 0x1400022d6
cmp r9d, 3
jne 0x14000207a
lea rax, [0x14000f060]
cmp rdx, rax
jne 0x14000207a
mov ecx, 0x108c
jmp 0x140002052
mov ecx, r9d
test r9d, r9d
je 0x1400020b9
sub ecx, 1
je 0x1400020ae
sub ecx, 1
je 0x1400020a3
cmp ecx, 1
je 0x140002098
mov ecx, 0x1017
jmp 0x140002052
mov r15, qword [rdx + 0x20]
mov ebx, 0x600
jmp 0x1400020bc
mov r15, qword [rdx + 0x10]
mov ebx, 0x2000
jmp 0x1400020bc
mov r15, qword [rdx + 8]
mov ebx, 0x600
jmp 0x1400020bc
mov r15, qword [rdx]
xor edx, edx
mov eax, ebx
div r8d
mov r14d, ebx
test edx, edx
je 0x1400020d0
sub r14d, edx
add r14d, r8d
cmp r9d, 3
jne 0x1400020de
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]
mov qword [rbp - 0x79], rax
mov rdi, rax
test rax, rax
jne 0x140002116
mov ecx, 0x1018
call fcn.140003208
mov ebx, 0xc000009a
jmp 0x1400022d6
mov r12d, dword [rbp + 0x67]
xor edx, edx
div r12
test edx, edx
je 0x14000212d
mov esi, r12d
sub esi, edx
add rsi, rdi
jmp 0x140002130
mov rsi, rdi
mov rcx, qword [rsp + 0x58]
xor eax, eax
mov dword [rsp + 0x48], eax
xor r9d, r9d
mov qword [rsp + 0x40], rax
xor r8d, r8d
mov dword [rsp + 0x38], eax
xor edx, edx
mov qword [rsp + 0x30], rax
mov dword [rbp - 0x6d], eax
mov dword [rbp - 0x69], eax
mov byte [rbp + 0x77], al
mov byte [rbp + 0x7f], al
mov byte [rbp + 0x67], al
lea rax, [rbp - 9]
mov dword [rsp + 0x28], 0x90018
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntdll.dll_NtFsControlFile]
xor ecx, ecx
test eax, eax
jns 0x140002190
test r13b, r13b
mov r13b, 1
jne 0x14000218a
mov dword [rbp - 0x6d], eax
jmp 0x1400021f4
mov byte [rbp + 0x77], r13b
jmp 0x140002193
mov r13b, cl
mov dword [rsp + 0x48], ecx
lea rax, [rbp + 7]
mov qword [rsp + 0x40], rcx
xor r9d, r9d
mov dword [rsp + 0x38], ecx
xor r8d, r8d
mov qword [rsp + 0x30], rcx
xor edx, edx
mov rcx, qword [rsp + 0x58]
mov dword [rsp + 0x28], 0x90020
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntdll.dll_NtFsControlFile]
test eax, eax
jns 0x1400021d6
mov byte [rbp + 0x7f], 1
mov dword [rbp - 0x69], eax
jmp 0x1400021f0
cmp r13b, 1
jne 0x1400021f0
mov ecx, 0x101e
call fcn.140003208
mov ecx, 0x101d
call fcn.140003208
mov r13b, byte [rbp + 0x67]
mov rcx, qword [rsp + 0x58]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x140002225
mov ecx, 0x1019
call fcn.140003208
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140003280
jmp 0x140002277
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x50]
mov edi, dword [rbp - 0x71]
mov rdx, rsi
mov rcx, qword [rsp + 0x58]
cmp edi, 3
jne 0x140002308
mov r8d, r14d
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14000225c
cmp dword [rsp + 0x50], r14d
je 0x140002324
mov ecx, 0x101a
call fcn.140003208
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140003280
mov rdi, qword [rbp - 0x79]
mov ebx, 0xc0000001
xor eax, eax
cmp byte [rbp + 0x77], al
jne 0x1400022be
test r13b, r13b
jne 0x1400022be
mov rcx, qword [rsp + 0x58]
xor r9d, r9d
mov dword [rsp + 0x48], eax
xor r8d, r8d
mov qword [rsp + 0x40], rax
xor edx, edx
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x17]
mov dword [rsp + 0x28], 0x9001c
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntdll.dll_NtFsControlFile]
mov rcx, qword gs:[0x60]
mov r8, rdi
xor edx, edx
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ntdll.dll_NtClose]
mov ecx, 0x101d
call fcn.140003208
mov eax, ebx
mov rbx, qword [rsp + 0x148]
add rsp, 0x100
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]
test eax, eax
je 0x14000225c
cmp dword [rsp + 0x50], r12d
jne 0x14000225c
xor ecx, ecx
test edi, edi
js 0x140002344
cmp edi, 1
jle 0x14000233d
cmp edi, 2
je 0x14000246c
cmp edi, 3
jne 0x140002344
movzx ecx, byte [rsi + 1]
add ecx, 2
mov eax, ecx
lea rdx, [rax + r15]
lea r9, [rax + rsi]
cmp edi, 3
jne 0x1400024a9
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 0x140002380
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 0x1400023db
imul edx, r12d, 0xb
xor r9d, r9d
xor r8d, r8d
test edx, edx
je 0x140002463
mov r10, rsi
lea eax, [r8 - 0x6a]
cmp eax, 1
jbe 0x140002458
cmp r8d, 0x70
je 0x140002458
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 0x140002436
lea ecx, [r12 + r12*2]
shl ecx, 2
jmp 0x140002495
lea rax, [0x14000f038]
mov ecx, 0x54
cmp qword [0x1400161b0], rax
je 0x140002344
mov byte [rsi + 0x24], 0x80
jmp 0x140002344
mov dword [rdx + rsi], r9d
add edx, r11d
cmp edx, ecx
jb 0x14000248e
mov r8d, ecx
mov rdx, rsi
add rcx, rsi
call sub.msvcrt.dll_memcpy
jmp 0x1400024bb
sub ebx, ecx
mov rcx, r9
mov r8d, ebx
call sub.msvcrt.dll_memcpy
mov ebx, 0x200
mov rcx, qword [rsp + 0x58]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
or r15d, 0xffffffff
cmp eax, r15d
jne 0x1400024e1
mov ecx, 0x1019
jmp 0x140002261
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
mov rdx, rsi
cmp edi, 1
jne 0x14000255b
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140002551
cmp dword [rsp + 0x50], ebx
jne 0x140002551
mov rcx, qword [rsp + 0x58]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1800
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, r15d
je 0x1400024d7
mov rcx, qword [rsp + 0x58]
lea rdx, [rsi + 0x400]
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x50]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140002551
cmp dword [rsp + 0x50], ebx
je 0x14000256f
mov ecx, 0x101b
jmp 0x140002261
mov r8d, r14d
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140002551
cmp dword [rsp + 0x50], r14d
jne 0x140002551
xor ebx, ebx
xor edx, edx
test edi, edi
je 0x1400025a1
sub edi, 1
je 0x140002598
sub edi, 1
je 0x14000258f
cmp edi, 1
jne 0x1400025a8
lea rdx, str.exFAT
jmp 0x1400025a8
lea rdx, [0x14000b2e0]
jmp 0x1400025a8
lea rdx, str.FAT32
jmp 0x1400025a8
lea rdx, [0x14000b2c8]
cmp r13b, 1
jne 0x1400025bd
mov ecx, 0x101f
call fcn.140003208
mov ecx, dword [rbp - 0x6d]
jmp 0x1400025d0
cmp byte [rbp + 0x7f], 1
jne 0x1400025e6
mov ecx, 0x1020
call fcn.140003208
mov ecx, dword [rbp - 0x69]
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ecx, eax
call fcn.140003280
mov rdi, qword [rbp - 0x79]
jmp 0x14000227c
mov ecx, 0x101c
call fcn.140003208
jmp 0x1400025dd