Function at 0x140004160
Capabilities:
Copy file
Encode data using xor
Generate random numbers using a mersenne twister
Move file

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
push rbp
push r14
push r15
lea rbp, [rsp - 0x1560]
mov eax, 0x1660
call fcn.14006d090
sub rsp, rax
mov rax, qword [0x140089010]
xor rax, rsp
mov qword [rbp + 0x1550], rax
xor r14d, r14d
mov dword [rsp + 0x44], r14d
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
mov r8d, 0x104
lea rdx, [rbp + 0x1440]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea rcx, [rsp + 0x68]
call fcn.140017170
nop
lea rcx, [rsp + 0x48]
call fcn.140017170
nop
lea rdx, [rsp + 0x68]
cmp qword [rbp - 0x80], 0x10
cmovae rdx, qword [rsp + 0x68]
xor r8d, r8d
lea rcx, [rbp + 0x1440]
call qword [sym.imp.KERNEL32.dll_CopyFileA]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
test eax, eax
je 0x140004590
lea rdx, str.New_Copy:
call fcn.14000eea0
lea rdx, [rsp + 0x68]
cmp qword [rbp - 0x80], 0x10
cmovae rdx, qword [rsp + 0x68]
mov r8, qword [rsp + 0x78]
mov rcx, rax
call fcn.14000f950
lea rdx, [0x14000f070]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov r8d, pe_nt_image_headers64
lea rcx, [rbp - 0x70]
call sub.VCRUNTIME140.dll_memset
lea rbx, [rsp + 0x68]
cmp qword [rbp - 0x80], 0x10
cmovae rbx, qword [rsp + 0x68]
lea rax, [0x140077638]
mov qword [rbp - 0x70], rax
lea rax, [0x140072480]
mov qword [rbp - 0x60], rax
lea rcx, [rbp + 0x48]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov edi, 1
mov dword [rsp + 0x44], edi
xor r8d, r8d
lea rdx, [rbp - 0x58]
lea rcx, [rbp - 0x70]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_iostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64____ptr64]
nop
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea r15, vtable.std::basic_fstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx - 0x70], r15
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xb8]
mov dword [rbp + rcx - 0x74], edx
lea rcx, [rbp - 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
lea rax, vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
mov qword [rbp - 0x58], rax
mov byte [rbp + 0x24], r14b
mov byte [rbp + 0x19], r14b
lea rcx, [rbp - 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::_Init_void____ptr64]
mov qword [rbp + 0x28], r14
mov rax, qword [0x14010bc78]
mov qword [rbp + 0x1c], rax
mov qword [rbp + 0x10], r14
lea r8d, [r14 + 0x23]
mov rdx, rbx
lea rcx, [rbp - 0x58]
call fcn.14000ead0
test rax, rax
jne 0x140004334
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea rax, [rbp - 0x70]
add rcx, rax
xor r8d, r8d
lea edx, [rdi + 1]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
nop
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
mov qword [rbp + rcx - 0x70], r15
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xb8]
mov dword [rbp + rcx - 0x74], edx
cmp qword [rbp + 0x28], 0
je 0x14000452e
xor edx, edx
lea r8d, [rdx + 2]
lea rcx, [rbp - 0x60]
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__::seekp_long_long___int64___int____ptr64]
mov byte [rsp + 0x40], 0x20
mov ebx, 0x40
nop dword [rax + rax]
mov r8, rdi
lea rdx, [rsp + 0x40]
lea rcx, [rbp - 0x60]
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]
sub rbx, 1
jne 0x140004380
mov esi, r14d
xor edx, edx
lea r8d, [rbx + 2]
lea rcx, [rbp - 0x70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_istream_char__struct_std::char_traits_char__::seekg_long_long___int64___int____ptr64]
mov ebx, r14d
lea rdx, [rsp + 0x28]
lea rcx, [rbp - 0x70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::fpos_struct__Mbstatet____cdecl_std::basic_istream_char__struct_std::char_traits_char__::tellg_void____ptr64]
mov rcx, qword [rax + 8]
add rcx, qword [rax]
test rcx, rcx
jle 0x14000440a
nop dword [rax]
lea rdx, [rsp + 0x41]
lea rcx, [rbp - 0x70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_istream_char__struct_std::char_traits_char__::get_char____ptr64____ptr64]
inc ebx
cmp byte [rsp + 0x41], 0x56
je 0x140004408
lea rdx, [rsp + 0x28]
lea rcx, [rbp - 0x70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::fpos_struct__Mbstatet____cdecl_std::basic_istream_char__struct_std::char_traits_char__::tellg_void____ptr64]
mov rcx, qword [rax + 8]
add rcx, qword [rax]
movsxd rax, ebx
cmp rax, rcx
jl 0x1400043d0
jmp 0x14000440a
mov esi, ebx
call qword [sym.imp.MSVCP140.dll_unsigned_int___cdecl_std::_Random_device_void_]
mov dword [rbp + 0x1434], 0xffffffff
mov dword [rbp + 0xb4], eax
mov r9d, 0x270
nop word [rax + rax]
mov ecx, eax
shr ecx, 0x1e
xor ecx, eax
imul eax, ecx, 0x6c078965
add eax, edi
mov dword [rbp + rdi*4 + 0xb4], eax
inc rdi
cmp rdi, r9
jb 0x140004430
mov dword [rbp + 0xb0], r9d
lea r8, [rbp + 0xb8]
nop dword [rax]
mov edx, dword [r8 - 4]
xor edx, dword [r8]
btr edx, 0x1f
xor edx, dword [r8 - 4]
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
and ecx, 0x9908b0df
shr edx, 1
xor ecx, edx
xor ecx, dword [r8 + 0x630]
mov dword [r8 + 0x9bc], ecx
lea r8, [r8 + 4]
sub r9, 1
jne 0x140004460
mov eax, dword [rbp + 0xb0]
mov ecx, dword [rbp + rax*4 + 0xb4]
mov eax, ecx
shr eax, 0xb
and eax, dword [rbp + 0x1434]
xor ecx, eax
mov eax, ecx
and eax, 0xff3a58ad
shl eax, 7
xor ecx, eax
mov eax, ecx
and eax, 0xffffdf8c
shl eax, 0xf
xor ecx, eax
mov eax, ecx
shr eax, 0x12
xor eax, ecx
mov dword [rsp + 0x44], eax
movsxd rdx, esi
xor r8d, r8d
lea rcx, [rbp - 0x60]
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__::seekp_long_long___int64___int____ptr64]
mov r8d, 4
lea rdx, [rsp + 0x44]
lea rcx, [rbp - 0x60]
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, [rbp - 0x58]
call fcn.14000ea10
test rax, rax
jne 0x140004525
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea rax, [rbp - 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]
lea rdx, [0x140070e06]
jmp 0x140004535
lea rdx, str.Error_opening_file.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.14000eea0
lea rdx, [0x14000f070]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
nop
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
mov qword [rbp + rcx - 0x70], r15
mov rax, qword [rbp - 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xb8]
mov dword [rbp + rcx - 0x74], edx
lea rcx, [rbp - 0x58]
call fcn.14000e130
lea rcx, [rbp - 0x50]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_iostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp + 0x48]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
jmp 0x1400045c0
lea rdx, str.Error_copying_file._Error_code:
call fcn.14000eea0
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rbx
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__::operator___unsigned_long_int____ptr64]
lea rdx, [0x14000f070]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
lea rdx, [rsp + 0x48]
cmp qword [rsp + 0x60], 0x10
cmovae rdx, qword [rsp + 0x48]
lea rcx, [rbp + 0x1440]
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll_rename]
test eax, eax
je 0x140004605
lea rdx, [0x140070e06]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.14000eea0
lea rdx, [0x14000f070]
mov rcx, rax
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__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rdi, qword [rsp + 0x58]
lea r9, [rsp + 0x48]
cmp qword [rsp + 0x60], 0x10
cmovae r9, qword [rsp + 0x48]
mov rax, qword [0x14010a320]
cmp rdi, rax
ja 0x140004655
lea rbx, [0x14010a308]
cmp rax, 0x10
cmovae rbx, qword [0x14010a308]
mov qword [0x14010a318], rdi
mov r8, rdi
mov rdx, r9
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
mov byte [rbx + rdi], 0
jmp 0x140004665
mov rdx, rdi
lea rcx, [0x14010a308]
call fcn.14000f320
nop
mov rdx, qword [rsp + 0x60]
cmp rdx, 0x10
jb 0x1400046a5
inc rdx
mov rcx, qword [rsp + 0x48]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400046a0
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400046a0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14006c3b0
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x60], 0xf
mov byte [rsp + 0x48], 0
mov rdx, qword [rbp - 0x80]
cmp rdx, 0x10
jb 0x1400046f7
inc rdx
mov rcx, qword [rsp + 0x68]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400046f2
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400046f2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14006c3b0
mov rcx, qword [rbp + 0x1550]
xor rcx, rsp
call fcn.14006c020
lea r11, [rsp + 0x1660]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x30]
mov rsp, r11
pop r15
pop r14
pop rbp
ret