Function at 0x140137270
Capabilities:
Delete file

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
lea rbp, [rsp - 0x80]
sub rsp, 0x180
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140137292
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rsp + 0x50]
call fcn.140136980
mov rcx, rax
call fcn.14013f9b0
mov rdx, qword [rsp + 0x68]
movzx ebx, al
cmp rdx, 7
jbe 0x1401372ec
mov rcx, qword [rsp + 0x50]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1401372e7
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1401372e7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.1401c7f18
test bl, bl
jne 0x140137303
xor al, al
mov rbx, qword [rsp + 0x1a0]
add rsp, 0x180
pop rbp
ret
mov qword [rsp + 0x190], rsi
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x198], rdi
call fcn.140136a70
cmp qword [rsp + 0x48], 7
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x70]
cmova rdx, qword [rsp + 0x30]
call fcn.14013a550
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
movsxd rcx, eax
movabs rax, 0x1c926b9d39431d5f
imul rcx
sar rdx, 0x12
mov rax, rdx
shr rax, 0x3f
add rdx, rax
imul rax, rdx, 0x23d6df
sub rcx, rax
add ecx, 0x120b5
movsxd rsi, ecx
mov rcx, rsi
call fcn.1401c8270
xor ebx, ebx
mov rdi, rax
test rsi, rsi
je 0x1401373b4
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 [rdi + rbx], r9b
inc rbx
cmp rbx, rsi
jb 0x140137381
mov r8, rsi
lea rcx, [rsp + 0x70]
mov rdx, rdi
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.14013a8e0
mov rsi, qword [rsp + 0x190]
test rax, rax
jne 0x1401373fa
mov rax, qword [rsp + 0x70]
xor r8d, r8d
movsxd rcx, dword [rax + 4]
lea edx, [r8 + 2]
lea rax, [rsp + 0x70]
add rcx, rax
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.1401c7f18
cmp qword [rsp + 0x48], 7
lea rcx, [rsp + 0x30]
cmova rcx, qword [rsp + 0x30]
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wremove]
test eax, eax
mov rax, qword [rsp + 0x70]
sete bl
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 rcx, [rsp + 0x78]
call fcn.14013a440
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]
mov rdx, qword [rsp + 0x48]
mov rdi, qword [rsp + 0x198]
cmp rdx, 7
jbe 0x1401374b1
mov rcx, qword [rsp + 0x30]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1401374ac
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1401374ac
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.1401c7f18
movzx eax, bl
mov rbx, qword [rsp + 0x1a0]
add rsp, 0x180
pop rbp
ret