Function at 0x140008490
Capabilities:
Delete file

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
push rbp
lea rbp, [rsp - 0x90]
sub rsp, 0x190
mov rax, qword [0x140015010]
xor rax, rsp
mov qword [rbp + 0x80], rax
mov rcx, qword [0x140015a90]
cmp rcx, 0xffffffffffffffff
je 0x1400084de
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x140015a90], 0xffffffffffffffff
lea rcx, [rsp + 0x30]
call fcn.140002090
nop
mov rcx, rax
call fcn.140002aa0
test al, al
sete bl
mov rdx, qword [rsp + 0x48]
cmp rdx, 8
jb 0x14000853b
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x30]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140008536
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140008536
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140009f20
test bl, bl
je 0x140008546
xor al, al
jmp 0x140008745
lea rcx, [rsp + 0x50]
call fcn.140002390
nop
xor edx, edx
mov r8d, 0x108
lea rcx, [rsp + 0x70]
call sub.VCRUNTIME140.dll_memset
lea rdx, [rsp + 0x50]
cmp qword [rsp + 0x68], 8
cmovae rdx, qword [rsp + 0x50]
lea rcx, [rsp + 0x70]
call fcn.140003900
nop
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
movsxd rbx, eax
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
movsxd rcx, eax
imul rcx, rbx
movabs rax, 0x431bde82d7b634db
imul rcx
sar rdx, 0x13
mov rax, rdx
shr rax, 0x3f
add rdx, rax
imul rax, rdx, 0x1e8480
sub rcx, rax
add ecx, 0x3ab0
movsxd rsi, ecx
mov rcx, rsi
call fcn.14000a550
mov rdi, rax
xor ebx, ebx
test rsi, rsi
je 0x140008608
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
mov r9d, eax
mov eax, 0x80808081
imul r9d
add edx, r9d
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
imul ecx, edx, 0xff
sub r9d, ecx
mov byte [rbx + rdi], r9b
inc rbx
cmp rbx, rsi
jb 0x1400085d5
mov r8, rsi
mov rdx, rdi
lea rcx, [rsp + 0x70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::write_char_const____ptr64__long_long___int64_____ptr64]
lea rcx, [rsp + 0x78]
call fcn.140004000
test rax, rax
jne 0x140008646
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x70]
add rcx, rax
xor r8d, r8d
lea edx, [r8 + 2]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
mov rcx, rdi
call fcn.140009f20
lea rcx, [rsp + 0x50]
cmp qword [rsp + 0x68], 8
cmovae rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wremove]
test eax, eax
sete bl
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rsp + rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rsp + rcx + 0x6c], edx
lea rax, vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
mov qword [rsp + 0x78], rax
cmp qword [rbp - 8], 0
je 0x1400086cc
mov rax, qword [rbp - 0x70]
lea rcx, [rbp - 0x18]
cmp qword [rax], rcx
jne 0x1400086cc
mov rdx, qword [rbp + 8]
mov rcx, qword [rbp]
mov qword [rax], rcx
mov rax, qword [rbp - 0x50]
mov qword [rax], rcx
sub edx, ecx
mov rax, qword [rbp - 0x38]
mov dword [rax], edx
cmp byte [rbp - 0xc], 0
je 0x1400086dc
lea rcx, [rsp + 0x78]
call fcn.140004000
lea rcx, [rsp + 0x78]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::destructor_void____ptr64]
nop
lea rcx, [rbp - 0x80]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp + 0x18]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
nop
mov rdx, qword [rsp + 0x68]
cmp rdx, 8
jb 0x140008742
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x50]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14000873d
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14000873d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140009f20
movzx eax, bl
mov rcx, qword [rbp + 0x80]
xor rcx, rsp
call fcn.140009f00
lea r11, [rsp + 0x190]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov rsp, r11
pop rbp
ret