Function at 0x4039af
Capabilities:
Accept command line arguments
Check os version
Copy file
Delete file
Get common file path
Get file system object information
Set current directory
Set environment variable
Shutdown system
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3f4
push ebx
push esi
push edi
push 0x20
pop edi
xor ebx, ebx
push 0x8001
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], str.Error_writing_temporary_file._Make_sure_your_temp_folder_is_valid.
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExW]
lea eax, [ebp - 0x140]
push eax
mov dword [ebp - 0x12c], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x140], 0x11c
call esi
test eax, eax
jne 0x403a39
lea eax, [ebp - 0x140]
mov dword [ebp - 0x140], 0x114
push eax
call esi
mov ax, word [ebp - 0x12c]
mov ecx, dword [ebp - 0x112]
sub ax, 0x53
add ecx, 0xffffffd0
neg ax
sbb eax, eax
mov byte [ebp - 0x26], 4
not eax
and eax, ecx
mov word [ebp - 0x2c], ax
cmp dword [ebp - 0x13c], 0xa
jae 0x403a4a
and word [ebp - 0x132], 0
mov eax, dword [ebp - 0x134]
movzx ecx, byte [ebp - 0x138]
mov dword [0x438978], eax
xor eax, eax
mov ah, byte [ebp - 0x13c]
movzx eax, ax
or eax, ecx
xor ecx, ecx
mov ch, byte [ebp - 0x2c]
movzx ecx, cx
shl eax, 0x10
or eax, ecx
movzx ecx, byte [ebp - 0x26]
or eax, ecx
mov dword [0x43897c], eax
cmp word [0x43897e], 0x600
je 0x403a9d
push ebx
call fcn.0040710c
cmp eax, ebx
je 0x403a9d
push 0xc00
call eax
mov esi, str.UXTHEME
push esi
call fcn.0040709c
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
cmp byte [esi], 0
jne 0x403aa2
push 0xb
call fcn.0040710c
push 9
call fcn.0040710c
push 7
mov dword [0x4388c4], eax
call fcn.0040710c
cmp eax, ebx
je 0x403ae5
push 0x1e
call eax
test eax, eax
je 0x403ae5
or byte [0x43897c], 0x80
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
push ebx
call dword [sym.imp.ole32.dll_OleInitialize]
mov dword [0x438980], eax
push ebx
lea eax, [ebp - 0x3f4]
push 0x2b4
push eax
push ebx
push 0x42d3c0
call dword [sym.imp.SHELL32.dll_SHGetFileInfoW]
push str.NSIS_Error
push 0x4378c0
call fcn.00406af1
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov esi, 0x443000
push eax
push esi
call fcn.00406af1
push 0x22
mov eax, esi
pop esi
mov dword [0x4388c0], 0x400000
cmp word [0x443000], si
jne 0x403b50
mov edi, esi
mov eax, 0x443002
push edi
push eax
call fcn.004063ed
push eax
call dword [sym.imp.USER32.dll_CharNextW]
mov ecx, eax
mov dword [ebp - 0xc], ecx
jmp 0x403c5a
push 0x20
pop edx
cmp ax, dx
jne 0x403b77
inc ecx
inc ecx
cmp word [ecx], dx
je 0x403b70
cmp word [ecx], si
mov dword [ebp - 8], edx
jne 0x403b84
inc ecx
mov dword [ebp - 8], esi
inc ecx
cmp word [ecx], 0x2f
jne 0x403c48
inc ecx
inc ecx
cmp word [ecx], 0x53
jne 0x403bae
mov ax, word [ecx + 2]
cmp ax, dx
je 0x403ba4
cmp ax, bx
jne 0x403bae
mov dword [0x438960], 1
movzx eax, word [0x40bfc2]
cdq
shld edx, eax, 0x10
shl eax, 0x10
mov edi, eax
xor esi, esi
movzx eax, word [0x40bfc0]
cdq
movzx edx, word [str.NCRC]
or edi, eax
movzx eax, word [0x40bfbe]
shl eax, 0x10
or eax, edx
cdq
or esi, eax
mov eax, dword [ecx]
or edi, edx
cmp eax, esi
jne 0x403c03
mov eax, dword [ecx + 4]
cmp eax, edi
jne 0x403c03
mov ax, word [ecx + 8]
cmp ax, 0x20
je 0x403bff
cmp ax, bx
jne 0x403c03
or dword [ebp - 0x10], 4
movzx eax, word [0x40bfb6]
cdq
shld edx, eax, 0x10
shl eax, 0x10
mov edi, eax
xor esi, esi
movzx eax, word [0x40bfb4]
cdq
movzx edx, word [str.__D]
or edi, eax
movzx eax, word [0x40bfb2]
shl eax, 0x10
or eax, edx
cdq
or esi, eax
mov eax, dword [ecx - 4]
or edi, edx
cmp eax, esi
jne 0x403c45
mov eax, dword [ecx]
cmp eax, edi
je 0x403c68
push 0x22
pop esi
push dword [ebp - 8]
push ecx
call fcn.004063ed
mov ecx, eax
cmp word [ecx], si
jne 0x403c5a
inc ecx
inc ecx
mov ax, word [ecx]
cmp ax, bx
jne 0x403b68
jmp 0x403c7a
mov word [ecx - 4], bx
add ecx, 4
push ecx
push 0x443800
call fcn.00406af1
mov edi, dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, 0x445800
push esi
push 0x400
call edi
call fcn.0040397e
test eax, eax
jne 0x403cec
push 0x3fb
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push str.Temp
push esi
call sub.KERNEL32.dll_lstrcatW
call fcn.0040397e
test eax, eax
jne 0x403cec
push esi
push 0x3fc
call edi
push 0x40bf9c
push esi
call sub.KERNEL32.dll_lstrcatW
mov edi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push esi
push str.TEMP
call edi
push esi
push 0x40bf88
call edi
call fcn.0040397e
test eax, eax
je 0x403ee2
push 0x445000
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push dword [ebp - 0x10]
call fcn.004034ff
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x403ee2
cmp dword [0x4388dc], ebx
je 0x403db7
push ebx
push 0x443000
call fcn.004063ed
mov edi, eax
cmp edi, 0x443000
jb 0x403d7b
movzx eax, word [0x40bf82]
cdq
shld edx, eax, 0x10
shl eax, 0x10
mov ebx, eax
movzx eax, word [0x40bf80]
movzx ecx, word [str.___]
cdq
or ebx, eax
movzx eax, word [0x40bf7e]
shl eax, 0x10
or eax, ecx
xor ecx, ecx
cdq
or ecx, eax
mov eax, ebx
or eax, edx
mov edx, dword [edi]
cmp edx, ecx
jne 0x403d6f
mov edx, dword [edi + 4]
cmp edx, eax
je 0x403d79
dec edi
dec edi
cmp edi, 0x443000
jae 0x403d62
xor ebx, ebx
cmp edi, 0x443000
mov dword [ebp - 4], str.Error_launching_installer
jb 0x403dd2
mov word [edi], bx
add edi, 8
push edi
call fcn.004064c8
test eax, eax
je 0x403ee2
push edi
push 0x443800
call fcn.00406af1
push edi
push 0x444000
call fcn.00406af1
mov dword [ebp - 4], ebx
or dword [0x43896c], 0xffffffff
call fcn.00404096
push 1
mov dword [ebp - 0x14], eax
call fcn.00406e27
jmp 0x403ee2
call fcn.00406063
push 0x40bf70
push esi
mov ebx, eax
call sub.KERNEL32.dll_lstrcatW
test ebx, ebx
je 0x403df3
push 0x40bf6c
push esi
call sub.KERNEL32.dll_lstrcatW
push str..tmp
push esi
call sub.KERNEL32.dll_lstrcatW
mov edi, 0x444800
push edi
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x403ee0
test ebx, ebx
push esi
je 0x403e1f
call fcn.00405fc9
jmp 0x403e24
call fcn.00406046
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor ebx, ebx
cmp word [0x443800], bx
jne 0x403e41
push edi
push 0x443800
call fcn.00406af1
push dword [ebp - 0xc]
push section..ndata
call fcn.00406af1
movzx eax, word [0x40bf5a]
movzx ecx, word [0x40bf58]
shl eax, 0x10
or eax, ecx
mov dword [ebp - 8], 0x1a
mov dword [0x439800], eax
mov edi, 0x42cbc0
mov eax, dword [0x4388d0]
push dword [eax + 0x120]
push edi
call fcn.00406b2e
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 4], ebx
je 0x403ecd
push 1
push edi
push 0x446800
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x403ecd
push ebx
push edi
call fcn.004068b1
mov eax, dword [0x4388d0]
push dword [eax + 0x124]
push edi
call fcn.00406b2e
push edi
call fcn.0040607b
cmp eax, ebx
je 0x403ecd
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], ebx
inc word [0x439800]
dec dword [ebp - 8]
jne 0x403e72
push ebx
push esi
call fcn.004068b1
xor ebx, ebx
call fcn.00403f9b
call dword [sym.imp.ole32.dll_OleUninitialize]
cmp dword [ebp - 4], ebx
je 0x403f07
push 0x200010
push dword [ebp - 4]
call fcn.004060f8
push 2
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp dword [0x438954], ebx
je 0x403f85
lea eax, [ebp - 0xc]
push eax
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x403f55
lea eax, [ebp - 0x20]
push eax
push str.SeShutdownPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push ebx
push ebx
lea eax, [ebp - 0x24]
push ebx
push eax
push ebx
push dword [ebp - 0xc]
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push 4
call fcn.0040710c
cmp eax, ebx
mov esi, 0x80040002
je 0x403f71
push esi
push 0x25
push ebx
push ebx
push ebx
call eax
test eax, eax
je 0x403f7e
push esi
push 2
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
jne 0x403f85
push 9
call fcn.0040140b
mov eax, dword [0x43896c]
cmp eax, 0xffffffff
je 0x403f92
mov dword [ebp - 0x14], eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ExitProcess]