Function at 0x403f85
Capabilities:
Accept command line arguments
Check if file exists
Copy file
Create directory
Delete file
Get common file path
Resolve function by parsing pe exports
Terminate process

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
push edi
xor edi, edi
mov byte [esp + 0x13], 0x20
mov dword [esp + 0x14], edi
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
push edi
call dword [sym.imp.ole32.dll_OleInitialize]
mov esi, 0x7a0400
mov ebx, 0x400
push esi
push ebx
mov dword [0x799ec0], eax
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push esi
call fcn.00406a85
push edi
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov edi, 0x799640
push esi
push edi
call fcn.0040655a
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcatA]
test eax, eax
jne 0x404016
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push str.Temp
push esi
call ebp
push esi
call fcn.00406a85
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push esi
push edi
call fcn.0040655a
test eax, eax
jne 0x404016
mov dword [esp + 0x14], str.Error_writing_temp_file._Make_sure_your_temp_directory_is_valid.
jmp 0x404280
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push str.NSIS_ERROR
push edi
call sub.KERNEL32.dll_lstrcpyA
push ebx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov edi, 0x79f000
push eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp byte [0x79f000], 0x22
mov dword [0x798de8], eax
mov eax, edi
jne 0x40405e
mov byte [esp + 0x13], 0x22
mov eax, 0x79f001
mov ebx, dword [sym.imp.USER32.dll_CharNextA]
jmp 0x40406f
cmp cl, byte [esp + 0x13]
je 0x404075
push eax
call ebx
mov cl, byte [eax]
test cl, cl
jne 0x404066
push eax
call ebx
mov edi, eax
mov dword [esp + 0x20], edi
jmp 0x404085
push edi
call ebx
mov edi, eax
cmp byte [edi], 0x20
je 0x404080
cmp byte [edi], 0x2f
jne 0x4040db
inc edi
cmp byte [edi], 0x53
jne 0x4040a3
mov al, byte [edi + 1]
or al, 0x20
cmp al, 0x20
jne 0x4040a3
or dword [esp + 0x14], 2
cmp dword [edi], 0x4352434e
jne 0x4040b9
mov al, byte [edi + 4]
or al, 0x20
cmp al, 0x20
jne 0x4040b9
or dword [esp + 0x14], 4
cmp word [edi], 0x3d44
jne 0x40415b
and byte [edi - 2], 0
add edi, 2
push edi
push 0x79f400
call sub.KERNEL32.dll_lstrcpyA
mov edi, 0x796438
push dword [esp + 0x14]
call fcn.0040392f
test eax, eax
mov dword [esp + 0x14], eax
jne 0x404280
cmp dword [0x799e54], eax
je 0x404277
cmp byte [edi], al
mov ebx, edi
je 0x40410c
inc ebx
cmp byte [ebx], 0
jne 0x404102
cmp ebx, edi
jb 0x404168
cmp byte [ebx], 0x5f
jne 0x40411d
cmp byte [ebx + 1], 0x3f
jne 0x40411d
cmp byte [ebx + 2], 0x3d
je 0x404122
dec ebx
cmp ebx, edi
jae 0x40410c
cmp ebx, edi
jb 0x404168
and byte [ebx - 1], 0
add ebx, 3
push ebx
call fcn.00406440
test eax, eax
je 0x40426d
push ebx
push 0x79f400
call sub.KERNEL32.dll_lstrcpyA
push ebx
push 0x79f800
call sub.KERNEL32.dll_lstrcpyA
jmp 0x404277
push edi
call ebx
mov edi, eax
mov al, byte [edi]
or al, 0x20
cmp al, 0x20
jne 0x404156
jmp 0x404085
and dword [esp + 0x1c], 0
and dword [esp + 0x18], 0
mov edi, 0x795c38
mov ebx, 0x795838
push esi
push 0x795c39
mov byte [0x795c38], 0x22
call sub.KERNEL32.dll_lstrcpyA
push str.ANSISu_.exe
push edi
call ebp
push 0x795c39
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [esp + 0x1c], 0
jne 0x404251
push 0x400
push ebx
push dword [0x798de8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [eax + 0x79582c]
push 0x4091f5
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40426d
push 0
push 0x795c39
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x404251
push 0
push 0x795c39
call fcn.004065a6
cmp byte [0x79f400], 0
je 0x40420c
push 0x79f400
push ebx
call sub.KERNEL32.dll_lstrcpyA
jmp 0x404212
push ebx
call fcn.004063c1
push 0x40920c
push edi
mov dword [esp + 0x24], 1
call ebp
push dword [esp + 0x20]
push edi
call ebp
push str.___
push edi
call ebp
push ebx
push edi
call ebp
push esi
push edi
call fcn.00406295
test eax, eax
je 0x404249
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x404251
mov dword [esp + 0x14], str.Error_launching_installer
inc byte [str.ANSISu_.exe]
inc dword [esp + 0x18]
cmp dword [esp + 0x18], 0x1a
jl 0x40417c
cmp dword [esp + 0x1c], 0
jne 0x404280
mov dword [esp + 0x14], str.Error_launching_installer
jmp 0x404280
call fcn.004042ed
mov dword [esp + 0x20], eax
call dword [sym.imp.ole32.dll_OleUninitialize]
mov eax, dword [0x799e50]
pop edi
pop esi
pop ebp
cmp eax, 0xffffffff
pop ebx
je 0x40429b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x409094]
cmp eax, 0xffffffff
je 0x4042ac
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 4], 0
je 0x4042be
push 0x10
push dword [esp + 8]
call fcn.004062ff
cmp byte [0x7a0c00], 0
je 0x4042d3
push 1
push 0x7a0c00
call fcn.0040632a
mov eax, dword [0x79961c]
test eax, eax
je 0x4042e3
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_ExitProcess]