Function at 0x40c508
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 0x40c510
push ecx
push ebx
push esi
push edi
mov dword [ebp - 0x18], eax
xor eax, eax
push ebp
push 0x40c893
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x19], 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 0x40c863
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 6
jl 0x40c62d
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MinorVersion]
cmp dword [eax], 2
jl 0x40c62d
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, 0x40c8b4
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_OpenKeyReadOnly_qqrx20System_UnicodeString
test al, al
je 0x40c5cd
lea ecx, [ebp - 4]
mov edx, 0x40c95c
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
lea ecx, [ebp - 8]
mov edx, 0x40c978
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
cmp dword [ebp - 4], 0
je 0x40c624
cmp dword [ebp - 8], 0
je 0x40c624
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, 0x40c990
call fcn.0040fdb0
mov edx, dword [ebp - 0x28]
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_OpenKeyReadOnly_qqrx20System_UnicodeString
test al, al
je 0x40c61c
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 - 0x19]
mov eax, ebx
call sub.rtl120.bpl__System_TObject_Free_qqrv
jmp 0x40c631
mov byte [ebp - 0x19], 1
cmp byte [ebp - 0x19], 0
je 0x40c6d2
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 0xa
jl 0x40c6d2
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32BuildNumber]
cmp dword [eax], 0x295a
jl 0x40c6d2
xor eax, eax
push ebp
push 0x40c6c8
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, 0x40c9c8
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
jne 0x40c6ae
mov edx, 0x40ca60
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
jne 0x40c6ae
mov edx, 0x40caf0
mov eax, ebx
call sub.rtl120.bpl__Registry_TRegistry_KeyExists_qqrx20System_UnicodeString
test al, al
je 0x40c6b2
xor eax, eax
jmp 0x40c6b4
mov al, 1
mov byte [ebp - 0x19], 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 0x40c6d2
cmp byte [ebp - 0x19], 0
je 0x40c720
xor edx, edx
push ebp
push 0x40c712
push dword fs:[edx]
mov dword fs:[edx], esp
push 1
push 0
push 0
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x40cb60
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x19]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x40c720
cmp byte [ebp - 0x19], 0
jne 0x40c795
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 0xa
jl 0x40c795
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, 0x40cb78
call fcn.0040fdb0
xor edx, edx
push ebp
push 0x40c787
push dword fs:[edx]
mov dword fs:[edx], esp
push 1
push 0
push 0
mov eax, dword [ebp - 0x14]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x40cb60
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x19]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x40c795
cmp byte [ebp - 0x19], 0
jne 0x40c863
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 0x40c7f5
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 0x40c7ee
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 0x40c863
lea eax, [ebp - 0x10]
mov edx, 0x40cba8
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 0x40c863
xor edx, edx
push ebp
push 0x40c855
push dword fs:[edx]
mov dword fs:[edx], esp
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 0x40cb60
push 0
call sub.shell32.dll_ShellExecuteW
cmp eax, 0x20
seta byte [ebp - 0x19]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x40c863
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40c89a
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