Function at 0x1400e66a0
Capabilities:
Check if file exists
Generate random numbers via winapi
Get common file path

Disassembly:
xor edx, edx
jmp 0x1400e66b0
mov rax, rsp
push rbx
push rbp
push rsi
push rdi
push r13
push r14
sub rsp, 0x68
xor ebp, ebp
or r13, 0xffffffffffffffff
mov r14, rdx
mov qword [rax + 0x10], rbp
mov esi, ebp
test rdx, rdx
jne 0x1400e6894
mov qword [rax - 0x58], rbp
mov qword [rax - 0x50], rbp
mov qword [rax - 0x48], rbp
test rcx, rcx
jne 0x1400e6762
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov edi, eax
test eax, eax
jne 0x1400e6706
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
jmp 0x1400e6a1a
lea rcx, [rdi + rdi]
call qword [sym.imp.msvcrt.dll_malloc]
mov rbx, rax
test rax, rax
jne 0x1400e6729
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], SafeArrayGetElemsize
jmp 0x1400e6a1a
mov rdx, rax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov qword [rsp + 0x48], rbp
mov r8, r13
nop dword [rax]
inc r8
cmp word [rbx + r8*2], si
jne 0x1400e6740
lea rcx, [rsp + 0x40]
mov rdx, rbx
call fcn.1400ea5b0
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
jmp 0x1400e67a4
mov r8, r13
inc r8
cmp byte [rcx + r8], sil
jne 0x1400e6765
mov rdx, rcx
lea rcx, [rsp + 0x40]
call fcn.1400ea1e0
test eax, eax
js 0x1400e6a1a
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x48]
cmp word [rcx + rax*2 - 2], 0x2f
je 0x1400e67a4
lea rcx, [rsp + 0x40]
mov edx, 0x2f
call fcn.1400ea060
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400e6814
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x1400e67d1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
jmp 0x1400e6a1a
mov rcx, qword [rsp + 0x40]
call fcn.1400ed880
mov rsi, rax
test rax, rax
jne 0x1400e67f4
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], SafeArrayPutElement
jmp 0x1400e6a1a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400e6814
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
jmp 0x1400e6a1a
test al, 0x10
jne 0x1400e6829
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], SafeArrayPutElement
jmp 0x1400e6a1a
lea rdx, str.libarchive_
lea rcx, [rsp + 0x40]
call fcn.1400ea0e0
lea rdx, str.XXXXXXXXXX
lea rcx, [rsp + 0x40]
call fcn.1400ea0e0
mov r14, qword [rsp + 0x40]
mov rax, qword [rsp + 0x48]
lea rbx, [r14 + rax*2]
lea rbp, [rbx - 0x14]
lea rcx, [rsp + 0xa8]
mov r9d, 1
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], 0xf0000000
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1400e68d6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
jmp 0x1400e6a1a
mov edx, 0x58
mov rcx, r14
call qword [sym.imp.msvcrt.dll_wcschr]
mov rbp, rax
test rax, rax
jne 0x1400e68b1
call qword [sym.imp.msvcrt.dll_abort]
int3
cmp word [rax], 0x58
mov rbx, rax
jne 0x1400e68ca
nop word [rax + rax]
add rbx, 2
cmp word [rbx], 0x58
je 0x1400e68c0
cmp word [rbx], si
je 0x1400e685d
call qword [sym.imp.msvcrt.dll_abort]
int3
mov qword [rsp + 0xa0], r12
mov qword [rsp + 0x60], r15
mov r15, rbx
sub r15, rbp
mov r12, r15
sar r12, 1
mov qword [rsp + 0xb0], r12
nop word [rax + rax]
mov rcx, qword [rsp + 0xa8]
lea edx, [r12 + r12]
mov r8, rbp
mov rdi, rbp
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x1400e6a00
xor eax, eax
lea r8, [r15 + 1]
shr r8, 1
cmp rbp, rbx
mov r9d, eax
cmova r8, rax
test r8, r8
je 0x1400e6990
movabs r13, 0x842108421084211
lea r12, str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
nop dword [rax]
movzx ecx, word [rdi]
mov rax, r13
inc r9
lea rdi, [rdi + 2]
mul rcx
mov eax, ecx
sub rax, rdx
shr rax, 1
add rax, rdx
shr rax, 5
imul rax, rax, 0x3e
sub rcx, rax
movzx eax, word [r12 + rcx*2]
mov word [rdi - 2], ax
cmp r9, r8
jb 0x1400e6950
mov r12, qword [rsp + 0xb0]
or r13, 0xffffffffffffffff
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
mov rcx, r14
call fcn.1400ed880
mov rsi, rax
test rax, rax
je 0x1400e6a87
cmp r14, qword [rsp + 0x40]
mov eax, pe_nt_image_headers64
mov ecx, 0x4000100
cmove eax, ecx
mov qword [rsp + 0x30], 0
mov edx, 0xc0010000
mov dword [rsp + 0x28], eax
xor r9d, r9d
xor r8d, r8d
mov rcx, rsi
mov dword [rsp + 0x20], 1
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400e6a59
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
je 0x1400e6900
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
mov r12, qword [rsp + 0xa0]
mov r15, qword [rsp + 0x60]
mov rcx, qword [rsp + 0xa8]
test rcx, rcx
je 0x1400e6a2f
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
cmp r14, qword [rsp + 0x40]
jne 0x1400e6a49
lea rcx, [rsp + 0x40]
call fcn.1400ea580
mov eax, r13d
add rsp, 0x68
pop r14
pop r13
pop rdi
pop rsi
pop rbp
pop rbx
ret
mov edx, 0x8002
mov rcx, rax
call qword [sym.imp.msvcrt.dll__open_osfhandle]
mov r13d, eax
cmp eax, 0xffffffff
jne 0x1400e6a0d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400ecfe0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400e6a0d
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], SafeArrayPutElement
jmp 0x1400e6a0d