Function at 0x406982
Capabilities:
Check if file exists
Copy file
Create directory
Create process on windows
Delete file
Extract resource via kernel32 functions
Get common file path
Get file attributes
Get session user name

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x434794
mov eax, dword fs:[0]
push eax
mov eax, 0x1988
call fcn.00414cb0
mov eax, dword [0x44c06c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov byte [ebp - 0x196d], dl
mov dword [ebp - 0x1978], ecx
xor eax, eax
lea edi, [ebp - 0x196c]
stosd dword es:[edi], eax
xor ebx, ebx
push 0x44
push ebx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x170c]
push eax
call fcn.00416120
xorps xmm0, xmm0
add esp, 0xc
movlpd qword [ebp - 0x1678], xmm0
mov dword [ebp - 0x1678], ebx
mov dword [ebp - 0x1674], ebx
mov dword [ebp - 4], ebx
lea edi, [ebp - 0x1668]
xor eax, eax
mov word [ebp - 0x834], ax
mov word [ebp - 0x62c], ax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov dword [ebp - 0x1668], ebx
mov dword [ebp - 0x1664], ebx
mov dword [ebp - 0x1660], ebx
push 7
pop ecx
xor eax, eax
mov dword [ebp - 0x1680], ebx
mov dword [ebp - 0x167c], ecx
mov word [ebp - 0x1690], ax
mov dword [ebp - 0x1698], ebx
mov dword [ebp - 0x1694], ecx
mov word [ebp - 0x16a8], ax
mov esi, 0xb7
mov byte [ebp - 4], 3
or eax, 0xffffffff
mov dword [ebp - 0x1670], eax
lea edi, [esi + 0x4d]
cmp byte [ebp - 0x196d], bl
jne 0x406b2f
lea eax, [ebp - 0x21c]
push eax
push ebx
push ebx
push 0x1c
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push str.SquirrelTemp
lea eax, [ebp - 0x21c]
push edi
push eax
call fcn.00418d79
add esp, 0xc
lea eax, [ebp - 0x21c]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x406cf6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x406cf6
push 0x2000
call fcn.0041be0a
mov esi, eax
pop ecx
test esi, esi
je 0x406c87
lea eax, [ebp - 0x21c]
push eax
push str.Unable_to_write_to__s___IT_policies_may_be_restricting_access_to_this_folder
push 0x1000
push esi
call fcn.00409321
add esp, 0x10
cmp byte [ebp - 0x196d], 0
je 0x406c80
cmp byte [ebp + 8], 0
jne 0x406c72
push esi
lea ecx, [ebp - 0x166c]
call fcn.004025fe
xor edx, edx
mov byte [ebp - 4], 5
mov ecx, eax
call fcn.004063d0
lea ecx, [ebp - 0x166c]
mov byte [ebp - 4], 3
call fcn.0040215d
jmp 0x406c80
lea eax, [ebp - 0x424]
mov dword [ebp - 0x166c], 0x200
push eax
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
lea eax, [ebp - 0x166c]
push eax
lea eax, [ebp - 0xe3c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0xe3c]
push eax
lea eax, [ebp - 0x424]
push eax
push str._s_s
lea eax, [ebp - 0x21c]
push edi
push eax
call fcn.00409321
add esp, 0x14
lea eax, [ebp - 0x21c]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x406a83
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x406a83
push 0x2000
call fcn.0041be0a
mov esi, eax
pop ecx
test esi, esi
je 0x406c18
lea eax, [ebp - 0x21c]
push eax
push str.Unable_to_write_to__s___IT_policies_may_be_restricting_access_to_this_folder
push 0x1000
push esi
call fcn.00409321
add esp, 0x10
cmp byte [ebp + 8], 0
jne 0x406c03
push esi
lea ecx, [ebp - 0x1978]
call fcn.004025fe
xor edx, edx
mov byte [ebp - 4], 4
mov ecx, eax
call fcn.004063d0
lea ecx, [ebp - 0x1978]
call fcn.0040215d
jmp 0x406c11
mov edx, esi
call fcn.00407a90
push eax
call fcn.00407c6a
pop ecx
push esi
call fcn.0041be05
pop ecx
lea ecx, [ebp - 0x16a8]
call fcn.00409913
lea ecx, [ebp - 0x1690]
call fcn.00409913
mov esi, dword [ebp - 0x1668]
test esi, esi
je 0x406c6a
mov edi, dword [ebp - 0x1664]
cmp esi, edi
je 0x406c56
mov ecx, esi
call fcn.0040215d
add esi, 4
cmp esi, edi
jne 0x406c42
mov esi, dword [ebp - 0x1668]
mov eax, dword [ebp - 0x1660]
sub eax, esi
and eax, 0xfffffffc
push eax
push esi
call fcn.00409a1b
pop ecx
pop ecx
or eax, 0xffffffff
jmp 0x407424
mov edx, esi
call fcn.00407a90
push eax
call fcn.00407c6a
pop ecx
push esi
call fcn.0041be05
pop ecx
mov edi, ebx
mov esi, dword [ebp - 0x1978]
cmp byte [ebp - 0x196d], 0
jne 0x407365
push dword [ebp + 8]
mov dl, 1
mov ecx, esi
call fcn.00406982
pop ecx
lea ecx, [ebp - 0x16a8]
mov dword [ebp - 0x197c], eax
call fcn.00409913
lea ecx, [ebp - 0x1690]
call fcn.00409913
mov esi, dword [ebp - 0x1668]
test esi, esi
je 0x407413
mov eax, dword [ebp - 0x1664]
cmp esi, eax
je 0x4073ed
mov ebx, eax
mov ecx, esi
call fcn.0040215d
add esi, 4
cmp esi, ebx
jne 0x406ce3
jmp 0x4073e5
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x165c]
push str._sSquirrelSetup.log
push eax
call fcn.00407c9c
add esp, 0xc
push 0x446294
push 0x83
push dword [0x44d9a0]
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
mov dword [ebp - 0x1674], esi
test esi, esi
je 0x406c87
push esi
push dword [0x44d9a0]
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
mov dword [ebp - 0x1678], edi
test edi, edi
jne 0x406d5b
mov dword [ebp - 0x1674], ebx
jmp 0x406c89
push esi
push dword [0x44d9a0]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
cmp esi, 0x100
jb 0x406c89
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
push ecx
push ecx
mov edx, esi
mov ecx, eax
call fcn.004060b0
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x406d9c
mov dword [0x44e5e8], 0x10000
jmp 0x406dc1
cmp dword [esi], 1
je 0x406dad
mov dword [0x44e5e8], 0x80000
jmp 0x406dc1
mov ecx, dword [esi + 4]
lea eax, [ebp - 0x21c]
push eax
call fcn.0040569c
mov dword [0x44e5e8], eax
mov ecx, ebx
mov dword [ebp - 0x166c], ebx
xor eax, eax
mov dword [ebp - 0xc6c], ebx
mov word [ebp - 0x424], ax
mov word [ebp - 0xc68], ax
mov dword [ebp - 0xa40], ebx
test esi, esi
je 0x406ef2
cmp dword [esi], 1
jne 0x406ee6
lea eax, [ebp - 0xc6c]
push eax
push ecx
mov ecx, dword [esi + 4]
call fcn.004056fa
mov dword [ebp - 0x1974], eax
mov dword [0x44e5e8], eax
test eax, eax
je 0x406e20
cmp eax, 0x600
jne 0x406efc
lea eax, [ebp - 0xc68]
push eax
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x424]
push str._s_s
push eax
call fcn.00407c9c
add esp, 0x10
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [ebp - 0x166c]
lea eax, [ebp - 0xc68]
push ecx
push ecx
push eax
mov ecx, esi
call fcn.0040617b
add esp, 0xc
test eax, eax
jne 0x406efc
lea eax, [ebp - 0x424]
push eax
lea ecx, [ebp - 0x197c]
call fcn.004025fe
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x1664]
push eax
cmp dword [ebp - 0x1660], ecx
je 0x406ea3
call fcn.00409035
add dword [ebp - 0x1664], 4
jmp 0x406eaf
push ecx
lea ecx, [ebp - 0x1668]
call fcn.00407cd0
lea ecx, [ebp - 0x197c]
mov byte [ebp - 4], 3
call fcn.0040215d
mov ecx, dword [ebp - 0x166c]
mov eax, dword [ebp - 0x1974]
inc ecx
mov dword [ebp - 0x166c], ecx
cmp eax, 0x600
je 0x406dc9
test eax, eax
je 0x406dc9
jmp 0x406efc
mov dword [0x44e5e8], 0x80000
jmp 0x406efc
mov dword [0x44e5e8], 0x10000
mov ecx, esi
call fcn.004061ac
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
xor eax, eax
mov dword [ebp - 0x1674], ebx
mov word [ebp - 0xa3c], ax
mov edi, ebx
push 0x4462a0
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x1678], edi
push eax
lea eax, [ebp - 0xa3c]
push str._s_s
push eax
call fcn.00407c9c
add esp, 0x10
lea eax, [ebp - 0xa3c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x406c89
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x104
lea ecx, [ebp - 0x124c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x124c]
push eax
lea ecx, [ebp - 0x1690]
call fcn.004077b8
lea eax, [ebp - 0x1690]
push eax
lea ecx, [ebp - 0x16c0]
call fcn.00407a22
lea eax, [ebp - 0x1994]
mov byte [ebp - 4], 7
push eax
lea ecx, [ebp - 0x16c0]
call fcn.004061fe
lea ecx, [ebp - 0x1994]
mov esi, dword [eax + 0x10]
call fcn.00409913
test esi, esi
je 0x40701b
push 0xa
push str.__exeName
lea ecx, [ebp - 0x16a8]
call fcn.00407895
lea eax, [ebp - 0x1994]
push eax
lea ecx, [ebp - 0x16c0]
call fcn.004061fe
mov edx, eax
mov byte [ebp - 4], 8
cmp dword [edx + 0x14], 8
jb 0x406fef
mov edx, dword [edx]
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x406ff4
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x16a8]
call fcn.00407895
lea ecx, [ebp - 0x1994]
call fcn.00409913
lea ecx, [ebp - 0x16c0]
mov byte [ebp - 4], 3
call fcn.00409913
push dword [ebp - 0x1974]
cmp dword [ebp - 0x167c], 8
lea ecx, [ebp - 0x1690]
mov edx, dword [ebp - 0x1680]
cmovae ecx, dword [ebp - 0x1690]
push 2
push ecx
push ecx
call fcn.00407e25
add esp, 0x10
lea ecx, [ebp - 0x1690]
push eax
push ebx
lea eax, [ebp - 0x1994]
push eax
call fcn.004075a7
push eax
lea ecx, [ebp - 0x1690]
call fcn.004075f9
lea ecx, [ebp - 0x1994]
call fcn.00409913
mov esi, str.setup.json
lea eax, [ebp - 0x21c]
push esi
push eax
lea eax, [ebp - 0x834]
push str._s_s
push eax
call fcn.00407c9c
cmp dword [ebp - 0x167c], 8
lea eax, [ebp - 0x1690]
push esi
cmovae eax, dword [ebp - 0x1690]
mov esi, str._s_s
push eax
lea eax, [ebp - 0x62c]
push esi
push eax
call fcn.00407c9c
add esp, 0x20
lea eax, [ebp - 0x62c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40713e
push ebx
lea eax, [ebp - 0x834]
push eax
lea eax, [ebp - 0x62c]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
lea eax, [ebp - 0x834]
push eax
lea ecx, [ebp - 0x1974]
call fcn.004025fe
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x1664]
push eax
cmp dword [ebp - 0x1660], ecx
je 0x407123
call fcn.00409035
add dword [ebp - 0x1664], 4
jmp 0x40712f
push ecx
lea ecx, [ebp - 0x1668]
call fcn.00407cd0
lea ecx, [ebp - 0x1974]
mov byte [ebp - 4], 3
call fcn.0040215d
xor eax, eax
mov word [ebp - 0x1044], ax
lea eax, [ebp - 0x21c]
push str..nupkg
push eax
lea eax, [ebp - 0x1044]
push esi
push eax
call fcn.00407c9c
add esp, 0x10
lea eax, [ebp - 0x195c]
push eax
lea eax, [ebp - 0x1044]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40719d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40719d
push 0x13
push str.___bootstrapperMode
lea ecx, [ebp - 0x16a8]
call fcn.00407895
jmp 0x4071a4
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov esi, dword [ebp - 0x1978]
mov dword [ebp - 0x170c], 0x44
mov dword [ebp - 0x16e0], 1
push 5
pop eax
mov word [ebp - 0x16dc], ax
test esi, esi
je 0x4071de
push 0x104
push esi
call fcn.0041c0aa
pop ecx
pop ecx
cmp eax, 1
jae 0x4071e3
mov esi, 0x444650
cmp dword [ebp - 0x1694], 8
lea eax, [ebp - 0x16a8]
cmovae eax, dword [ebp - 0x16a8]
push eax
push esi
lea eax, [ebp - 0xa3c]
push eax
lea eax, [ebp - 0x1454]
push str.__s____install_.__s__s
push eax
call fcn.00407c9c
add esp, 0x14
lea eax, [ebp - 0x196c]
push eax
lea eax, [ebp - 0x170c]
push eax
lea eax, [ebp - 0x21c]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x1454]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x406c8f
or esi, 0xffffffff
push esi
push dword [ebp - 0x196c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 0x1670]
push eax
push dword [ebp - 0x196c]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov ecx, dword [ebp - 0x1670]
test eax, eax
cmove ecx, esi
mov dword [ebp - 0x1670], ecx
test ecx, ecx
je 0x4072ba
cmp byte [ebp + 8], 0
jne 0x4072b0
push str.There_was_an_error_while_installing_the_application._Check_the_setup_log_for_more_information_and_contact_the_author.
lea ecx, [ebp - 0x1974]
call fcn.004025fe
lea edx, [ebp - 0x165c]
mov byte [ebp - 4], 0xa
mov ecx, eax
call fcn.004063d0
lea ecx, [ebp - 0x1974]
call fcn.0040215d
jmp 0x4072ba
mov ecx, str.ERROR:_there_was_an_error_while_installing_the_application__see_above_
call fcn.00409d9d
mov eax, dword [ebp - 0x1664]
mov ecx, dword [ebp - 0x1668]
sub eax, ecx
sar eax, 2
test eax, eax
je 0x4072ee
push dword [ecx + ebx*4]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebp - 0x1664]
inc ebx
mov ecx, dword [ebp - 0x1668]
sub eax, ecx
sar eax, 2
cmp ebx, eax
jb 0x4072cf
push dword [ebp - 0x196c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x1968]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x1670]
lea ecx, [ebp - 0x16a8]
call fcn.00409913
lea ecx, [ebp - 0x1690]
call fcn.00409913
mov esi, dword [ebp - 0x1668]
test esi, esi
je 0x40735e
mov edi, dword [ebp - 0x1664]
cmp esi, edi
je 0x40734a
mov ecx, esi
call fcn.0040215d
add esi, 4
cmp esi, edi
jne 0x407336
mov esi, dword [ebp - 0x1668]
mov ecx, dword [ebp - 0x1660]
sub ecx, esi
and ecx, 0xfffffffc
push ecx
push esi
call fcn.00409a1b
pop ecx
pop ecx
mov eax, ebx
jmp 0x407424
cmp byte [ebp + 8], 0
jne 0x407395
push str.Failed_to_extract_installer
lea ecx, [ebp - 0x1974]
call fcn.004025fe
xor edx, edx
mov byte [ebp - 4], 0xb
mov ecx, eax
call fcn.004063d0
lea ecx, [ebp - 0x1974]
call fcn.0040215d
jmp 0x40739f
mov ecx, str.ERROR:_failed_to_extract_installer
call fcn.00409d9d
mov eax, dword [ebp - 0x1670]
lea ecx, [ebp - 0x16a8]
mov dword [ebp - 0x197c], eax
call fcn.00409913
lea ecx, [ebp - 0x1690]
call fcn.00409913
mov esi, dword [ebp - 0x1668]
test esi, esi
je 0x407413
mov eax, dword [ebp - 0x1664]
cmp esi, eax
je 0x4073ed
mov ebx, eax
mov ecx, esi
call fcn.0040215d
add esi, 4
cmp esi, ebx
jne 0x4073d7
mov esi, dword [ebp - 0x1668]
xor ebx, ebx
mov eax, dword [ebp - 0x1660]
sub eax, esi
and eax, 0xfffffffc
push eax
push esi
call fcn.00409a1b
pop ecx
pop ecx
mov dword [ebp - 0x1660], ebx
mov dword [ebp - 0x1664], ebx
mov dword [ebp - 0x1668], ebx
test edi, edi
je 0x40741e
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov eax, dword [ebp - 0x197c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00413a95
leave
ret