Function at 0x408f40
Capabilities:
Check if file exists
Create process on windows
Delete file
Delete registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x434aa8
mov eax, dword fs:[0]
push eax
sub esp, 0x11c
mov eax, dword [0x446054]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 8], 1
mov esi, dword [ebp + 0xc]
jle 0x409a04
push 0x4421e8
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
jne 0x409a04
mov edx, dword [esi + 4]
mov ecx, edx
mov dword [ebp - 0xa4], 0
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x90], 0xf
mov byte [ebp - 0xa4], 0
lea esi, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408fc0
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0xa4]
call fcn.0040d550
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x80]
push 0
mov dword [ebp - 0x80], 0
push 0x441dff
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0xf
mov byte [ebp - 0x80], 0
call fcn.0040d550
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x128]
push 0x28
xor eax, eax
mov dword [ebp - 0x128], 0
push str.3d242cb04a436fe313dfa7e5463ff8c5746840f0
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x114], 7
mov word [ebp - 0x128], ax
call fcn.0040d2b0
mov byte [ebp - 4], 2
lea eax, [ebp - 0x110]
push dword [ebp - 0x110]
lea ecx, [ebp - 0x8c]
mov dword [ebp - 0x8c], 0
push eax
lea eax, [ebp - 0x128]
mov dword [ebp - 0x88], 0
push eax
mov dword [ebp - 0x84], 0
call fcn.0040f340
push 0x40b9d0
push 1
push 0x18
lea eax, [ebp - 0x128]
mov byte [ebp - 4], 4
push eax
call fcn.004160cc
xor eax, eax
mov dword [ebp - 0x104], 0
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xd4], eax
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0xf4], 0
mov dword [ebp - 0xf0], 7
mov word [ebp - 0x104], ax
mov dword [ebp - 0xdc], eax
mov dword [ebp - 0xd8], 7
mov word [ebp - 0xec], ax
mov dword [ebp - 0xc4], eax
mov dword [ebp - 0xc0], 7
mov word [ebp - 0xd4], ax
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xa8], 7
mov word [ebp - 0xbc], ax
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x128]
push 0x28
push 0x4421e8
mov dword [ebp - 0x128], eax
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x114], 7
call fcn.0040d2b0
lea eax, [ebp - 0x128]
push eax
call fcn.00410ba0
mov edx, dword [ebp - 0x114]
test al, al
sete al
mov byte [ebp - 0x109], al
cmp edx, 8
jb 0x4091a3
mov ecx, dword [ebp - 0x128]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x409193
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a24
push edx
push ecx
call fcn.00416432
mov al, byte [ebp - 0x109]
add esp, 8
test al, al
jne 0x409988
push 0x28
xor eax, eax
mov dword [ebp - 0x128], 0
push 0x4421e8
lea ecx, [ebp - 0x128]
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x114], 7
mov word [ebp - 0x128], ax
call fcn.0040d2b0
lea eax, [ebp - 0x104]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.00411700
test al, al
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0x114]
sete al
mov byte [ebp - 0x109], al
cmp edx, 8
jb 0x409250
mov ecx, dword [ebp - 0x128]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x409240
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a29
push edx
push ecx
call fcn.00416432
mov al, byte [ebp - 0x109]
add esp, 8
test al, al
jne 0x409988
cmp dword [ebp - 0xc0], 8
lea eax, [ebp - 0xd4]
mov edx, dword [ebp - 0xd4]
lea ecx, [ebp - 0xd4]
cmovae eax, edx
lea edi, [ebp - 0xd4]
mov dword [ebp - 0x108], eax
cmovae ecx, edx
mov eax, dword [ebp - 0xc4]
cmovae edi, edx
lea eax, [ecx + eax*2]
mov dword [ebp - 0x44], eax
cmp edi, eax
je 0x4092b8
mov esi, dword [ebp - 0x108]
sub esi, edi
nop
movzx eax, word [edi]
push eax
call fcn.0041d4db
mov word [edi + esi], ax
add esp, 4
add edi, 2
cmp edi, dword [ebp - 0x44]
jne 0x4092a0
push ecx
push str.FORTINET
lea ecx, [ebp - 0xd4]
call fcn.0040b910
cmp eax, 0xffffffff
je 0x409988
lea eax, [ebp - 0x80]
push eax
sub esp, 0x18
mov ecx, esp
push 0x28
push 0x4421e8
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.0040d2b0
call fcn.00407e60
lea edx, [ebp - 0xa4]
lea ecx, [ebp - 0x80]
call fcn.0040f130
test al, al
jne 0x409988
movups xmm0, xmmword [str.SOFTWAREAccelOpsAgent]
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x48], 0
movups xmmword [ebp - 0x40], xmm0
movups xmm0, xmmword [0x442068]
movups xmmword [ebp - 0x30], xmm0
movups xmm0, xmmword [0x442078]
movups xmmword [ebp - 0x20], xmm0
xorps xmm0, xmm0
movq qword [ebp - 0x50], xmm0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
lea eax, [ebp - 0x44]
mov byte [ebp - 4], 8
push eax
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_IsWow64Process]
push ecx
lea eax, [ebp - 0x50]
push eax
lea edx, [ebp - 0x40]
call fcn.00408960
add esp, 8
mov dword [ebp - 0x108], 0
lea eax, [ebp - 0x108]
push eax
push 0x102
push 0
push str.SOFTWAREAccelOpsAgent
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x4093d2
push str.SuperName
push dword [ebp - 0x108]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
push dword [ebp - 0x108]
call esi
xor eax, eax
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 7
mov word [ebp - 0x68], ax
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 9
call fcn.00408c60
mov edx, dword [ebp - 0x54]
mov eax, edx
mov ecx, dword [ebp - 0x58]
sub eax, ecx
cmp eax, 0xe
jb 0x409439
cmp edx, 8
lea esi, [ebp - 0x68]
push 0x1c
cmovae esi, dword [ebp - 0x68]
lea edi, [ecx + 0xe]
push str.__q__norestart
mov dword [ebp - 0x58], edi
lea eax, [esi + ecx*2]
push eax
call fcn.00417590
add esp, 0xc
xor eax, eax
mov word [esi + edi*2], ax
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x409451
push 0xe
push str.__q__norestart
mov byte [ebp - 0x44], 0
lea ecx, [ebp - 0x68]
push dword [ebp - 0x44]
push 0xe
call fcn.0040ff10
cmp dword [ebp - 0x54], 8
lea eax, [ebp - 0x68]
push 5
cmovae eax, dword [ebp - 0x68]
push 0x442284
push eax
push str.MsiExec.exe
push str.runas
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
push 0x9c40
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 0x40]
call fcn.00408890
mov edi, dword [ebp - 0x50]
mov dword [ebp - 0x110], eax
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x44], eax
cmp edi, eax
je 0x40956b
movups xmm0, xmmword [edi]
mov dword [ebp - 0x108], 0
movups xmmword [ebp - 0x120], xmm0
psrldq xmm0, 4
movd eax, xmm0
cmp eax, 1
lea eax, [ebp - 0x108]
jne 0x40951f
push 0
push eax
push 0
push 0x20106
push 0
push 0
push 0
lea eax, [ebp - 0x40]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x40955f
mov esi, dword [ebp - 0x114]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [eax*2 + 2]
push eax
push esi
push 1
push 0
push dword [ebp - 0x120]
push dword [ebp - 0x108]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x409557
push eax
push 0x102
push 0
lea eax, [ebp - 0x40]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40955f
push 4
push dword [ebp - 0x118]
push 4
push eax
push dword [ebp - 0x120]
push dword [ebp - 0x108]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x108]
call esi
add edi, 0x10
cmp edi, dword [ebp - 0x44]
jne 0x4094a0
push dword [ebp - 0x110]
call esi
push 0x28
push 0x4421e8
lea ecx, [ebp - 0x128]
mov dword [ebp - 0x128], 0
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x114], 7
call fcn.0040d2b0
lea eax, [ebp - 0x128]
push eax
call fcn.00410ba0
mov edx, dword [ebp - 0x114]
test al, al
sete al
mov byte [ebp - 0x109], al
cmp edx, 8
jb 0x409600
mov ecx, dword [ebp - 0x128]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4095f0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a2e
push edx
push ecx
call fcn.00416432
mov al, byte [ebp - 0x109]
add esp, 8
test al, al
jne 0x4098ee
push 0x28
xor eax, eax
mov dword [ebp - 0x128], 0
push 0x4421e8
lea ecx, [ebp - 0x128]
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x114], 7
mov word [ebp - 0x128], ax
call fcn.0040d2b0
lea eax, [ebp - 0x104]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.00411700
test al, al
mov byte [ebp - 4], 9
mov edx, dword [ebp - 0x114]
sete al
mov byte [ebp - 0x109], al
cmp edx, 8
jb 0x4096ad
mov ecx, dword [ebp - 0x128]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40969d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a33
push edx
push ecx
call fcn.00416432
mov al, byte [ebp - 0x109]
add esp, 8
test al, al
jne 0x4098ee
cmp dword [ebp - 0xc0], 8
lea eax, [ebp - 0xd4]
mov edx, dword [ebp - 0xd4]
lea ecx, [ebp - 0xd4]
cmovae eax, edx
lea edi, [ebp - 0xd4]
mov dword [ebp - 0x110], eax
cmovae ecx, edx
mov eax, dword [ebp - 0xc4]
cmovae edi, edx
lea eax, [ecx + eax*2]
mov dword [ebp - 0x44], eax
cmp edi, eax
je 0x409718
mov esi, dword [ebp - 0x110]
sub esi, edi
nop dword [eax + eax]
movzx eax, word [edi]
push eax
call fcn.0041d4db
mov word [edi + esi], ax
add esp, 4
add edi, 2
cmp edi, dword [ebp - 0x44]
jne 0x409700
push ecx
push str.FORTINET
lea ecx, [ebp - 0xd4]
call fcn.0040b910
cmp eax, 0xffffffff
je 0x4098ee
lea eax, [ebp - 0x80]
push eax
sub esp, 0x18
mov ecx, esp
push 0x28
push 0x4421e8
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
call fcn.0040d2b0
call fcn.00407e60
lea edx, [ebp - 0xa4]
lea ecx, [ebp - 0x80]
call fcn.0040f130
test al, al
jne 0x4098ee
push ecx
mov ecx, esp
mov dword [ebp - 0x110], esp
push str.C:ProgramDataFortiSIEM_
call fcn.0040bb20
push ecx
mov byte [ebp - 4], 0xb
mov ecx, esp
mov dword [ebp - 0x44], esp
push str.__q__norestart___i__passive_UPGRADE1
call fcn.0040bb20
push ecx
mov ecx, esp
mov byte [ebp - 4], 0xc
push str.C:ProgramDataFortiSIEMFSMLogAgent.exe
call fcn.0040bb20
mov byte [ebp - 4], 9
call fcn.004086e0
add esp, 0xc
test eax, eax
jne 0x4097c9
push 0x4421e8
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [ebp - 0x54]
cmp edx, 8
jb 0x409803
mov ecx, dword [ebp - 0x68]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4097f9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
mov edx, dword [ebp - 0x50]
xor eax, eax
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 7
mov word [ebp - 0x68], ax
test edx, edx
je 0x409863
mov ecx, dword [ebp - 0x48]
mov eax, edx
sub ecx, edx
and ecx, 0xfffffff0
cmp ecx, 0x1000
jb 0x409844
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push ecx
push edx
call fcn.00416432
add esp, 8
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
lea ecx, [ebp - 0x104]
call fcn.00409a50
lea ecx, [ebp - 0x8c]
call fcn.0040cbe0
mov edx, dword [ebp - 0x6c]
cmp edx, 0x10
jb 0x4098ad
mov ecx, dword [ebp - 0x80]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4098a3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
mov edx, dword [ebp - 0x90]
cmp edx, 0x10
jb 0x4098e7
mov ecx, dword [ebp - 0xa4]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4098dd
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
xor eax, eax
jmp 0x409a09
mov edx, dword [ebp - 0x54]
cmp edx, 8
jb 0x409928
mov ecx, dword [ebp - 0x68]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40991e
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
mov edx, dword [ebp - 0x50]
xor eax, eax
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 7
mov word [ebp - 0x68], ax
test edx, edx
je 0x409988
mov ecx, dword [ebp - 0x48]
mov eax, edx
sub ecx, edx
and ecx, 0xfffffff0
cmp ecx, 0x1000
jb 0x409969
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push ecx
push edx
call fcn.00416432
add esp, 8
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
lea ecx, [ebp - 0x104]
call fcn.00409a50
lea ecx, [ebp - 0x8c]
call fcn.0040cbe0
mov edx, dword [ebp - 0x6c]
cmp edx, 0x10
jb 0x4099ce
mov ecx, dword [ebp - 0x80]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4099c4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
mov edx, dword [ebp - 0x90]
cmp edx, 0x10
jb 0x409a04
mov ecx, dword [ebp - 0xa4]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4099fa
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409a38
push edx
push ecx
call fcn.00416432
add esp, 8
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00415ea4
mov esp, ebp
pop ebp
ret
call fcn.0041de26
call fcn.0041de26
call fcn.0041de26
call fcn.0041de26
call fcn.0041de26
int3