Function at 0x4039a0
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, 0x3f0
mov eax, dword [0x40b0f8]
xor eax, esp
mov dword [esp + 0x3ec], eax
push ebx
push ebp
push edi
call fcn.004085c0
xor edi, edi
mov ebx, str.Error_writing_temporary_file._Make_sure_your_temp_folder_is_valid.
mov dword [esp + 0xc], edi
mov ebp, edi
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x4039da
push edi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push esi
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
lea eax, [esp + 0x2c]
mov dword [esp + 0x40], edi
xorps xmm0, xmm0
mov dword [esp + 0x2c], 0x11c
push eax
movlpd qword [esp + 0x144], xmm0
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
push 0x53
pop esi
test eax, eax
jne 0x403a48
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0x114
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov dl, 4
mov byte [esp + 0x146], dl
cmp word [esp + 0x40], si
jne 0x403a44
mov eax, dword [esp + 0x5a]
add eax, 0xffffffd0
mov word [esp + 0x140], ax
jmp 0x403a4f
xor eax, eax
jmp 0x403a3a
mov dl, byte [esp + 0x146]
cmp dword [esp + 0x30], 0xa
jae 0x403a61
movzx eax, word [esp + 0x38]
mov dword [esp + 0x38], eax
jmp 0x403a65
mov eax, dword [esp + 0x38]
mov dword [0x477e38], eax
movzx eax, byte [esp + 0x30]
shl ax, 8
movzx ecx, ax
movzx eax, byte [esp + 0x34]
or ecx, eax
movzx eax, byte [esp + 0x140]
shl ax, 8
shl ecx, 0x10
movzx eax, ax
or ecx, eax
movzx eax, dl
or ecx, eax
mov eax, 0x600
mov dword [0x477e3c], ecx
sar ecx, 0x10
cmp cx, ax
je 0x403ac4
push edi
call fcn.00406ddf
mov esi, eax
test esi, esi
je 0x403ac4
push 0xc00
mov ecx, esi
call dword [0x4092cc]
call esi
mov esi, str.UXTHEME
push esi
call fcn.0040662c
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc esi
add esi, eax
cmp byte [esi], 0
jne 0x403ac9
push 0xc
call fcn.00406ddf
push 0xa
call fcn.00406ddf
push 8
mov dword [0x46fd30], eax
call fcn.00406ddf
mov esi, eax
test esi, esi
je 0x403b15
push 0x1e
mov ecx, esi
call dword [0x4092cc]
call esi
test eax, eax
je 0x403b15
or byte [0x477e3c], 0x80
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
push edi
call dword [sym.imp.ole32.dll_OleInitialize]
push edi
push 0x2b4
mov dword [0x477da0], eax
lea eax, [esp + 0x150]
push eax
push edi
push 0x40963c
call dword [sym.imp.SHELL32.dll_SHGetFileInfoW]
push str.NSIS_Error
push 0x46fd40
call fcn.0040702e
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
mov esi, 0x4c8000
push esi
call fcn.0040702e
movzx ecx, word [0x4c8000]
push 0x22
pop edi
push 0x20
pop edx
cmp cx, di
mov dword [0x46fd34], 0x400000
mov eax, edi
mov dword [esp + 0x14], edi
cmovne eax, edx
mov edx, 0x4c8002
movzx eax, ax
push eax
mov eax, esi
cmove eax, edx
push eax
call fcn.00406ac7
push eax
call dword [sym.imp.USER32.dll_CharNextW]
mov ecx, eax
mov edi, ecx
mov dword [esp + 0x18], edi
movzx eax, word [ecx]
test ax, ax
je 0x403c90
mov esi, eax
push 0x20
pop edx
movzx eax, si
cmp si, dx
jne 0x403bcc
add ecx, 2
movzx eax, word [ecx]
cmp ax, dx
je 0x403bc1
mov edi, edx
movzx esi, ax
movzx edx, ax
cmp ax, word [esp + 0x14]
jne 0x403be4
movzx edx, word [ecx + 2]
push 0x22
pop eax
mov edi, eax
cmp si, word [esp + 0x14]
lea eax, [ecx + 2]
cmovne eax, ecx
cmp dx, 0x2f
jne 0x403c4e
push 0x53
add eax, 2
pop ecx
push 0x20
pop edx
cmp word [eax], cx
jne 0x403c1b
movzx ecx, word [eax + 2]
cmp cx, dx
je 0x403c11
test cx, cx
jne 0x403c1b
mov dword [0x477e20], 1
cmp dword [eax], 0x43004e
jne 0x403c3d
cmp dword [eax + 4], 0x430052
jne 0x403c3d
movzx ecx, word [eax + 8]
cmp cx, dx
je 0x403c3a
test cx, cx
jne 0x403c3d
or ebp, 4
cmp dword [eax - 4], 0x2f0020
jne 0x403c4e
cmp dword [eax], 0x3d0044
je 0x403c78
push edi
push eax
call fcn.00406ac7
mov ecx, eax
push 0x22
pop esi
movzx eax, word [ecx]
mov edx, eax
cmp ax, si
jne 0x403c6a
add ecx, 2
movzx edx, word [ecx]
movzx esi, dx
test dx, dx
jne 0x403bb6
jmp 0x403c8c
xor ecx, ecx
mov word [eax - 4], cx
add eax, 4
push eax
push 0x4cc000
call fcn.0040702e
mov edi, dword [esp + 0x18]
mov esi, 0x4dc000
push esi
push 0x2000
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
call fcn.00403fda
test eax, eax
jne 0x403d06
push 0x1ffb
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push str.Temp
push esi
call sub.KERNEL32.dll_lstrcatW
call fcn.00403fda
test eax, eax
jne 0x403d06
push esi
push 0x1ffc
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0x409664
push esi
call sub.KERNEL32.dll_lstrcatW
push esi
push str.TEMP
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push esi
push 0x409678
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
call fcn.00403fda
test eax, eax
je 0x403ee7
push 0x4d8000
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push ebp
call fcn.004035c2
mov ebx, eax
test ebx, ebx
jne 0x403ee7
cmp dword [0x477d44], eax
je 0x403d8e
xor ebp, ebp
push ebp
push 0x4c8000
call fcn.00406ac7
mov esi, eax
mov eax, 0x4c8000
jmp 0x403d53
cmp dword [esi], 0x5f0020
jne 0x403d50
cmp dword [esi + 4], 0x3d003f
je 0x403d57
sub esi, 2
cmp esi, eax
jae 0x403d3f
mov ebx, str.Error_launching_installer
cmp esi, eax
jb 0x403da1
xor eax, eax
mov word [esi], ax
add esi, 8
push esi
call fcn.00406b09
test eax, eax
je 0x403eeb
push esi
push 0x4cc000
call fcn.0040702e
push esi
push 0x4d0000
call fcn.0040702e
mov ebx, ebp
or dword [0x477e2c], 0xffffffff
call fcn.00405e6e
mov ebp, eax
jmp 0x403eeb
call fcn.004069c0
push 0x4dc000
mov dword [esp + 0x1c], eax
call sub.KERNEL32.dll_lstrlenW
push edi
push section..nsdata
mov esi, eax
call fcn.0040702e
cmp word [0x4cc000], bp
jne 0x403dd9
push 0x4d4000
push 0x4cc000
call fcn.0040702e
xor edi, edi
lea eax, [esi*2 + 0x4dc000]
inc edi
mov dword [esp + 0x14], eax
mov esi, ebp
movzx ebp, di
push ebp
push str.nsu_X.tmp
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [0x477d50]
add esp, 0xc
push dword [eax + 0x120]
push 0x48c000
call fcn.00406301
cmp dword [esp + 0x18], 0
push 0x4dc000
je 0x403e24
call fcn.004062a6
jmp 0x403e29
call fcn.00406286
test eax, eax
je 0x403e76
push 0x48c000
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test eax, 0x400
jne 0x403f0f
push 0x48c000
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x403f0f
push 1
push 0x4dc000
call fcn.00406bea
mov eax, esi
inc esi
test eax, eax
jne 0x403f0f
mov eax, dword [esp + 0x14]
jmp 0x403dec
push 0x4dc000
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0
push 0x4dc000
call fcn.004066e2
push 1
push 0x48c000
push 0x4e4000
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x403ee7
push 0
push 0x48c000
call fcn.004066e2
mov eax, dword [0x477d50]
push dword [eax + 0x124]
push 0x490000
call fcn.00406301
push 0x490000
call fcn.00406ba7
test eax, eax
jne 0x403f22
mov eax, esi
inc esi
test eax, eax
jne 0x403ee7
push 0x48c000
call fcn.00406aa0
test eax, eax
je 0x403e6d
mov ebp, dword [esp + 0x10]
xor edi, edi
call fcn.00403957
call dword [sym.imp.ole32.dll_OleUninitialize]
test ebx, ebx
je 0x403f31
push 0x200010
push ebx
call fcn.00406fbc
push 2
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [esp + 0x14]
inc edi
push 0
pop ebp
test di, di
jne 0x403de7
jmp 0x403ee7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
mov ebx, edi
mov ebp, ebx
jmp 0x403eed
cmp dword [0x477e14], 0
je 0x403fc4
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 0x403f8a
lea eax, [esp + 0x20]
push eax
push str.SeShutdownPrivilege
push edi
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
push edi
push edi
push edi
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 1
push eax
push edi
push dword [esp + 0x2c]
mov dword [esp + 0x40], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push 4
call fcn.00406ddf
mov esi, eax
mov ebx, 0x80040002
test esi, esi
je 0x403fb0
push ebx
push 0x25
push edi
push edi
push edi
mov ecx, esi
call dword [0x4092cc]
call esi
test eax, eax
je 0x403fbd
push ebx
push 2
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
jne 0x403fc4
push 9
call fcn.0040156e
cmp dword [0x477e2c], 0xffffffff
cmovne ebp, dword [0x477e2c]
push ebp
jmp 0x403f09