Function at 0x180002680
Capabilities:
Create directory
Get common file path
Get system information on windows
Query environment variable
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
lea rbp, [rsp - 0x4e0]
sub rsp, 0x5e0
mov eax, dword [0x180186f80]
test al, 1
jne 0x1800026c3
or eax, 1
lea rcx, [0x180186f90]
mov edx, 2
mov dword [0x180186f80], eax
call fcn.180005710
lea rcx, [0x18002f810]
call fcn.1800060c0
mov rbx, qword [0x180182ea8]
xor esi, esi
test rbx, rbx
jne 0x18000278c
nop word [rax + rax]
lea rcx, [0x180186f90]
call fcn.1800057b0
test eax, eax
je 0x1800026f7
mov ecx, eax
call fcn.1800052e0
cmp qword [0x180182ea8], rsi
jne 0x180002765
mov ecx, 0x14c0
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
mov rbx, rax
test rax, rax
je 0x18000275e
lea rcx, [rax + 0x20]
mov qword [rax], rsi
xor edx, edx
mov qword [rax + 8], rsi
mov r8d, 0x1290
call sub.msvcrt.dll_memset
lea rcx, [rbx + 0x12b0]
mov qword [rbx + 0x10], rsi
xor edx, edx
mov word [rbx + 0x18], si
mov r8d, 0x208
mov qword [rbx + 0x14b8], rsi
mov dword [rbx + 0x1c], 1
call sub.msvcrt.dll_memset
mov qword [0x180182ea8], rbx
jmp 0x180002765
mov qword [0x180182ea8], rsi
lea rcx, [0x180186f90]
call fcn.1800057e0
test eax, eax
je 0x18000277c
mov ecx, eax
call fcn.1800052e0
mov rbx, qword [0x180182ea8]
test rbx, rbx
je 0x1800026e0
mov qword [rsp + 0x600], rdi
mov rcx, rbx
mov qword [rsp + 0x610], r14
call fcn.180001d90
test al, al
je 0x180002c4e
lea rdi, [rbx + 0x38]
test rdi, rdi
je 0x180002c4e
xor edx, edx
lea rcx, [rbp + 0x1d0]
mov r8d, 0x310
call sub.msvcrt.dll_memset
lea rdx, str.LdrStage
lea rcx, [rbp + 0x3d8]
call qword [sym.imp.KERNEL32.dll_lstrcpyA]
mov r8d, 0x2000
lea rdx, [0x180184ec0]
lea rcx, str._TEMP_SxS
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor edx, edx
lea rcx, [0x180184ec0]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x18000281f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x180002c4e
xor edx, edx
lea rcx, [rbp - 0x40]
mov r8d, 0x208
call sub.msvcrt.dll_memset
mov edx, 0x104
lea rcx, [rbp - 0x40]
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea r14, [0x180182ec0]
mov rcx, r14
lea r8, [0x180184ec0]
lea rdx, str._sHPCustPartUI.dll
call qword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [0x180186f20]
test al, 1
jne 0x18000288d
or eax, 1
lea rcx, [0x180186f30]
mov edx, 2
mov dword [0x180186f20], eax
call fcn.180005710
lea rcx, [0x18002f820]
call fcn.1800060c0
cmp qword [0x180182eb0], rsi
jne 0x180002907
nop word [rax + rax]
lea rcx, [0x180186f30]
call fcn.1800057b0
test eax, eax
je 0x1800028b7
mov ecx, eax
call fcn.1800052e0
cmp qword [0x180182eb0], rsi
jne 0x1800028e7
mov ecx, 0x10
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
test rax, rax
je 0x1800028e0
mov qword [rax], rsi
mov qword [rax + 8], rsi
mov qword [0x180182eb0], rax
jmp 0x1800028e7
mov qword [0x180182eb0], rsi
lea rcx, [0x180186f30]
call fcn.1800057e0
test eax, eax
je 0x1800028fe
mov ecx, eax
call fcn.1800052e0
cmp qword [0x180182eb0], rsi
je 0x1800028a0
xor eax, eax
lea rcx, [rsp + 0x60]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], rax
mov qword [rbp - 0x78], rax
call qword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov rax, qword [rsp + 0x60]
mov rbx, 0xffffffffffffffff
cmp ax, 9
je 0x18000294c
cmp ax, 6
jne 0x180002b68
mov r8d, 0x30fd8
lea rdx, [0x18003f160]
lea rcx, [rsp + 0x60]
call fcn.1800034c0
cmp byte [rsp + 0x60], sil
jne 0x1800029af
mov rdx, qword [rbp - 0x80]
cmp rdx, 0x10
jb 0x180002c4e
mov rcx, qword [rsp + 0x68]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x1800029a5
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180002c6b
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
jmp 0x180002c4e
mov qword [rsp + 0x40], r14
mov rax, rbx
nop word [rax + rax]
inc rax
cmp word [r14 + rax*2], si
jne 0x1800029c0
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x68]
movaps xmm0, xmmword [rsp + 0x40]
lea rcx, [rsp + 0x40]
movdqa xmmword [rsp + 0x40], xmm0
call fcn.1800012b0
test al, al
je 0x18000296a
lea r8, str.System32
mov edx, 0x104
lea rcx, [rbp - 0x40]
call fcn.18002b800
lea r8, [rdi + 0x440]
mov edx, 0x104
lea rcx, [rbp + 0x1d0]
call fcn.18002b8b0
lea r8, [0x180184ec0]
mov rcx, r14
lea rdx, str._sHPCustPartUI.exe
call qword [sym.imp.USER32.dll_wsprintfW]
mov r8d, 0x70dd8
lea rdx, [0x180070140]
lea rcx, [rbp - 0x70]
call fcn.1800034c0
cmp byte [rbp - 0x70], sil
jne 0x180002aa2
mov rdx, qword [rbp - 0x50]
cmp rdx, 0x10
jb 0x180002a8c
mov rcx, qword [rbp - 0x68]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x180002a87
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180002c6b
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
movdqa xmm0, xmmword [0x180035120]
movdqu xmmword [rbp - 0x58], xmm0
mov byte [rbp - 0x68], sil
jmp 0x18000296a
mov qword [rsp + 0x40], r14
mov rax, rbx
nop word [rax + rax]
inc rax
cmp word [r14 + rax*2], si
jne 0x180002ab0
mov qword [rsp + 0x48], rax
lea rdx, [rbp - 0x68]
movaps xmm0, xmmword [rsp + 0x40]
lea rcx, [rsp + 0x40]
movdqa xmmword [rsp + 0x40], xmm0
call fcn.1800012b0
mov rdx, qword [rbp - 0x50]
test al, al
je 0x180002a55
cmp rdx, 0x10
jb 0x180002b1b
mov rcx, qword [rbp - 0x68]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x180002b16
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180002c6b
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
mov rdx, qword [rbp - 0x80]
movdqa xmm0, xmmword [0x180035120]
mov byte [rbp - 0x68], sil
movdqu xmmword [rbp - 0x58], xmm0
cmp rdx, 0x10
jb 0x180002b68
mov rcx, qword [rsp + 0x68]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x180002b63
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180002c6b
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
lea r8, [0x180184ec0]
mov rcx, r14
lea rdx, str._swhite55.dat
call qword [sym.imp.USER32.dll_wsprintfW]
xor r9d, r9d
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0x80
mov edx, 0xc0000000
mov rcx, r14
mov dword [rsp + 0x20], 2
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
test rax, rax
je 0x180002c4e
mov rcx, rax
cmp rax, rbx
je 0x180002c48
lea r9, [rbp + 0x508]
mov dword [rbp + 0x508], esi
mov r8d, 0x310
mov qword [rsp + 0x20], rsi
lea rdx, [rbp + 0x1d0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea r8, [0x180184ec0]
mov rcx, r14
lea rdx, str._sHPCustPartUI.exe
call qword [sym.imp.USER32.dll_wsprintfW]
movdqa xmm0, xmmword [0x180035110]
movdqu xmmword [rsp + 0x50], xmm0
mov word [rsp + 0x40], si
nop dword [rax]
inc rbx
cmp word [r14 + rbx*2], si
jne 0x180002c20
mov r8, rbx
lea rcx, [rsp + 0x40]
call fcn.180004770
lea rcx, [rsp + 0x40]
call fcn.180001ff0
mov eax, 1
jmp 0x180002c50
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov r14, qword [rsp + 0x610]
mov rdi, qword [rsp + 0x600]
add rsp, 0x5e0
pop rsi
pop rbx
pop rbp
ret
call fcn.18002b620
int3