Function at 0x140002250
Capabilities:
Check mutex on windows
Get common file path
Get system information on windows
Query environment variable
Read .ini file
Set current directory
Set environment variable

Disassembly:
mov r11, rsp
mov qword [r11 + 0x10], rbx
mov qword [r11 + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xf90
mov rax, qword [0x140035078]
xor rax, rsp
mov qword [rsp + 0xf80], rax
mov qword [rsp + 0xe8], rsp
mov qword [rsp + 0xf0], r8
mov rdi, rcx
mov qword [r11 - 0xec0], rcx
mov qword [r11 - 0xeb8], rcx
xor r15d, r15d
mov dword [rsp + 0x44], r15d
mov ebx, r15d
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x54], r15d
mov dword [rsp + 0x50], r15d
xor edx, edx
mov r8d, 0x62c
lea rcx, [r11 - 0xea8]
call sub.msvcrt.dll_memset
mov esi, 0x208
mov r8d, esi
xor edx, edx
lea rcx, [rsp + 0xb60]
call sub.msvcrt.dll_memset
mov r14d, r15d
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x98], r15
mov r8d, esi
xor edx, edx
lea rcx, [rsp + 0xd70]
call sub.msvcrt.dll_memset
mov r13d, r15d
mov qword [rsp + 0xa0], r15
mov qword [rsp + 0x68], r15
mov r12d, r15d
mov qword [rsp + 0x90], r15
mov dword [rsp + 0x48], r15d
call fcn.140001200
mov qword [0x140035688], rdi
mov qword [0x140035988], rdi
lea rax, [0x140035688]
mov qword [0x1400356e0], rax
lea rcx, [0x140016250]
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
nop dword [rax + rax]
mov qword [0x1400356d0], rax
lea rax, [0x140015e30]
mov qword [0x1400356c0], rax
mov qword [0x1400356a8], rax
mov qword [0x1400356b0], rax
mov qword [0x140035900], rax
mov qword [0x140035960], rax
lea rcx, [rsp + 0x54]
call fcn.14000375c
mov dword [rsp + 0x50], eax
mov r8d, esi
xor edx, edx
lea rcx, [rsp + 0x740]
call sub.msvcrt.dll_memset
xor r8d, r8d
lea edx, [r15 + 0x10]
lea rcx, str.segoeui.ttf
call qword [sym.imp.GDI32.dll_AddFontResourceExW]
nop dword [rax + rax]
lea r9d, [r15 + 5]
lea r8, [0x14002c200]
mov edi, 0x104
mov edx, edi
lea rcx, [rsp + 0x740]
call fcn.140003a3c
mov word [rsp + 0x74a], r15w
xor edx, edx
lea rcx, [rsp + 0x740]
call fcn.14001b890
lea ecx, [r15 + 1]
cmp eax, ecx
jne 0x140002434
cmp r15w, word [rsp + 0x740]
je 0x140002434
mov r8d, esi
xor edx, edx
lea rcx, [rsp + 0x950]
call sub.msvcrt.dll_memset
lea rdx, [rsp + 0x950]
lea rcx, [rsp + 0x740]
call fcn.140008738
lea rcx, [rsp + 0x110]
call fcn.140018628
lea r8, [rsp + 0x534]
mov rdx, rdi
lea rcx, [0x1400356f0]
call fcn.140002fb4
mov r8d, edi
lea rdx, [rsp + 0xb60]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
nop dword [rax + rax]
test eax, eax
je 0x140002e80
mov r14, r15
mov esi, r15d
mov dword [rsp + 0x58], r15d
cmp r15w, word [rsp + 0xb60]
je 0x14000254f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0xb60]
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
nop dword [rax + rax]
mov r15d, eax
test r15d, r15d
je 0x140002525
mov edi, r15d
add rdi, rdi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov rcx, rax
mov r8, rdi
mov edx, 8
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
nop dword [rax + rax]
mov r14, rax
test rax, rax
je 0x140002537
lea r9, [rsp + 0x98]
mov r8, rax
mov edx, r15d
lea rcx, [rsp + 0xb60]
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
nop dword [rax + rax]
xor r15d, r15d
test eax, eax
jne 0x14000253a
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov esi, eax
mov dword [rsp + 0x58], eax
jmp 0x14000253a
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov esi, eax
mov dword [rsp + 0x58], eax
xor r15d, r15d
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov qword [rsp + 0x70], r14
jmp 0x140002568
mov ecx, 0x57
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov r14, r15
mov qword [rsp + 0x70], r15
test r14, r14
je 0x140002e80
mov rax, qword [rsp + 0x98]
test rax, rax
je 0x140002e80
mov word [rax - 2], r15w
xor r8d, r8d
xor edx, edx
lea rcx, str.kernel32.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryExW]
nop dword [rax + rax]
mov rdi, rax
test rax, rax
je 0x1400025ff
lea rdx, str.SetDllDirectoryW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
nop dword [rax + rax]
test rax, rax
je 0x1400025f0
mov rcx, r14
call qword [0x140028b50]
test eax, eax
jne 0x1400025f0
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
mov esi, 0x1f
test eax, eax
cmove ebx, esi
mov dword [rsp + 0x40], ebx
jmp 0x140002e97
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
nop dword [rax + rax]
xor r8d, r8d
xor edx, edx
lea rcx, str.ORIGINAL_SETUP_WORKINGDIR_ENV_VAR
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
nop dword [rax + rax]
test eax, eax
jne 0x14000265f
lea rdx, [rsp + 0xd70]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
nop dword [rax + rax]
test eax, eax
je 0x140002e80
lea rdx, [rsp + 0xd70]
lea rcx, str.ORIGINAL_SETUP_WORKINGDIR_ENV_VAR
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
nop dword [rax + rax]
test eax, eax
je 0x140002e80
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
nop dword [rax + rax]
test eax, eax
je 0x140002e80
mov rcx, r14
call fcn.140015e70
mov esi, eax
cmp r15w, word [rsp + 0x32c]
je 0x140002718
xor edx, edx
mov r8d, 0x208
lea rcx, [rsp + 0x950]
call sub.msvcrt.dll_memset
lea rdx, [rsp + 0x950]
lea rcx, [rsp + 0x32c]
call fcn.140008738
mov edi, eax
test eax, eax
jns 0x140002895
mov dword [rsp + 0x28], eax
lea rax, [rsp + 0x32c]
mov qword [rsp + 0x20], rax
lea r9, str.wWinMain
lea r8, str._hs:_Call_to_SetApplicationLanguage_failed__lang____s___hr__0x_x
mov edx, 0x2000000
lea rcx, [0x1400356c0]
call fcn.140003040
mov dword [rsp + 0x20], edi
lea r9, [rsp + 0x32c]
mov r8d, 0x203
mov rdx, qword [0x140035688]
xor ecx, ecx
call fcn.140018bfc
jmp 0x140002e92
lea rdx, str.Product.ini
mov rcx, r14
call fcn.14000897c
mov r15, rax
xor ecx, ecx
mov edi, ecx
mov dword [rsp + 0x88], ecx
test rax, rax
je 0x140002798
mov rcx, rax
call fcn.140004f5c
test eax, eax
je 0x140002778
mov r9, r15
xor r8d, r8d
lea rdx, str.Assembly
lea rcx, [0x140028fe8]
call qword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
nop dword [rax + rax]
mov ecx, 1
cmp eax, ecx
sete dil
mov dword [rsp + 0x88], edi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, r15
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
mov r15d, dword [rsp + 0x48]
mov edx, 1
cmp dword [rsp + 0x120], edx
cmove r15d, edx
mov dword [rsp + 0x48], r15d
mov dword [rsp + 0xd8], r15d
cmp esi, 4
je 0x140002892
test edi, edi
jne 0x140002892
mov edi, 0x80004005
mov dword [rsp + 0x5c], edi
test esi, esi
je 0x140002805
lea eax, [rsi - 1]
cmp eax, edx
ja 0x14000280a
lea rcx, [rsp + 0x32c]
test r15d, r15d
mov r9d, 0x12d
jne 0x1400027f8
mov r9d, 0x12c
call fcn.14001fa20
mov edi, eax
mov dword [rsp + 0x5c], eax
jmp 0x14000280a
mov edi, 0x80070057
xor r15d, r15d
test edi, edi
js 0x140002853
cmp r15w, word [rsp + 0x32c]
je 0x14000284a
xor edx, edx
mov r8d, 0x208
lea rcx, [rsp + 0x950]
call sub.msvcrt.dll_memset
lea rdx, [rsp + 0x950]
lea rcx, [rsp + 0x32c]
call fcn.140008738
mov edi, eax
jmp 0x14000284f
mov edi, 0x80070057
test edi, edi
jns 0x140002895
mov dword [rsp + 0x20], edi
lea r9, str.wWinMain
lea r8, str._hs:_Unable_to_determine_or_set_Setup_language__hr__0x_x
mov edx, 0x2000000
lea rcx, [0x1400356c0]
call fcn.140003040
mov r9d, edi
mov r8d, 0x204
mov rdx, qword [0x140035688]
xor ecx, ecx
call fcn.140018bfc
jmp 0x140002e92
xor r15d, r15d
xor ecx, ecx
call fcn.140016390
test eax, eax
je 0x140002e92
call fcn.140008b54
test eax, eax
je 0x140002904
xorps xmm0, xmm0
movups xmmword [rsp + 0xa8], xmm0
movups xmmword [rsp + 0xb8], xmm0
movups xmmword [rsp + 0xc8], xmm0
lea rcx, [rsp + 0xa8]
call qword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
nop dword [rax + rax]
mov eax, 6
cmp ax, word [rsp + 0xa8]
jne 0x140002904
mov r8d, 0x205
mov rdx, qword [0x140035688]
xor ecx, ecx
call fcn.140018bfc
jmp 0x140002e92
xor ecx, ecx
call fcn.14001642c
test eax, eax
je 0x140002e92
xorps xmm0, xmm0
movups xmmword [rsp + 0xa8], xmm0
movups xmmword [rsp + 0xb8], xmm0
mov qword [rsp + 0x78], r15
mov ecx, 1
mov dword [rsp + 0x80], ecx
lea rcx, [rsp + 0x78]
call fcn.1400030c8
test eax, eax
jns 0x1400029a9
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140002960
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
nop dword [rax + rax]
mov qword [rsp + 0x78], r15
lea rdx, [0x140002976]
mov rcx, qword [rsp + 0xe8]
call sub.msvcrt.dll__local_unwind
nop
nop
mov eax, 0x480
mov rcx, qword [rsp + 0xf80]
xor rcx, rsp
call fcn.140023d70
lea r11, [rsp + 0xf90]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
lea rax, str.Microsoft.Windows.Setup.Local
lea r8, str.GlobalMicrosoft.Windows.Setup
cmp dword [rsp + 0x110], r15d
cmovne r8, rax
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
nop dword [rax + rax]
mov r15, rax
mov qword [rsp + 0xe0], rax
xor edi, edi
test rax, rax
je 0x140002a12
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
cmp eax, 0xb7
jne 0x140002a12
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
mov r15d, edi
mov qword [rsp + 0xe0], rdi
test r15, r15
jne 0x140002a80
lea r9, str.SpWizAppWindow
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.USER32.dll_FindWindowExW]
nop dword [rax + rax]
test rax, rax
je 0x140002a45
mov rcx, rax
call qword [sym.imp.USER32.dll_SetForegroundWindow]
nop dword [rax + rax]
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140002a60
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
nop dword [rax + rax]
mov qword [rsp + 0x78], rdi
lea rdx, [0x140002a76]
mov rcx, qword [rsp + 0xe8]
call sub.msvcrt.dll__local_unwind
nop
nop
mov eax, 0x480
jmp 0x14000297b
mov eax, 1
cmp dword [rsp + 0x11c], eax
jne 0x140002abd
mov edx, 0x12c
mov rcx, qword [0x140035688]
xor r8d, r8d
lea r9, [0x1400188f0]
mov qword [rsp + 0x20], rcx
call qword [sym.imp.USER32.dll_DialogBoxParamW]
nop dword [rax + rax]
xor r15d, r15d
jmp 0x140002e92
cmp dword [rsp + 0x120], eax
jne 0x140002acd
mov edx, 0x12d
jmp 0x140002a93
cmp esi, 4
jne 0x140002af7
lea rcx, [rsp + 0x68]
call fcn.14000b0fc
test eax, eax
js 0x140002b33
mov rcx, qword [rsp + 0x68]
call fcn.14000c538
mov r12, rax
mov qword [rsp + 0x90], rax
jmp 0x140002b33
mov edx, edi
cmp esi, eax
setne dl
add edx, 0x191
mov eax, dword [rsp + 0x48]
mov dword [rsp + 0x28], eax
lea rax, [rsp + 0x90]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x68]
lea r8, [rsp + 0x32c]
call fcn.140018e20
mov r12, qword [rsp + 0x90]
lea rcx, str.WinSetup.dll
call fcn.1400184f8
mov r13, rax
mov qword [rsp + 0xa0], rax
test rax, rax
jne 0x140002b86
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x20], eax
lea r9, str.WinSetup.dll
mov r8d, 0x1f7
mov rdx, qword [0x140035688]
mov rcx, r12
call fcn.140018bfc
jmp 0x140002ab5
sub esi, 1
je 0x140002bd5
sub esi, 1
je 0x140002b95
cmp esi, 2
jne 0x140002bcb
mov eax, dword [rsp + 0x118]
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0x32c]
xor r8d, r8d
mov rdx, r12
mov rcx, r13
call fcn.140017950
mov ebx, eax
mov dword [rsp + 0x40], eax
test eax, eax
jne 0x140002bcb
lea ecx, [rax + 1]
mov dword [rsp + 0x44], ecx
mov dword [rsp + 0x60], ecx
mov esi, 0x1f
jmp 0x140002dfd
mov qword [rsp + 0x48], rdi
movzx ecx, word [rsp + 0x124]
lea eax, [rcx - 0x61]
mov si, 0x19
cmp ax, si
jbe 0x140002bf9
sub cx, 0x41
cmp cx, si
mov eax, edi
ja 0x140002bfe
mov eax, 1
test eax, eax
jne 0x140002c5c
lea r9, [rsp + 0x48]
mov r8, r14
mov rdx, r12
mov rcx, r13
call fcn.1400179f4
test eax, eax
js 0x140002ca0
mov r8, qword [rsp + 0x48]
mov edx, 0x104
lea rcx, [rsp + 0x124]
call fcn.140002fb4
test eax, eax
js 0x140002ca0
movzx ecx, word [rsp + 0x124]
lea eax, [rcx - 0x61]
cmp ax, si
jbe 0x140002c53
sub cx, 0x41
cmp cx, si
mov eax, edi
ja 0x140002c58
mov eax, 1
test eax, eax
je 0x140002ca0
mov rcx, r13
cmp dword [rsp + 0x110], edi
je 0x140002caa
mov eax, dword [rsp + 0x118]
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0x32c]
lea r8, [rsp + 0x124]
mov rdx, r12
call fcn.140017950
mov ebx, eax
mov dword [rsp + 0x40], eax
test eax, eax
jne 0x140002ca0
lea eax, [rbx + 1]
mov dword [rsp + 0x44], eax
mov dword [rsp + 0x60], eax
mov esi, 0x1f
jmp 0x140002dc5
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
nop dword [rax + rax]
mov r13, rdi
mov qword [rsp + 0xa0], rdi
cmp di, word [rsp + 0x124]
jne 0x140002ce8
mov esi, 0x1f
mov ebx, esi
mov dword [rsp + 0x40], ebx
mov r8d, 0x1fc
mov rdx, qword [0x140035688]
jmp 0x140002d8f
lea rax, [rsp + 0x40]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0xa8]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0x20], rax
mov r9, qword [rsp + 0x98]
mov r8, r14
lea rdx, [rsp + 0x110]
call fcn.140016694
mov esi, 0x1f
test eax, eax
jne 0x140002d99
mov ebx, esi
mov dword [rsp + 0x40], ebx
mov rdx, qword [0x140035688]
test rdx, rdx
je 0x140002db0
mov ecx, dword [rsp + 0xa8]
test ecx, ecx
je 0x140002d89
sub ecx, 1
je 0x140002d72
cmp ecx, 1
jne 0x140002db0
mov rdx, qword [rsp + 0xb8]
test rdx, rdx
je 0x140002db0
mov rax, qword [rsp + 0xc0]
test eax, eax
je 0x140002db0
mov r8d, eax
jmp 0x140002d8f
mov r8, qword [rsp + 0xb0]
test r8, r8
je 0x140002db0
mov rcx, r12
call fcn.140018a38
jmp 0x140002db0
mov r8d, 0x210
mov rcx, r12
call fcn.140018bfc
jmp 0x140002db0
mov r12d, edi
mov ebx, dword [rsp + 0x40]
test ebx, ebx
sete r12b
mov dword [rsp + 0x44], r12d
mov dword [rsp + 0x60], r12d
cmp ebx, 0x4c7
jne 0x140002dc5
lea rcx, [rsp + 0x124]
call fcn.140007338
mov rdi, qword [rsp + 0x48]
xor r12d, r12d
test rdi, rdi
je 0x140002dfd
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
test eax, eax
cmovne rdi, r12
mov qword [rsp + 0x48], rdi
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
xor r15d, r15d
cmp qword [rsp + 0xb0], r15
je 0x140002e54
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov rcx, rax
mov r8, qword [rsp + 0xb0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
mov rcx, qword [rsp + 0xb0]
test eax, eax
cmovne rcx, r15
mov qword [rsp + 0xb0], rcx
lea rdi, [rsp + 0xa8]
xor eax, eax
lea ecx, [rax + 0x20]
rep stosb byte [rdi], al
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140002e97
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
nop dword [rax + rax]
mov qword [rsp + 0x78], r15
jmp 0x140002e97
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov dword [rsp + 0x40], eax
mov ebx, eax
mov esi, 0x1f
mov rdi, qword [rsp + 0x68]
test rdi, rdi
je 0x140002eb1
mov rcx, rdi
call fcn.14000a294
mov rcx, rdi
call fcn.140024370
test r14, r14
je 0x140002ed6
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, r14
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
test r13, r13
je 0x140002eea
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
nop dword [rax + rax]
mov rcx, qword [0x140035688]
mov rdi, qword [rsp + 0xf8]
cmp rcx, rdi
je 0x140002f16
test rcx, rcx
je 0x140002f0f
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
nop dword [rax + rax]
mov qword [0x140035688], rdi
cmp dword [rsp + 0x50], r15d
jl 0x140002f26
mov ecx, dword [rsp + 0x54]
call fcn.14000392c
mov eax, 1
cmp dword [rsp + 0x44], eax
jne 0x140002f36
mov ebx, r15d
jmp 0x140002f3b
test ebx, ebx
cmove ebx, esi
mov qword [0x140035960], r15
mov qword [0x140035900], r15
mov qword [0x1400356a8], r15
mov qword [0x1400356b0], r15
mov qword [0x1400356c0], r15
mov qword [0x1400356e0], r15
cmp dword [0x1400356d8], eax
jne 0x140002fa5
lea rdi, [0x140016250]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
nop dword [rax + rax]
cmp rax, rdi
mov rcx, qword [0x1400356d0]
je 0x140002f92
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
nop dword [rax + rax]
mov dword [0x1400356d8], r15d
mov eax, ebx
jmp 0x14000297b