Function at 0x40796c
Capabilities:
Create process on windows
Get common file path
Get program files directory

Disassembly:
push ebp
mov ebp, esp
mov ecx, 6
push 0
push 0
dec ecx
jne 0x407974
push ecx
push ebx
push esi
push edi
mov byte [ebp - 0x19], dl
mov dword [ebp - 0x18], eax
xor eax, eax
push ebp
push 0x407d98
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x1a], 0
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x24]
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
test eax, eax
je 0x407d68
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 6
jl 0x407a94
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MinorVersion]
cmp dword [eax], 2
jl 0x407a94
lea eax, [ebp - 4]
xor edx, edx
call sub.rtl120.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
lea eax, [ebp - 8]
xor edx, edx
call sub.rtl120.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
lea eax, [ebp - 0xc]
xor edx, edx
call sub.rtl120.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Registry_TRegistry_]
call sub.rtl120.bpl__Registry_TRegistry__bctr_qqrv
mov ebx, eax
mov edx, 0x80000001
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_SetRootKey_qqrp6HKEY__
mov edx, 0x407db8
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_OpenKeyReadOnly_qqrx20System_UnicodeString
test al, al
je 0x407a34
lea ecx, [ebp - 4]
mov edx, 0x407e60
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
lea ecx, [ebp - 8]
mov edx, 0x407e7c
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
cmp dword [ebp - 4], 0
je 0x407a8b
cmp dword [ebp - 8], 0
je 0x407a8b
mov edx, 0x80000000
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_SetRootKey_qqrp6HKEY__
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x30], eax
mov byte [ebp - 0x2c], 0x11
lea edx, [ebp - 0x30]
xor ecx, ecx
mov eax, 0x407e94
call fcn.00408cd0
mov edx, dword [ebp - 0x28]
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_OpenKeyReadOnly_qqrx20System_UnicodeString
test al, al
je 0x407a83
lea ecx, [ebp - 0xc]
xor edx, edx
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
cmp dword [ebp - 0xc], 0
setne byte [ebp - 0x1a]
mov eax, ebx
call sub.rtl120.bpl__System_TObject_Free_qqrv
jmp 0x407a98
mov byte [ebp - 0x1a], 1
cmp byte [ebp - 0x1a], 0
je 0x407b39
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 0xa
jl 0x407b39
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32BuildNumber]
cmp dword [eax], 0x295a
jl 0x407b39
xor eax, eax
push ebp
push 0x407b2f
push dword fs:[eax]
mov dword fs:[eax], esp
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Registry_TRegistry_]
call sub.rtl120.bpl__Registry_TRegistry__bctr_qqrv
mov ebx, eax
mov edx, 0x80000002
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_SetRootKey_qqrp6HKEY__
mov edx, 0x407ecc
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
jne 0x407b15
mov edx, 0x407f64
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
jne 0x407b15
mov edx, 0x407ff4
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
je 0x407b19
xor eax, eax
jmp 0x407b1b
mov al, 1
mov byte [ebp - 0x1a], al
mov eax, ebx
call sub.rtl120.bpl__System_TObject_Free_qqrv
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x407b39
cmp byte [ebp - 0x1a], 0
je 0x407bb4
xor edx, edx
push ebp
push 0x407ba6
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [ebp - 0x19], 0
je 0x407b7a
push 0
push 0
push 1
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, eax
mov edx, 0x408064
xor eax, eax
call fcn.004078f8
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x1a], al
jmp 0x407b9c
push 1
push 0
push 0
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x408064
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x1a]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x407bb4
cmp byte [ebp - 0x1a], 0
jne 0x407c5e
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 0xa
jl 0x407c5e
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
mov byte [ebp - 0x2c], 0x11
lea edx, [ebp - 0x30]
xor ecx, ecx
mov eax, 0x40807c
call fcn.00408cd0
xor edx, edx
push ebp
push 0x407c50
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [ebp - 0x19], 0
je 0x407c24
push 0
push 0
push 1
mov eax, dword [ebp - 0x14]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, eax
mov edx, 0x408064
xor eax, eax
call fcn.004078f8
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x1a], al
jmp 0x407c46
push 1
push 0
push 0
mov eax, dword [ebp - 0x14]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x408064
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x1a]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x407c5e
cmp byte [ebp - 0x1a], 0
jne 0x407d68
lea eax, [ebp - 0x10]
xor edx, edx
call sub.rtl120.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
lea eax, [ebp - 0x20]
push eax
push 0x26
push 0
call sub.shell32.dll_SHGetSpecialFolderLocation
call sub.rtl120.bpl__Activex_Succeeded_qqrl
test al, al
je 0x407cbe
mov eax, 0x104
call sub.rtl120.bpl__Sysutils_StrAlloc_qqrui
mov ebx, eax
push ebx
mov eax, dword [ebp - 0x20]
push eax
call sub.shell32.dll_SHGetPathFromIDListW
test eax, eax
je 0x407cb7
lea edx, [ebp - 0x34]
mov eax, ebx
call sub.rtl120.bpl__Sysutils_StrPas_qqrpxb
mov eax, dword [ebp - 0x34]
lea edx, [ebp - 0x10]
call sub.rtl120.bpl__Sysutils_IncludeTrailingPathDelimiter_qqrx20System_UnicodeString
mov eax, ebx
call sub.rtl120.bpl__Sysutils_StrDispose_qqrpb
cmp dword [ebp - 0x10], 0
je 0x407d68
lea eax, [ebp - 0x10]
mov edx, 0x4080ac
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x407d68
xor edx, edx
push ebp
push 0x407d5a
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [ebp - 0x19], 0
je 0x407d27
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0
push 1
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, eax
mov edx, 0x408064
xor eax, eax
call fcn.004078f8
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x1a], al
jmp 0x407d50
push 1
push 0
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x408064
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x1a]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x407d68
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x407d9f
lea eax, [ebp - 0x34]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x28]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x14]
mov edx, 5
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret