Function at 0x140007980
Capabilities:
Check if file exists
Read file on windows
Write file on windows

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xc0
mov rdx, qword [0x1400f10c0]
mov r8, qword [0x1400f10c8]
add r8, rdx
lea r12, [rsp + 0x80]
mov byte [rsp + 0x50], 0
lea r13, [rsp + 0x50]
mov rcx, r12
mov byte [rsp + 0x70], 0
lea rbp, [rsp + 0x70]
mov qword [rsp + 0x40], r13
lea rsi, [rsp + 0x90]
mov qword [rsp + 0x60], rbp
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x68], 0
mov qword [rsp + 0x80], rsi
call fcn.1400043d0
mov rbx, qword [rsp + 0x88]
movabs rax, 0x7fffffffffffffff
cmp rbx, rax
je 0x1400085e7
mov rdx, qword [rsp + 0x80]
lea rdi, [rbx + 1]
mov eax, 0xf
cmp rdx, rsi
cmovne rax, qword [rsp + 0x90]
cmp rdi, rax
ja 0x140007e98
mov byte [rdx + rbx], 0x5c
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x88], rdi
mov byte [rax + rbx + 1], 0
mov rax, qword [0x1400c9410]
mov rcx, qword [rsp + 0x80]
mov rdx, qword [rsp + 0x88]
mov r8, qword [rax + 8]
cmp rcx, rsi
mov r9, qword [rax]
mov eax, 0xf
cmovne rax, qword [rsp + 0x90]
lea rbx, [r8 + rdx]
cmp rbx, rax
ja 0x140007e78
test r8, r8
jne 0x140007e28
mov qword [rsp + 0x88], rbx
lea rdi, [rsp + 0xb0]
mov byte [rcx + rbx], 0
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0xa0], rdi
cmp rax, rsi
je 0x140007ec0
cmp rax, rdi
mov rdx, qword [rsp + 0x90]
mov qword [rsp + 0xa0], rax
mov r8, qword [rsp + 0x88]
mov qword [rsp + 0x80], rsi
mov rcx, qword [rsp + 0x40]
mov byte [rsp + 0x90], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0xb0], rdx
mov qword [rsp + 0xa8], r8
je 0x140007efa
movq xmm0, r8
movq xmm1, rdx
cmp rcx, r13
punpcklqdq xmm0, xmm1
je 0x140007e50
test rcx, rcx
mov r9, qword [rsp + 0x50]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], r8
mov qword [rsp + 0x50], rdx
je 0x140007e5a
mov qword [rsp + 0xa0], rcx
mov qword [rsp + 0xb0], r9
mov qword [rsp + 0xa8], 0
mov byte [rcx], 0
mov rcx, qword [rsp + 0xa0]
cmp rcx, rdi
je 0x140007b81
mov rax, qword [rsp + 0xb0]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x80]
cmp rcx, rsi
je 0x140007b9f
mov rax, qword [rsp + 0x90]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x140007bed
mov rcx, qword [rsp + 0x40]
xor r9d, r9d
mov qword [rsp + 0x30], 0
mov r8d, 3
mov dword [rsp + 0x28], pe_nt_image_headers64
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
cmp rax, 0xffffffffffffffff
mov r14, rax
jne 0x140008070
mov qword [rsp + 0x80], 0
xor ecx, ecx
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], 0
mov qword [rsp + 0x98], 0
call qword [sym.imp.msvcrt.dll__time64]
mov ecx, eax
mov rbx, r12
call sub.msvcrt.dll_srand
nop
call sub.msvcrt.dll_rand
mov r8d, 0x10
mov rdx, rbx
mov ecx, eax
call sub.msvcrt.dll__itoa
add rbx, 1
cmp rbx, rsi
jne 0x140007c30
mov rcx, qword [rsp + 0x40]
xor r9d, r9d
mov qword [rsp + 0x30], 0
mov r8d, 3
mov dword [rsp + 0x28], pe_nt_image_headers64
mov edx, 0x40000000
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rcx, r12
mov r14, rax
call sub.msvcrt.dll_strlen
xor r9d, r9d
mov rdx, r12
mov rcx, r14
mov qword [rsp + 0x20], 0
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r12
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0x60]
mov rbx, rax
mov eax, 0xf
mov rsi, qword [rsp + 0x68]
cmp rcx, rbp
mov rdx, rcx
cmovne rax, qword [rsp + 0x70]
cmp rbx, rax
ja 0x140007f90
cmp rcx, r12
ja 0x140007cf0
lea r14, [rcx + rsi]
cmp r14, r12
jae 0x140007fcc
test rbx, rbx
je 0x140007d3d
cmp rbx, 1
je 0x140008057
cmp ebx, 8
jae 0x140008243
test bl, 4
jne 0x140008490
test ebx, ebx
je 0x140007d3a
movzx eax, byte [rsp + 0x80]
test bl, 2
mov byte [rcx], al
je 0x140008271
mov eax, ebx
movzx edx, word [r12 + rax - 2]
mov word [rcx + rax - 2], dx
mov rcx, qword [rsp + 0x60]
mov rdx, rcx
mov qword [rsp + 0x68], rbx
mov byte [rdx + rbx], 0
mov r12, qword [rsp + 0x60]
mov qword [rsp + 0xa0], rdi
mov rax, qword [0x1400c93d0]
test r12, r12
mov r14, qword [rax]
je 0x140007fc0
mov rcx, r12
call sub.msvcrt.dll_strlen
lea rbx, [r12 + rax]
sub rbx, r12
cmp rbx, 0xf
ja 0x140007f60
cmp rbx, 1
mov rcx, qword [rsp + 0xa0]
jne 0x140007f38
movzx eax, byte [r12]
mov byte [rcx], al
mov rcx, qword [rsp + 0xa0]
mov qword [rsp + 0xa8], rbx
lea rdx, [rsp + 0xa0]
mov r8d, 0xc
mov byte [rcx + rbx], 0
mov rcx, r14
call fcn.14000f2d0
mov rcx, qword [rsp + 0xa0]
cmp rcx, rdi
je 0x140007de0
mov rax, qword [rsp + 0xb0]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x60]
cmp rcx, rbp
je 0x140007df8
mov rax, qword [rsp + 0x70]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x40]
cmp rcx, r13
je 0x140007e11
mov rax, qword [rsp + 0x50]
lea rdx, [rax + 1]
call fcn.1400bf650
nop
add rsp, 0xc0
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
add rcx, rdx
cmp r8, 1
je 0x140008230
mov rdx, r9
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsp + 0x80]
jmp 0x140007a91
mov qword [rsp + 0x40], rax
movups xmmword [rsp + 0x48], xmm0
mov qword [rsp + 0xa0], rdi
lea rdi, [rsp + 0xb0]
mov rcx, rdi
jmp 0x140007b54
mov qword [rsp + 0x20], r8
mov rcx, r12
xor r8d, r8d
call fcn.1400acba0
mov rcx, qword [rsp + 0x80]
jmp 0x140007a91
mov qword [rsp + 0x20], 1
lea r9, [0x1400c4396]
xor r8d, r8d
mov rdx, rbx
mov rcx, r12
call fcn.1400acba0
jmp 0x140007a37
mov r8, qword [rsp + 0x88]
mov qword [rsp + 0x88], 0
mov rcx, qword [rsp + 0x40]
movdqa xmm2, xmmword [rsp + 0x90]
mov byte [rsp + 0x90], 0
movaps xmmword [rsp + 0xb0], xmm2
mov qword [rsp + 0xa8], r8
test r8, r8
je 0x140007f1e
cmp r8, 1
je 0x140008330
mov rdx, rdi
call sub.msvcrt.dll_memcpy
mov r8, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x48], r8
mov byte [rcx + r8], 0
mov rcx, qword [rsp + 0xa0]
jmp 0x140007b54
test rbx, rbx
je 0x140007da0
nop dword [rax]
mov r8, rbx
mov rdx, r12
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsp + 0xa0]
jmp 0x140007da0
test rbx, rbx
js 0x1400085f3
mov rcx, rbx
add rcx, 1
js 0x14000834c
call fcn.1400bf690
mov rcx, rax
mov qword [rsp + 0xa0], rax
mov qword [rsp + 0xb0], rbx
jmp 0x140007f48
lea rcx, [rsp + 0x60]
mov qword [rsp + 0x20], rbx
mov r9, r12
mov r8, rsi
xor edx, edx
call fcn.1400acba0
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x68], rbx
mov byte [rax + rbx], 0
jmp 0x140007d46
lea rcx, [0x1400c41f0]
call fcn.1400c0670
lea rax, [rbx - 1]
cmp rsi, rax
jbe 0x140007fed
cmp rbx, 1
je 0x140008321
mov r8, rbx
mov rdx, r12
call sub.msvcrt.dll_memmove
mov rcx, rax
cmp rbx, rsi
jbe 0x14000804d
lea rax, [r12 + rbx]
cmp r14, rax
jae 0x140008302
cmp r14, r12
ja 0x1400083b0
mov rax, r12
sub rax, rcx
sub rax, rsi
add rax, rbx
add rax, rcx
cmp rbx, 1
je 0x1400084d1
cmp ebx, 8
jae 0x1400084e0
test bl, 4
jne 0x1400085c1
test ebx, ebx
je 0x14000804d
movzx edx, byte [rax]
test bl, 2
mov byte [rcx], dl
je 0x14000804d
mov edx, ebx
movzx eax, word [rax + rdx - 2]
mov word [rcx + rdx - 2], ax
mov rdx, qword [rsp + 0x60]
jmp 0x140007d3d
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x140007d3d
mov qword [rsp + 0x80], 0
xor r9d, r9d
mov r8d, 0x20
mov rdx, r12
mov qword [rsp + 0x88], 0
mov rcx, rax
mov qword [rsp + 0x90], 0
mov qword [rsp + 0x98], 0
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r12
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0x60]
mov rbx, rax
mov eax, 0xf
mov rsi, qword [rsp + 0x68]
cmp rcx, rbp
mov rdx, rcx
cmovne rax, qword [rsp + 0x70]
cmp rbx, rax
ja 0x14000829c
cmp rcx, r12
ja 0x1400081e7
lea r14, [rcx + rsi]
cmp r14, r12
jb 0x1400081e7
lea rax, [rbx - 1]
cmp rsi, rax
jbe 0x14000812d
cmp rbx, 1
je 0x1400084c2
mov r8, rbx
mov rdx, r12
call sub.msvcrt.dll_memmove
mov rcx, rax
cmp rbx, rsi
jbe 0x140008392
lea rax, [r12 + rbx]
cmp r14, rax
jb 0x14000842e
cmp rbx, 1
je 0x14000839c
mov rdx, r12
mov r8, rbx
call sub.msvcrt.dll_memmove
mov rdx, qword [rsp + 0x60]
mov qword [rsp + 0x68], rbx
mov byte [rdx + rbx], 0
mov r12, qword [rsp + 0x60]
mov qword [rsp + 0xa0], rdi
mov rax, qword [0x1400c93d0]
test r12, r12
mov r14, qword [rax]
je 0x1400082f6
mov rcx, r12
call sub.msvcrt.dll_strlen
lea rbx, [r12 + rax]
sub rbx, r12
cmp rbx, 0xf
ja 0x1400082c6
cmp rbx, 1
mov rcx, qword [rsp + 0xa0]
jne 0x14000827b
movzx eax, byte [r12]
mov byte [rcx], al
mov rcx, qword [rsp + 0xa0]
mov qword [rsp + 0xa8], rbx
lea rdx, [rsp + 0xa0]
mov r8d, 0xc
mov byte [rcx + rbx], 0
mov rcx, r14
call fcn.14000f2d0
jmp 0x140007dc2
test rbx, rbx
je 0x14000815d
cmp rbx, 1
je 0x14000839c
cmp ebx, 8
jae 0x1400083fa
test bl, 4
jne 0x14000855c
test ebx, ebx
je 0x140008228
movzx eax, byte [rsp + 0x80]
test bl, 2
mov byte [rcx], al
jne 0x140008545
mov rcx, qword [rsp + 0x60]
mov rdx, rcx
jmp 0x14000815d
movzx eax, byte [r9]
mov byte [rcx], al
mov rcx, qword [rsp + 0x80]
jmp 0x140007a91
lea r8d, [rbx - 1]
mov eax, ebx
mov rdx, qword [r12 + rax - 8]
cmp r8d, 8
mov qword [rcx + rax - 8], rdx
jb 0x140008271
and r8d, 0xfffffff8
xor eax, eax
mov edx, eax
add eax, 8
mov r9, qword [r12 + rdx]
cmp eax, r8d
mov qword [rcx + rdx], r9
jb 0x14000825f
mov rcx, qword [rsp + 0x60]
jmp 0x140007d3a
test rbx, rbx
je 0x1400081c0
mov r8, rbx
mov rdx, r12
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsp + 0xa0]
jmp 0x1400081c0
lea rcx, [rsp + 0x60]
mov qword [rsp + 0x20], rbx
mov r9, r12
mov r8, rsi
xor edx, edx
call fcn.1400acba0
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x68], rbx
mov byte [rax + rbx], 0
jmp 0x140008166
test rbx, rbx
js 0x1400085ff
mov rcx, rbx
add rcx, 1
js 0x1400084bd
call fcn.1400bf690
mov rcx, rax
mov qword [rsp + 0xa0], rax
mov qword [rsp + 0xb0], rbx
jmp 0x140008284
lea rcx, [0x1400c41f0]
call fcn.1400c0670
cmp rbx, 1
je 0x140008057
mov rdx, r12
mov r8, rbx
call sub.msvcrt.dll_memmove
mov rdx, qword [rsp + 0x60]
jmp 0x140007d3d
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
jmp 0x140007fed
movzx eax, byte [rsp + 0xb0]
mov byte [rcx], al
mov r8, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x40]
jmp 0x140007f1e
call fcn.1400c0570
sub r14, r12
cmp r14, 1
je 0x140008527
test r14, r14
je 0x140008371
mov r8, r14
mov rdx, r12
call sub.msvcrt.dll_memmove
mov rcx, rax
lea rdx, [rcx + rbx]
mov r8, rbx
add rcx, r14
sub r8, r14
cmp r8, 1
je 0x140008536
test r8, r8
je 0x140008392
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x60]
jmp 0x14000815d
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x14000815d
sub r14, r12
cmp r14, 1
je 0x1400084ae
test r14, r14
je 0x1400083d0
mov r8, r14
mov rdx, r12
call sub.msvcrt.dll_memmove
mov rcx, rax
lea rdx, [rcx + rbx]
mov r8, rbx
add rcx, r14
sub r8, r14
cmp r8, 1
je 0x140008518
test r8, r8
je 0x14000804d
call sub.msvcrt.dll_memcpy
jmp 0x14000804d
mov eax, ebx
mov rdx, qword [r12 + rax - 8]
mov qword [rcx + rax - 8], rdx
lea edx, [rbx - 1]
cmp edx, 8
jb 0x140008223
and edx, 0xfffffff8
xor eax, eax
mov r8d, eax
add eax, 8
mov r9, qword [r12 + r8]
cmp eax, edx
mov qword [rcx + r8], r9
jb 0x140008417
jmp 0x140008223
cmp r14, r12
ja 0x140008351
mov rax, r12
sub rax, rcx
sub rax, rsi
add rax, rbx
add rax, rcx
cmp rbx, 1
je 0x14000857a
cmp ebx, 8
jae 0x140008589
test bl, 4
jne 0x1400085d4
test ebx, ebx
je 0x140008392
movzx edx, byte [rax]
test bl, 2
mov byte [rcx], dl
je 0x140008392
mov edx, ebx
movzx eax, word [rax + rdx - 2]
mov word [rcx + rdx - 2], ax
jmp 0x140008392
mov eax, dword [rsp + 0x80]
mov dword [rcx], eax
mov eax, ebx
mov edx, dword [r12 + rax - 4]
mov dword [rcx + rax - 4], edx
mov rcx, qword [rsp + 0x60]
jmp 0x140007d3a
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
jmp 0x1400083d0
call fcn.1400c0570
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
jmp 0x14000812d
movzx eax, byte [rax]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x140007d3d
mov edx, ebx
mov r8, qword [rax + rdx - 8]
mov qword [rcx + rdx - 8], r8
lea edx, [rbx - 1]
cmp edx, 8
jb 0x14000804d
and edx, 0xfffffff8
mov r8d, edx
xor edx, edx
mov r9d, edx
add edx, 8
mov r10, qword [rax + r9]
cmp edx, r8d
mov qword [rcx + r9], r10
jb 0x140008500
jmp 0x14000804d
movzx eax, byte [rdx]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x140007d3d
movzx eax, byte [rsp + 0x80]
mov byte [rcx], al
jmp 0x140008371
movzx eax, byte [rdx]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x14000815d
mov eax, ebx
movzx edx, word [r12 + rax - 2]
mov word [rcx + rax - 2], dx
mov rcx, qword [rsp + 0x60]
jmp 0x140008228
mov eax, dword [rsp + 0x80]
mov dword [rcx], eax
mov eax, ebx
mov edx, dword [r12 + rax - 4]
mov dword [rcx + rax - 4], edx
mov rcx, qword [rsp + 0x60]
jmp 0x140008228
movzx eax, byte [rax]
mov byte [rcx], al
mov rdx, qword [rsp + 0x60]
jmp 0x14000815d
mov edx, ebx
mov r8, qword [rax + rdx - 8]
mov qword [rcx + rdx - 8], r8
lea edx, [rbx - 1]
cmp edx, 8
jb 0x140008392
and edx, 0xfffffff8
mov r8d, edx
xor edx, edx
mov r9d, edx
add edx, 8
mov r10, qword [rax + r9]
cmp edx, r8d
mov qword [rcx + r9], r10
jb 0x1400085a9
jmp 0x140008392
mov edx, dword [rax]
mov dword [rcx], edx
mov edx, ebx
mov eax, dword [rax + rdx - 4]
mov dword [rcx + rdx - 4], eax
jmp 0x14000804d
mov edx, dword [rax]
mov dword [rcx], edx
mov edx, ebx
mov eax, dword [rax + rdx - 4]
mov dword [rcx + rdx - 4], eax
jmp 0x140008392
lea rcx, [0x1400c437e]
call fcn.1400c0760
lea rcx, [0x1400c41d3]
call fcn.1400c0760
lea rcx, [0x1400c41d3]
call fcn.1400c0760
mov rcx, qword [rsp + 0xa0]
mov r12, rax
cmp rcx, rdi
je 0x14000862c
mov rax, qword [rsp + 0xb0]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x60]
cmp rcx, rbp
je 0x140008644
mov rax, qword [rsp + 0x70]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, qword [rsp + 0x40]
cmp rcx, r13
je 0x14000865c
mov rax, qword [rsp + 0x50]
lea rdx, [rax + 1]
call fcn.1400bf650
mov rcx, r12
call fcn.14001b780
mov rcx, qword [rsp + 0x80]
mov r12, rax
cmp rcx, rsi
je 0x14000862c
mov rax, qword [rsp + 0x90]
lea rdx, [rax + 1]
call fcn.1400bf650
jmp 0x14000862c