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

Disassembly:
sub esp, 0x3f8
push ebx
push esi
push edi
push 0x20
pop edi
xor ebx, ebx
push 0x8001
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], str.Error_writing_temporary_file._Make_sure_your_temp_folder_is_valid.
mov dword [esp + 0x10], ebx
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExW]
lea eax, [esp + 0x34]
push eax
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x14c], ebx
mov dword [esp + 0x150], ebx
mov dword [esp + 0x38], 0x11c
call esi
test eax, eax
jne 0x403a63
lea eax, [esp + 0x34]
push eax
mov dword [esp + 0x38], 0x114
call esi
mov ax, word [esp + 0x48]
mov ecx, dword [esp + 0x62]
sub ax, 0x53
add ecx, 0xffffffd0
neg ax
mov byte [esp + 0x14e], 4
sbb eax, eax
not eax
and eax, ecx
mov word [esp + 0x148], ax
cmp dword [esp + 0x38], 0xa
jae 0x403a72
and dword [esp + 0x40], 0xffff
mov eax, dword [esp + 0x40]
movzx ecx, byte [esp + 0x3c]
mov dword [0x42a678], eax
xor eax, eax
mov ah, byte [esp + 0x38]
movzx eax, ax
or eax, ecx
xor ecx, ecx
mov ch, byte [esp + 0x148]
shl eax, 0x10
movzx ecx, cx
or eax, ecx
movzx ecx, byte [esp + 0x14e]
or eax, ecx
mov dword [0x42a67c], eax
cmp word [0x42a67e], 0x600
je 0x403ac7
push ebx
call fcn.004065fb
cmp eax, ebx
je 0x403ac7
push 0xc00
call eax
mov esi, str.UXTHEME
push esi
call fcn.0040658b
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
cmp byte [esi], bl
jne 0x403acc
push 0xd
call fcn.004065fb
push 0xb
call fcn.004065fb
push 9
mov dword [0x42a580], eax
call fcn.004065fb
cmp eax, ebx
je 0x403b0e
push 0x1e
call eax
test eax, eax
je 0x403b0e
or byte [0x42a67c], 0x80
push ebp
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
push ebx
call dword [sym.imp.ole32.dll_OleInitialize]
push ebx
push 0x2b4
mov dword [0x42a680], eax
lea eax, [esp + 0x15c]
push eax
push ebx
push 0x4095d4
call dword [sym.imp.SHELL32.dll_SHGetFileInfoW]
push str.NSIS_Error
push 0x429580
call fcn.00406478
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
mov ebp, 0x435000
push ebp
call fcn.00406478
push 0x22
pop esi
cmp word [0x435000], si
mov dword [0x42a588], 0x400000
mov eax, ebp
jne 0x403b7b
mov edi, esi
mov eax, 0x435002
push edi
push eax
call fcn.00405fc1
push eax
call dword [sym.imp.USER32.dll_CharNextW]
mov dword [esp + 0x14], eax
jmp 0x403c15
push 0x20
pop edi
cmp cx, di
jne 0x403ba1
inc eax
inc eax
cmp word [eax], di
je 0x403b9a
cmp word [eax], si
mov edx, edi
jne 0x403bac
inc eax
inc eax
mov edx, esi
cmp word [eax], 0x2f
jne 0x403c07
inc eax
inc eax
cmp word [eax], 0x53
jne 0x403bd2
movzx ecx, word [eax + 2]
cmp cx, di
je 0x403bc8
cmp cx, bx
jne 0x403bd2
mov dword [0x42a660], 1
cmp dword [eax], 0x43004e
jne 0x403bf6
cmp dword [eax + 4], 0x430052
jne 0x403bf6
movzx ecx, word [eax + 8]
cmp cx, di
je 0x403bf1
cmp cx, bx
jne 0x403bf6
or dword [esp + 0x10], 4
cmp dword [eax - 4], 0x2f0020
jne 0x403c07
cmp dword [eax], 0x3d0044
je 0x403c23
push edx
push eax
call fcn.00405fc1
cmp word [eax], si
jne 0x403c15
inc eax
inc eax
movzx ecx, word [eax]
cmp cx, bx
jne 0x403b92
jmp 0x403c35
mov word [eax - 4], bx
add eax, 4
push eax
push 0x435800
call fcn.00406478
mov edi, dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, 0x437800
push esi
push 0x400
call edi
call fcn.0040397c
test eax, eax
jne 0x403ca7
push 0x3fb
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push str.Temp
push esi
call sub.KERNEL32.dll_lstrcatW
call fcn.0040397c
test eax, eax
jne 0x403ca7
push esi
push 0x3fc
call edi
push 0x4095a8
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 0x409594
call edi
call fcn.0040397c
test eax, eax
je 0x403e14
push 0x437000
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push dword [esp + 0x10]
call fcn.00403648
cmp eax, ebx
mov dword [esp + 0x18], eax
jne 0x403e14
cmp dword [0x42a5e8], ebx
je 0x403d2b
push ebx
push ebp
call fcn.00405fc1
mov edi, eax
jmp 0x403ced
cmp dword [edi], 0x5f0020
jne 0x403ceb
cmp dword [edi + 4], 0x3d003f
je 0x403cf1
dec edi
dec edi
cmp edi, ebp
jae 0x403cda
cmp edi, ebp
mov dword [esp + 0x18], str.Error_launching_installer
jb 0x403d40
mov word [edi], bx
add edi, 8
push edi
call fcn.0040680a
test eax, eax
je 0x403e14
push edi
push 0x435800
call fcn.00406478
push edi
push 0x436000
call fcn.00406478
mov dword [esp + 0x18], ebx
or dword [0x42a66c], 0xffffffff
call fcn.00405b93
mov dword [esp + 0x20], eax
jmp 0x403e14
call fcn.00406709
push esi
mov dword [esp + 0x20], eax
call sub.KERNEL32.dll_lstrlenW
push dword [esp + 0x14]
mov edi, eax
push section..ndata
call fcn.00406478
cmp word [0x435800], bx
jne 0x403d77
push 0x436800
push 0x435800
call fcn.00406478
lea eax, [edi*2 + 0x437800]
mov dword [esp + 0x10], 1
mov dword [esp + 0x24], eax
mov edi, 0x42d800
mov ebx, 0x42e000
and dword [esp + 0x14], 0
movzx ebp, word [esp + 0x10]
push ebp
push str.nsu_X.tmp
push dword [esp + 0x2c]
call dword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [0x42a58c]
add esp, 0xc
push dword [eax + 0x120]
push edi
call fcn.00406892
cmp dword [esp + 0x1c], 0
push esi
je 0x403dd1
call fcn.00405e69
jmp 0x403dd6
call fcn.00405ec3
test eax, eax
je 0x403e40
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test ax, 0x400
jne 0x403e06
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x403e06
push 1
push esi
call fcn.00406cae
mov eax, dword [esp + 0x14]
inc dword [esp + 0x14]
test eax, eax
je 0x403d9e
inc dword [esp + 0x10]
cmp word [esp + 0x10], 0
jne 0x403d94
xor ebx, ebx
call fcn.004039ad
call dword [sym.imp.ole32.dll_OleUninitialize]
cmp dword [esp + 0x18], ebx
pop ebp
je 0x403eb4
push 0x200010
push dword [esp + 0x18]
call fcn.00405f5d
push 2
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0
push esi
call fcn.00406c82
push 1
push edi
push 0x438800
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x403e12
push 0
push edi
call fcn.00406c82
mov eax, dword [0x42a58c]
push dword [eax + 0x124]
push ebx
call fcn.00406892
push ebx
call fcn.00405ee0
test eax, eax
jne 0x403ea3
mov eax, dword [esp + 0x14]
inc dword [esp + 0x14]
test eax, eax
jne 0x403e12
push edi
call fcn.00406564
test eax, eax
je 0x403d9e
jmp 0x403e12
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [esp + 0x18], 0
jmp 0x403e12
cmp dword [0x42a654], ebx
je 0x403f38
lea eax, [esp + 0x18]
push eax
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x403f08
lea eax, [esp + 0x28]
push eax
push str.SeShutdownPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push ebx
push ebx
push ebx
lea eax, [esp + 0x30]
push eax
push ebx
push dword [esp + 0x2c]
mov dword [esp + 0x3c], 1
mov dword [esp + 0x48], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push 5
call fcn.004065fb
cmp eax, ebx
mov esi, 0x80040002
je 0x403f24
push esi
push 0x25
push ebx
push ebx
push ebx
call eax
test eax, eax
je 0x403f31
push esi
push 2
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
jne 0x403f38
push 9
call fcn.00401411
mov eax, dword [0x42a66c]
cmp eax, 0xffffffff
je 0x403f46
mov dword [esp + 0x1c], eax
push dword [esp + 0x1c]
jmp 0x403e3a