Function at 0x140004bb0
Capabilities:
Get common file path
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x20], r9
push rdi
sub rsp, 0x340
mov rax, qword [0x140077020]
xor rax, rsp
mov qword [rsp + 0x330], rax
mov rax, qword [rsp + 0x350]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax + 0xb0]
test eax, eax
jne 0x140004f11
mov dword [rsp + 0x100], 0x18
mov dword [rsp + 0x110], 1
mov qword [rsp + 0x108], 0
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax + 0xb1]
test eax, eax
jne 0x140004c8a
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0xa0000000
mov dword [rsp + 0x20], 3
lea r9, [rsp + 0x100]
xor r8d, r8d
mov edx, 0xc0000000
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0x98]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rcx, qword [rsp + 0x350]
mov qword [rcx + 0xb8], rax
jmp 0x140004c9d
mov rax, qword [rsp + 0x350]
mov qword [rax + 0xb8], 0xffffffffffffffff
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0xb8], 0xffffffffffffffff
jne 0x140004f02
mov ecx, 0x208
call fcn.14001f190
mov qword [rsp + 0x70], rax
cmp qword [rsp + 0x70], 0
je 0x140004cec
mov rax, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x70]
xor eax, eax
mov ecx, 0x208
rep stosb byte [rdi], al
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x88], rax
jmp 0x140004cf8
mov qword [rsp + 0x88], 0
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0xc0], 0
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0x90], 0
je 0x140004d66
mov rax, qword [rsp + 0x350]
mov eax, dword [rax + 0xb4]
mov dword [rsp + 0x20], eax
mov rax, qword [rsp + 0x350]
mov r9, qword [rax + 0x88]
mov rax, qword [rsp + 0x350]
mov r8, qword [rax + 0x90]
lea rdx, str._hsoutput__hs__lu.txt
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.USER32.dll_wsprintfW]
jmp 0x140004dd3
lea rax, [rsp + 0x120]
mov rdi, rax
xor eax, eax
mov ecx, 0x208
rep stosb byte [rdi], al
lea rdx, [rsp + 0x120]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x140004dad
lea r8, [rsp + 0x120]
lea rdx, str._lsglobal_apt_scenarios_output.txt
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.USER32.dll_wsprintfW]
jmp 0x140004dd3
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0xc8], rax
mov edx, 2
mov rcx, qword [rsp + 0xc8]
call fcn.14001ec60
xor eax, eax
jmp 0x1400052b8
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
lea r9, [rsp + 0x100]
mov r8d, 3
mov edx, 4
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0x350]
mov qword [rcx + 0xb8], rax
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0xb8], 0xffffffffffffffff
jne 0x140004ed2
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 1
lea r9, [rsp + 0x100]
mov r8d, 3
mov edx, 0x40000000
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0x350]
mov qword [rcx + 0xb8], rax
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0xb8], 0xffffffffffffffff
jne 0x140004eaf
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0xd0], rax
mov edx, 2
mov rcx, qword [rsp + 0xd0]
call fcn.14001ec60
xor eax, eax
jmp 0x1400052b8
mov rdx, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x350]
call fcn.140004670
mov rax, qword [rsp + 0x350]
mov byte [rax + 0xb1], 1
jmp 0x140004ee1
mov rax, qword [rsp + 0x350]
mov byte [rax + 0xb1], 1
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0xd8], rax
mov edx, 2
mov rcx, qword [rsp + 0xd8]
call fcn.14001ec60
jmp 0x140004f11
mov rax, qword [rsp + 0x350]
mov byte [rax + 0xb0], 1
mov rax, qword [rsp + 0x350]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [rsp + 0x4c], 0
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0xb8], 0xffffffffffffffff
je 0x1400052b4
cmp qword [rsp + 0x358], 0
je 0x140005279
lea rax, [rsp + 0x360]
mov qword [rsp + 0x78], rax
mov r9, qword [rsp + 0x78]
mov r8, qword [rsp + 0x358]
xor edx, edx
xor ecx, ecx
call fcn.140001310
mov dword [rsp + 0x50], eax
mov eax, dword [rsp + 0x50]
inc eax
mov eax, eax
mov qword [rsp + 0xe0], rax
mov eax, 2
mov rcx, qword [rsp + 0xe0]
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov qword [rsp + 0x90], rax
mov rcx, qword [rsp + 0x90]
call fcn.14001f190
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x140005013
mov rdi, qword [rsp + 0x58]
xor eax, eax
mov rcx, qword [rsp + 0x90]
rep stosb byte [rdi], al
cmp qword [rsp + 0x58], 0
je 0x140004ff5
xor eax, eax
mov rcx, qword [rsp + 0x58]
mov word [rcx], ax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x98], rax
jmp 0x140005001
mov qword [rsp + 0x98], 0
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0xa0], rax
jmp 0x14000501f
mov qword [rsp + 0xa0], 0
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0x68], rax
mov r8, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x358]
mov rcx, qword [rsp + 0x68]
call fcn.140001400
mov qword [rsp + 0x78], 0
mov rax, qword [rsp + 0x350]
add rax, 0x28
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [rsp + 0x350]
cmp qword [rax + 0x80], 0
je 0x1400051fe
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0x350]
mov r9, qword [rax + 0x80]
lea r8, [0x140065968]
xor edx, edx
xor ecx, ecx
call fcn.140004280
mov dword [rsp + 0x48], eax
mov eax, dword [rsp + 0x48]
inc eax
mov eax, eax
mov qword [rsp + 0xe8], rax
mov eax, 2
mov rcx, qword [rsp + 0xe8]
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov qword [rsp + 0xa8], rax
mov rcx, qword [rsp + 0xa8]
call fcn.14001f190
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
je 0x140005141
mov rdi, qword [rsp + 0x60]
xor eax, eax
mov rcx, qword [rsp + 0xa8]
rep stosb byte [rdi], al
cmp qword [rsp + 0x60], 0
je 0x140005123
xor eax, eax
mov rcx, qword [rsp + 0x60]
mov word [rcx], ax
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0xb0], rax
jmp 0x14000512f
mov qword [rsp + 0xb0], 0
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0xb8], rax
jmp 0x14000514d
mov qword [rsp + 0xb8], 0
mov rax, qword [rsp + 0xb8]
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0x48]
mov rcx, qword [rsp + 0x68]
mov qword [rsp + 0x20], rcx
mov rcx, qword [rsp + 0x350]
mov r9, qword [rcx + 0x80]
lea r8, str._hs:_ls
mov edx, eax
mov rcx, qword [rsp + 0x80]
call fcn.140004280
mov eax, dword [rsp + 0x48]
shl rax, 1
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x4c]
mov r8d, eax
mov rdx, qword [rsp + 0x80]
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0xb8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0xb8]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0xf0], rax
mov edx, 2
mov rcx, qword [rsp + 0xf0]
call fcn.14001ec60
jmp 0x140005245
mov eax, dword [rsp + 0x50]
shl rax, 1
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x4c]
mov r8d, eax
mov rdx, qword [rsp + 0x68]
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0xb8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0xb8]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0xf8], rax
mov edx, 2
mov rcx, qword [rsp + 0xf8]
call fcn.14001ec60
mov rax, qword [rsp + 0x350]
add rax, 0x28
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rsp + 0x350]
movzx eax, byte [rax + 0xb1]
test eax, eax
je 0x1400052b4
mov rax, qword [rsp + 0x350]
mov rcx, qword [rax + 0xb8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x350]
mov qword [rax + 0xb8], 0xffffffffffffffff
mov eax, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x330]
xor rcx, rsp
call fcn.14001ec40
add rsp, 0x340
pop rdi
ret