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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x188
xor eax, eax
xor r9d, r9d
mov r8, rcx
lea rdi, [rsp + 0x7c]
mov ecx, 0x41
mov r13d, edx
rep stosd dword [rdi], eax
mov rcx, r8
mov dword [rsp + 0x6c], r9d
lea r14, [rsp + 0x7c]
call fcn.1400449d3
cmp qword [0x140112e50], 0
mov qword [rsp + 0x50], rax
jne 0x140046c4d
lea rbx, str.Wimgapi
lea rsi, str.WIMCreateFile
mov rcx, rbx
call fcn.140044550
mov rdx, rsi
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov qword [0x140112e50], rax
test rax, rax
je 0x140046cbd
cmp qword [0x140112e18], 0
jne 0x140046c85
lea rbx, str.Wimgapi
lea rsi, str.WIMGetImageInformation
mov rcx, rbx
call fcn.140044550
mov rdx, rsi
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov qword [0x140112e18], rax
test rax, rax
je 0x140046cbd
cmp qword [0x140112e10], 0
jne 0x140046cdc
lea rbx, str.Wimgapi
lea rsi, str.WIMCloseHandle
mov rcx, rbx
call fcn.140044550
mov rdx, rsi
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov qword [0x140112e10], rax
test rax, rax
jne 0x140046cdc
call fcn.140036bd7
mov r8, rbx
mov rdx, rsi
lea rcx, [0x1400a2b36]
mov r9, rax
call fcn.140036717
jmp 0x140046f2c
test r13d, r13d
je 0x140046f2c
mov rax, qword [0x1400b1a80]
xor r9d, r9d
mov edx, 0x80000000
cmp dword [rax + 0x420], 0xdffff
seta r9b
xor ecx, ecx
xor r8d, r8d
mov qword [rsp + 0x28], rcx
shl r9d, 0x1d
mov rcx, qword [rsp + 0x50]
mov dword [rsp + 0x20], r8d
mov r8d, 3
call qword [0x140112e50]
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x140046d49
call fcn.140036bd7
lea rcx, str.__Could_not_access_image:__s
mov rdx, rax
call fcn.140036717
jmp 0x140046f2c
lea rax, [rsp + 0x6c]
mov rcx, qword [rsp + 0x48]
lea rdx, [rsp + 0x70]
mov qword [rsp + 0x58], rax
mov r8, rax
call qword [0x140112e18]
test eax, eax
je 0x140046d71
cmp dword [rsp + 0x6c], 0
jne 0x140046d8c
call fcn.140036bd7
lea rcx, str.__Could_not_access_WIM_info:__s
xor ebx, ebx
mov rdx, rax
call fcn.140036717
jmp 0x140046f28
mov rcx, qword [0x1400b1d00]
call fcn.1400449d3
lea rcx, [0x1400a3465]
mov rbp, rax
call fcn.1400449d3
mov edx, 2
mov ecx, 0x104
mov r12, rax
call sub.msvcrt.dll_calloc
xor r8d, r8d
mov rdx, r12
mov rcx, rbp
mov r9, rax
mov rdi, rax
call qword [sym.imp.KERNEL32.DLL_GetTempFileNameW]
mov r15, qword [sym.imp.KERNEL32.DLL_GetLastError]
mov ebx, eax
call r15
mov esi, eax
test ebx, ebx
je 0x140046e18
xor edx, edx
mov qword [rsp + 0x20], r14
or r9d, 0xffffffff
mov r8, rdi
mov qword [rsp + 0x38], rdx
mov ecx, 0xfde9
mov qword [rsp + 0x30], rdx
xor edx, edx
mov dword [rsp + 0x28], 0x104
call qword [sym.imp.KERNEL32.DLL_WideCharToMultiByte]
mov ebx, eax
test eax, eax
jne 0x140046e18
call r15
mov esi, eax
test rdi, rdi
je 0x140046e25
mov rcx, rdi
call sub.msvcrt.dll_free
test r12, r12
je 0x140046e32
mov rcx, r12
call sub.msvcrt.dll_free
test rbp, rbp
je 0x140046e3f
mov rcx, rbp
call sub.msvcrt.dll_free
mov ecx, esi
call qword [sym.imp.KERNEL32.DLL_SetLastError]
test ebx, ebx
je 0x140046e52
cmp byte [rsp + 0x7c], 0
jne 0x140046e73
movabs rax, 0x6d58566675525c2e
mov qword [rsp + 0x7c], rax
movabs rax, 0x706d742e6c6d58
mov qword [rsp + 0x82], rax
mov rcx, r14
call fcn.14004556a
mov r9d, 2
mov edx, 0xc0000000
mov rcx, r14
mov r8d, 1
call fcn.1400454fc
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140046f28
xor eax, eax
mov r9, qword [rsp + 0x58]
mov r8d, dword [rsp + 0x6c]
mov rcx, rbx
mov qword [rsp + 0x20], rax
mov rdx, qword [rsp + 0x70]
mov esi, 1
lea rdi, [0x1400a346b]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x140046f28
mov rcx, rdi
mov r8d, esi
mov rdx, r14
call fcn.14002284a
mov rcx, rax
test rax, rax
je 0x140046f28
call sub.msvcrt.dll_atoi
cmp eax, r13d
je 0x140046ef4
inc esi
jmp 0x140046ed0
mov esi, 1
mov rcx, qword [rsp + 0x48]
call qword [0x140112e10]
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140046f17
mov rcx, rbx
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp byte [rsp + 0x7c], 0
je 0x140046f30
mov rcx, r14
call fcn.14004556a
jmp 0x140046f30
xor esi, esi
jmp 0x140046ef9
xor esi, esi
jmp 0x140046f17
mov rcx, qword [rsp + 0x50]
call sub.msvcrt.dll_free
mov eax, esi
add rsp, 0x188
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret