new and updated app scripts. fixed bug with BFD starting.

This commit is contained in:
Homes32
2021-02-06 15:09:10 -06:00
parent ebff1bafda
commit 01a7f6d932
30 changed files with 5292 additions and 5568 deletions

View File

@@ -32,7 +32,7 @@
Title=PhoenixPE API
Author=Homes32
Description=Scripting interface.
Version=1.3.2.0
Version=1.4.0.0
Level=0
Selected=None
@@ -515,10 +515,11 @@ System,EndLocal
// ===============================================================================================================================
// Name...........: AddAutoRun
// Description....: Run a program when the PE Environment starts
// Syntax.........: AddAutoRun,<RunPos>,<Mode>,<Title>,<ProgramExe>,<Parameters>
// Parameters.....: #1 RunPos
// Syntax.........: AddAutoRun,<RunGroup>,<Mode>,<Title>,<ProgramExe>,<Parameters>
// Parameters.....: #1 RunGroup
// PreShell - Run before the shell (ie. Explorer) is loaded.
// PostShell - Run after the shell is loaded.
// RunOnce - Run during startup via HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
// #2 Mode
// NoWait - Do not wait for the program to terminate.
// Wait - Wait for the program to terminate before moving on.
@@ -539,7 +540,7 @@ If,#1,Equal,"",Halt,"AddAutoRun Syntax Error: Run position was not specified."
If,#2,Equal,"",Halt,"AddAutoRun Syntax Error: Run mode was not specified."
If,#4,Equal,"",Halt,"AddAutoRun Syntax Error: Program Executable was not specified."
GetParam,1,%RunPos%
GetParam,1,%RunGroup%
GetParam,2,%Mode%
GetParam,3,%Title%
GetParam,4,%ProgramExe%
@@ -552,27 +553,50 @@ If,%_PhoenixAPI_ConfigMode%,Equal,PECMD,Begin
Else,If,%Mode%,Equal,HideWait,Set,%ExecMode%,"-hide -wait "
Else,Halt,"AddAutoRun Syntax Error: [%Mode%] is not a valid run mode."
If,%RunPos%,Equal,"Preshell",TXTReplace,"%TargetSystem32%\pecmd.ini","_END Preshell","TEXT %Title%##0xFFFFFF L59 T39 $20#$xEXEC %ExecMode%%ProgramExe% %Parameters%#$x#$x_END Preshell"
Else,If,%RunPos%,Equal,"Postshell",TXTReplace,"%TargetSystem32%\pecmd.ini","_END PostShell","TEXT %Title%##0xFFFFFF L59 T39 $20#$xEXEC %ExecMode%%ProgramExe% %Parameters%#$x#$x_END PostShell"
//Else,If,%RunPos%,Equal,"RunOnce",Begin
// NEED TO HANDLE RUN MODE
// RegHiveLoad,Tmp_Default,%RegDefault%
// RegWrite,HKLM,0x2,"Tmp_Default\Software\Microsoft\Windows\CurrentVersion\RunOnce",%Title%,"%ProgramExe%%Parameters%"
// RegHiveUnload,Tmp_Default
//End
//Else,If,%RunPos%,Equal,
Else,Halt,"AddAutoRun Syntax Error: [%RunPos%] is not a supported Run method."
If,%RunGroup%,Equal,"Preshell",TXTReplace,"%TargetSystem32%\pecmd.ini","_END Preshell","TEXT %Title%##0xFFFFFF L59 T39 $20#$xEXEC %ExecMode%%ProgramExe% %Parameters%#$x#$x_END Preshell"
Else,If,%RunGroup%,Equal,"Postshell",TXTReplace,"%TargetSystem32%\pecmd.ini","_END PostShell","TEXT %Title%##0xFFFFFF L59 T39 $20#$xEXEC %ExecMode%%ProgramExe% %Parameters%#$x#$x_END PostShell"
Else,If,%RunGroup%,Equal,"RunOnce",Run,%API%,__PhoenixAPI_AddAutoRun_RunOnce
Else,Halt,"AddAutoRun Syntax Error: [%RunGroup%] is not a supported Run method."
End
Else,Begin
// Shortcuts.exe - Not fully implemented yet...
If,%RunPos%,Equal,"Preshell",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,PreConfig,"%Mode%|%Title%|%ProgramExe% %Parameters%"
Else,If,%RunPos%,Equal,"Postshell",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,PostConfig,"%Mode%|%Title%|%ProgramExe% %Parameters%"
//Else,If,%RunPos%,Equal,"?",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,Autorun,"%Mode%|%Title%|%ProgramExe% %Parameters%"
Else,Halt,"AddAutoRun Syntax Error: [%RunPos%] is not a supported Run method."
If,%RunGroup%,Equal,"Preshell",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,PreConfig,"%Mode%|%Title%|%ProgramExe% %Parameters%"
Else,If,%RunGroup%,Equal,"Postshell",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,PostConfig,"%Mode%|%Title%|%ProgramExe% %Parameters%"
//Else,If,%RunGroup%,Equal,"?",IniWriteTextLine,%TargetSystem32%\PhoenixPE.cfg,Autorun,"%Mode%|%Title%|%ProgramExe% %Parameters%"
Else,Halt,"AddAutoRun Syntax Error: [%RunGroup%] is not a supported Run method."
End
System,EndLocal
[#__PhoenixAPI_AddAutoRun_RunOnce#]
// ===============================================================================================================================
// Name...........: PhoenixAPI_AddAutoRun_RunOnce
// Description....: Run a program during startup via HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
// Syntax.........: PhoenixAPI_AddAutoRun_RunOnce
// Parameters.....:
// Return values..:
// Author.........: Homes32
// Remarks........: Internal Function
// Requires hiderun.exe to exist in %SystemRoot% for run hidden.
// Do not call System,SetLocal here. We need this function to run in the same scope as PhoenixAPI_AddAutoRun
// Related........: PhoenixAPI_AddAutoRun
// ===============================================================================================================================
[__PhoenixAPI_AddAutoRun_RunOnce]
// Are hives already loaded? - We don't want to unload them if they were loaded by a script
If,ExistRegSubKey,HKLM,"Tmp_Default",Set,%RegHivesLoaded%,True
Else,Set,%RegHivesLoaded%,False
If,%RegHivesLoaded%,Equal,False,RegHiveLoad,Tmp_Default,%RegDefault%
// RunOnce entries are always processed synchronously, so we ignore the Wait parameter and just run hidden if that's what the user wants
Set,%ExecMode%,""
If,%Mode%,Equal,HideWait,Set,%ExecMode%,"hiderun.exe "
If,%Mode%,Equal,HideNoWait,Set,%ExecMode%,"hiderun.exe "
RegWrite,HKLM,0x2,"Tmp_Default\Software\Microsoft\Windows\CurrentVersion\Run","%Title%","#$q%ExecMode%%ProgramExe%#$q #$q%Parameters%#$q"
If,%RegHivesLoaded%,Equal,False,RegHiveUnload,Tmp_Default
[#_PhoenixAPI_AddShortcut#]
// ===============================================================================================================================
// Name...........: AddShortcut
@@ -693,11 +717,11 @@ System,EndLocal
// Taskbar - Pin to the taskbar.
// #2 Position
// Auto - (Default) Automatically determine the pin position.
// 1-9 - Pin the shortcut to a specific position [1-9].
// 1-99 - Pin the shortcut to a specific position [1-99].
// #3 ProgramExe - The full path to the program to be executed.
// Return values..:
// Author.........: Homes32
// Remarks........: Windows allows a max of 12 pins. This macro relies on PinUtil.exe, which supports pinning up to 10 items.
// Remarks........: This macro relies on PinUtil.exe to perform the actual pinning at boot.
// Pins cannot target an executable located on removable media.
// Related........:
// ===============================================================================================================================
@@ -715,11 +739,11 @@ If,Not,%PinLocation%,Equal,"StartMenu",If,Not,%PinLocation%,Equal,"Taskbar",Halt
If,%PinPos%,Equal,"Auto",Begin
// Find an unused pin position
Loop,%Api%,__PhoenixAPI_PinShortcut_FindOpenPos_Loop,0,9,"%TargetSystem32%\pecmd.ini","PinUtil",%PinLocation%
Loop,%Api%,__PhoenixAPI_PinShortcut_FindOpenPos_Loop,0,99,"%TargetSystem32%\pecmd.ini","PinUtil",%PinLocation%
Set,%PinPos%,#r
End
Else,If,%PinPos%,Smaller,0,Halt,"PinShortcut Syntax Error: [%PinPos%] is not a value from [1-9]."
Else,If,%PinPos%,Bigger,9,Halt,"PinShortcut Syntax Error: [%PinPos%] is not a value from [1-9]."
Else,If,%PinPos%,Smaller,0,Halt,"PinShortcut Syntax Error: [%PinPos%] is not a value from [1-99]."
Else,If,%PinPos%,Bigger,99,Halt,"PinShortcut Syntax Error: [%PinPos%] is not a value from [1-99]."
If,%PinPos%,Equal,-1,Begin
Echo,"PinShortcut Warning: Could not find an open [%PinLocation%] position for [%ProgramExe%].",Warn