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

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0xe8
mov qword [rsp + 0xa8], 0
mov dword [rsp + 0x58], 0xffffffff
mov qword [rsp + 0x50], 0
cmp qword [rsp + 0xf8], 0
jne 0x1400080a0
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x80], 0
xor eax, eax
test eax, eax
jne 0x140007dad
cmp qword [rsp + 0xf0], 0
jne 0x140007ee3
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov eax, eax
mov qword [rsp + 0xb0], rax
cmp qword [rsp + 0xb0], 0
jne 0x140007e11
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
mov rax, qword [rsp + 0xb0]
shl rax, 1
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
jne 0x140007e43
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0xc
jmp 0x1400082d3
mov rdx, qword [rsp + 0x68]
mov ecx, dword [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov qword [rsp + 0x78], 0
cmp qword [rsp + 0x68], 0
jne 0x140007e74
mov qword [rsp + 0xc0], 0
jmp 0x140007ebc
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0xc8], rax
mov qword [rsp + 0x88], 0xffffffffffffffff
inc qword [rsp + 0x88]
mov rax, qword [rsp + 0xc8]
mov rcx, qword [rsp + 0x88]
cmp word [rax + rcx*2], 0
jne 0x140007e8d
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0xc0], rax
mov r8, qword [rsp + 0xc0]
mov rdx, qword [rsp + 0x68]
lea rcx, [rsp + 0x70]
call fcn.140008f40
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140007f65
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0xd0], rax
mov qword [rsp + 0x90], 0xffffffffffffffff
inc qword [rsp + 0x90]
mov rax, qword [rsp + 0xd0]
mov rcx, qword [rsp + 0x90]
cmp byte [rax + rcx], 0
jne 0x140007eff
mov rax, qword [rsp + 0x90]
mov r8, rax
mov rdx, qword [rsp + 0xf0]
lea rcx, [rsp + 0x70]
call fcn.1400090e0
test eax, eax
jge 0x140007f43
jmp 0x1400082d3
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x78]
movzx eax, word [rax + rcx*2 - 2]
cmp eax, 0x2f
je 0x140007f65
mov dx, 0x2f
lea rcx, [rsp + 0x70]
call fcn.1400084f0
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0xffffffff
jne 0x140007fe8
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x140007f98
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
mov rcx, qword [rsp + 0x70]
call fcn.14001eb80
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
jne 0x140007fc0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
jmp 0x1400082d3
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0xffffffff
jne 0x140007fe8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
mov eax, dword [rsp + 0x40]
and eax, 0x10
test eax, eax
jne 0x140008004
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x14
jmp 0x1400082d3
lea rdx, str.libarchive_
lea rcx, [rsp + 0x70]
call fcn.140009010
lea rdx, str.XXXXXXXXXX
lea rcx, [rsp + 0x70]
call fcn.140009010
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x78]
lea rax, [rax + rcx*2]
mov qword [rsp + 0x48], rax
lea rax, str.XXXXXXXXXX
mov qword [rsp + 0xd8], rax
mov qword [rsp + 0x98], 0xffffffffffffffff
inc qword [rsp + 0x98]
mov rax, qword [rsp + 0xd8]
mov rcx, qword [rsp + 0x98]
cmp word [rax + rcx*2], 0
jne 0x140008054
mov rax, qword [rsp + 0x98]
shl rax, 1
mov rcx, qword [rsp + 0x48]
sub rcx, rax
mov rax, rcx
mov qword [rsp + 0xa0], rax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0xf8], rax
jmp 0x14000810a
mov dx, 0x58
mov rcx, qword [rsp + 0xf8]
call sub.VCRUNTIME140.dll_wcschr
mov qword [rsp + 0xa0], rax
cmp qword [rsp + 0xa0], 0
jne 0x1400080ca
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_abort]
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0x48], rax
jmp 0x1400080e7
mov rax, qword [rsp + 0x48]
add rax, 2
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x48]
movzx eax, word [rax]
cmp eax, 0x58
jne 0x1400080f8
jmp 0x1400080d9
mov rax, qword [rsp + 0x48]
movzx eax, word [rax]
test eax, eax
je 0x14000810a
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_abort]
mov dword [rsp + 0x20], 0xf0000000
mov r9d, 1
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0xa8]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x140008141
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x48]
sub rcx, rax
mov rax, rcx
sar rax, 1
mov eax, eax
shl rax, 1
mov r8, qword [rsp + 0x60]
mov edx, eax
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x140008191
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
jmp 0x1400081a1
mov rax, qword [rsp + 0x60]
add rax, 2
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0x48]
cmp qword [rsp + 0x60], rax
jae 0x1400081d7
mov rax, qword [rsp + 0x60]
movzx eax, word [rax]
xor edx, edx
mov ecx, 0x3e
div rcx
mov rax, rdx
lea rcx, str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
mov rdx, qword [rsp + 0x60]
movzx eax, word [rcx + rax*2]
mov word [rdx], ax
jmp 0x140008193
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0xf8]
call fcn.14001eb80
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
jne 0x14000820d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
jmp 0x1400082d3
mov rax, qword [rsp + 0x70]
cmp qword [rsp + 0xf8], rax
jne 0x140008226
mov dword [rsp + 0x40], 0x4000100
jmp 0x14000822e
mov dword [rsp + 0x40], 0x80
mov qword [rsp + 0x30], 0
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0010000
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0xb8], rax
cmp qword [rsp + 0xb8], 0xffffffffffffffff
jne 0x14000828f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x140008280
jmp 0x140008141
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
jmp 0x1400082d3
mov edx, 0x8002
mov rcx, qword [rsp + 0xb8]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__open_osfhandle]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0xffffffff
jne 0x1400082cc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.14001efa0
mov rcx, qword [rsp + 0xb8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400082d3
jmp 0x1400082d3
cmp qword [rsp + 0xa8], 0
je 0x1400082ee
xor edx, edx
mov rcx, qword [rsp + 0xa8]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword [rsp + 0x70]
cmp qword [rsp + 0xf8], rax
jne 0x140008312
lea rcx, [rsp + 0x70]
call fcn.140009090
mov eax, dword [rsp + 0x58]
add rsp, 0xe8
ret