From 159cb37cce93643bb5c02e1bc7d27da95dd3aeff Mon Sep 17 00:00:00 2001 From: Homes32 Date: Sat, 6 Jan 2024 15:27:53 -0600 Subject: [PATCH] Add API documentation for new commands --- PhoenixAPI.md | 52 ++++++++++++++++++--------------- PhoenixAPI/AddStartupConfig.md | 45 ++++++++++++++++++++++++++++ PhoenixAPI/FileSearch.md | 44 ++++++++++++++++++++++++++++ PhoenixAPI/GetBinaryResource.md | 46 +++++++++++++++++++++++++++++ PhoenixAPI/JSONRead.md | 3 +- PhoenixAPI/XMLRead.md | 43 +++++++++++++++++++++++++++ Source-Compatibility.md | 5 +++- 7 files changed, 212 insertions(+), 26 deletions(-) create mode 100644 PhoenixAPI/AddStartupConfig.md create mode 100644 PhoenixAPI/FileSearch.md create mode 100644 PhoenixAPI/GetBinaryResource.md create mode 100644 PhoenixAPI/XMLRead.md diff --git a/PhoenixAPI.md b/PhoenixAPI.md index 033e465..402021b 100644 --- a/PhoenixAPI.md +++ b/PhoenixAPI.md @@ -6,42 +6,46 @@ Click on a Command below for more information. | Command | Description | | --- | --- | -| [[RegLoadHives]] | Mount Source and Build registry hives. | -| [[RegUnloadHives]] | UnMount Source and Build registry hives. | -| [[RegCopyDriver]] | Copy the driver entries from the INSTALL.WIM driver database to the target registry driver database. | -| [[RequireDriver]] | Copy the driver support files and driver entries from the INSTALL.WIM driver database to the target registry driver database. | -| [[DISM]] | Execute DISM with the provided arguments. | | [[7z]] | Execute 7zip with the provided arguments. | -| [[MSIExtract]] | Extract files from an .msi installer. | -| [[Innounp]] | Execute Innounp (Inno Setup Unpacker) with the provided arguments. | -| [[InnoCleanup]] | Cleanup extracted Inno Setup files. | -| [[InnoExtract]] | Extract files from an Inno Setup installer. | -| [[InnoRename]] | Rename extracted Inno Setup files. | -| [[WixExtract]] | Extract files from an Windows Installer XML Toolset (WiX) installer. | -| [[ConvertImage]] | Convert an image to the specified format. | -| [[Associate]] | Associate a file extension with a program. | -| [[SetFileACL]] | Give full control for "Everyone" on a file or directory. | -| [[SetRegACL]] | Take ownership and grant full control for "Everyone" on a registry key. | -| [[FileCopyEx]] | Copy a single file and it's .mui's (if they exist) from a specified directory. | -| [[RequireFile]] | Extract a single file and it's .mui's (if they exist) from Install.wim | -| [[RequireFileEx]] | Extract files and their .mui's (if they exist) from Install.wim | | [[AddAutoRun]] | Run a program when the PE Environment starts. | -| [[AddShortcut]] | Create Shortcuts for programs in PE. | -| [[PinShortcut]] | Pin a shortcut to the taskbar or start menu. | | [[AddPostProcess]] | Configure a section to process during Build Post-Process | -| [[RunFromRam]] | Choose to redirect the programs folder to Boot.wim | -| [[DirDeleteEx]] | Delete a directory if it exists. | -| [[FileDeleteEx]] | Delete a file if it exists. | +| [[AddShortcut]] | Create Shortcuts for programs in PE. | +| [[AddStartupConfig]] | Add a free-form line of code to the startup config. | | [[ApplyBitMask]] | Apply a bitmask to a hex value in a binary string. | +| [[Associate]] | Associate a file extension with a program. | | [[BitClear]] | Clear a specific bit in a binary string. | | [[BitSet]] | Set a specific bit in a binary string. | | [[BitToggle]] | Set/Clear a specific bit in a binary string. | +| [[ConvertImage]] | Convert an image to the specified format. | +| [[DirDeleteEx]] | Delete a directory if it exists. | +| [[DISM]] | Execute DISM with the provided arguments. | +| [[FileCopyEx]] | Copy a single file and it's .mui's (if they exist) from a specified directory. | +| [[FileDeleteEx]] | Delete a file if it exists. | +| [[FileSearch]] | Search for a file and return it's full path if it exists. If the file cannot be found an empty string is returned. | +| [[GetBinaryResource]] | Extract a binary resource from an executable file. | +| [[InnoCleanup]] | Cleanup extracted Inno Setup files. | +| [[InnoExtract]] | Extract files from an Inno Setup installer. | +| [[InnoRename]] | Rename extracted Inno Setup files. | +| [[Innounp]] | Execute Innounp (Inno Setup Unpacker) with the provided arguments. | | [[JSONCompact]] | Compact/minify a JSON value. | | [[JSONDelete]] | Add a new element/text/attribute to an XML file. | | [[JSONPretty]] | Format and indent the JSON file for easy human reading. | | [[JSONRead]] | Read a JSON value. | | [[JSONWrite]] | Set/Modify an JSON value. | -| [[XMLDelete]] | Delete an XML path/value. | +| [[MSIExtract]] | Extract files from an .msi installer. | +| [[PinShortcut]] | Pin a shortcut to the taskbar or start menu. | +| [[RegCopyDriver]] | Copy the driver entries from the INSTALL.WIM driver database to the target registry driver database. | +| [[RegLoadHives]] | Mount Source and Build registry hives. | +| [[RegUnloadHives]] | UnMount Source and Build registry hives. | +| [[RequireDriver]] | Copy the driver support files and driver entries from the INSTALL.WIM driver database to the target registry driver database. | +| [[RequireFileEx]] | Extract files and their .mui's (if they exist) from Install.wim | +| [[RequireFile]] | Extract a single file and it's .mui's (if they exist) from Install.wim | +| [[RunFromRam]] | Choose to redirect the programs folder to Boot.wim | +| [[SetFileACL]] | Give full control for "Everyone" on a file or directory. | +| [[SetRegACL]] | Take ownership and grant full control for "Everyone" on a registry key. | +| [[WixExtract]] | Extract files from an Windows Installer XML Toolset (WiX) installer. | | [[XMLAdd]] | Delete a JSON value. | +| [[XMLDelete]] | Delete an XML path/value. | +| [[XMLRead]] | Read an XML value. | | [[XMLRename]] | Rename a value in an XML file. | | [[XMLUpdate]] | Update the value of an existing Attribute/Element | diff --git a/PhoenixAPI/AddStartupConfig.md b/PhoenixAPI/AddStartupConfig.md new file mode 100644 index 0000000..7d325f4 --- /dev/null +++ b/PhoenixAPI/AddStartupConfig.md @@ -0,0 +1,45 @@ +# AddStartupConfig + +Add a free-form line of code to the startup config (PhoenixPE.au3). + +## Syntax + +```pebakery +AddStartupConfig,,, +``` + +### Arguments + +| Argument | Description | +| --- | --- | +| RunGroup | One of the following: | +|| `PreShell` - Run before the shell (ie. Explorer) is loaded. | +|| `PostShell` - Run after the shell is loaded. | +|| `Network` - Run during network initialization. | +| Code | Free-from line of AutoIt3 code to be inserted. Be sure to escape quotes, etc. Use `#$x` to insert multiple lines in one statement. | +| Position | (Optional) One of the following: | +|| `Append` - (Default) Place the code at the end of the run group. | +|| `Prepend` - Place the code at the start of the run group. | + +## Return Codes + +None. + +## Remarks + +None. + +## Related + +## Examples + +### Example 1 + +Run a program on startup. + +```pebakery + +AddStartupConfig,Network,"SetSplashText(#$qStarting Network List Service...#$q)#$xRegWrite(#$qHKLM\SYSTEM\Setup#$q, #$qSystemSetupInProgress#$q, #$qREG_DWORD#$q, 0)#$xRunProgramWait(@SystemDir & #$q\Net.exe#$q, #$qStart netprofm#$q, @ScriptDir, @SW_HIDE)#$xRegWrite(#$qHKLM\SYSTEM\Setup#$q, #$qSystemSetupInProgress#$q, #$qREG_DWORD#$q, 1)" + +``` + diff --git a/PhoenixAPI/FileSearch.md b/PhoenixAPI/FileSearch.md new file mode 100644 index 0000000..1cde34e --- /dev/null +++ b/PhoenixAPI/FileSearch.md @@ -0,0 +1,44 @@ +# FileSearch + +Search for a file and return it's full path if it exists. If the file cannot be found an empty string is returned. + +## Syntax + +```pebakery +FileSearch,, +``` + +### Arguments + +| Argument | Description | +| --- | --- | +| Directory | The directory to search recursively for the specified file. | +| Filter | The name of the file including it's extension to search for. (Ex. MyProgram.exe). Wildcards are supported. | + +## Return Codes + +| Variable | Description | +| --- | --- | +| #r | One of the following: | +| | Success - A pipe separated list containing the full path(s) to the file. | +| | Fail (File not found) - An Empty String | + +## Remarks + +Use `List,Get` to read the value(s) returned and `List,Count` to get the number of paths returned. + +## Related + +## Examples + +### Example 1 + +Search for a file called *Resources.dll* and return the first path found. + +```pebakery + +FileSearch,"%ProjectTemp%\%ProgramFolder%","Resources.dll" +If,#r,Equal,"",Halt,"Failed to find [Resources.dll]: The code returned was [#r]." +Else,List,Get,#r,1,%ResPath% + +``` \ No newline at end of file diff --git a/PhoenixAPI/GetBinaryResource.md b/PhoenixAPI/GetBinaryResource.md new file mode 100644 index 0000000..78ae887 --- /dev/null +++ b/PhoenixAPI/GetBinaryResource.md @@ -0,0 +1,46 @@ +# GetBinaryResource + +Extract a binary resource from an executable file. + +## Syntax + +```pebakery +GetBinaryResource,,,,[,NOERR] +``` + +### Arguments + +| Argument | Description | +| --- | --- | +| Source | The full path to the source file (.exe, .dll, .mui, .mun, .sys, etc.). | +| ResourceType | Can be a named resource type eg. RT_RCDATA or an ordinal number prefixed with # eg. #100 | +| ResourceID | ID of the resource to extract. eg. NTDRIVER, RC_DATA, or #1000 | +| OutputPath | The full path where the resource will be saved. | +| NOERR | (Optional) Do not Halt on error, just return the exit code passed by GetBinaryResource.exe | + +## Return Codes + +| Variable | Description | +| --- | --- | +| #r | One of the following: | +| | 0 - Success | +| | 1 - Could not load exe | +| | 2 - Could not find resource | +| | 3 - Could not load resource | +| | 4 - Could not lock resource | +| | 5 - Could not save resource to file | +| | 99 - Syntax Error | + +## Remarks + +## Related + +## Examples + +### Example 1 + +```pebakery + +GetBinaryResource,"#$q%TargetPrograms%\%ProgramFolder%\%ProgramExe%#$q BINRES RCDBGSYS #$q%TargetSystem32%\drivers\Dbgv.sys#$q" + +``` \ No newline at end of file diff --git a/PhoenixAPI/JSONRead.md b/PhoenixAPI/JSONRead.md index 2aaffd2..6deb554 100644 --- a/PhoenixAPI/JSONRead.md +++ b/PhoenixAPI/JSONRead.md @@ -5,7 +5,7 @@ Read a JSON value. ## Syntax ```pebakery -JSONRead,, +JSONRead,,[,NOERR] ``` ### Arguments @@ -14,6 +14,7 @@ JSONRead,, | --- | --- | | JSONFile | Full path to the JSON filed to read. | | Path | GJSON Path notation used to locate the value to read. | +| NOERR | (Optional) Don't Halt on errors. (Use if you intend to handle errors yourself). ## Return Codes diff --git a/PhoenixAPI/XMLRead.md b/PhoenixAPI/XMLRead.md new file mode 100644 index 0000000..0fa7554 --- /dev/null +++ b/PhoenixAPI/XMLRead.md @@ -0,0 +1,43 @@ +# XMLRead + +Read an XML value. + +## Syntax + +```pebakery +XMLRead,,[,NOERR] +``` + +### Arguments + +| Argument | Description | +| --- | --- | +| XMLFile | Full path to the XML filed to read. | +| XPath | XPath (XML Path Language) query used to locate the value to read. | +| NOERR | (Optional) Don't Halt on errors. (Use if you intend to handle errors yourself). + +## Return Codes + +| Token | Description | +| --- | --- | +| #r | Returns the value of | + +## Remarks + +For more information about using XPath syntax check out this [XPath Tutorial](https://www.w3schools.com/xml/xpath_intro.asp). + +## Related + +[[XMLAdd]], [[XMLDelete]], [[XMLRename]], [[XMLUpdate]] + +## Examples + +### Example 1 + +```pebakery + +XMLRead,"C:\Temp\Test.xml","//_:SSIDConfig/_:SSID/_:name/text()" +Set,%Value%,#r +Message,Return [%Value%] + +``` \ No newline at end of file diff --git a/Source-Compatibility.md b/Source-Compatibility.md index 916792a..46aa516 100644 --- a/Source-Compatibility.md +++ b/Source-Compatibility.md @@ -18,4 +18,7 @@ Below is a list of Windows version and their PhoenixPE support status. |Windows 10 version 21H1|19043|Unstable|Partial support building from boot.wim.| |Windows 10 version 21H2|19044|Unstable|Partial support building from boot.wim.| |Windows 11 version 21H2|22000|Experimental|No Win11 explorer shell. Use WinXShell or options include explorer.exe from a Win10 host.| -|Windows 11 version 22H2|22621|Stable|Sound only works under Administrator.| \ No newline at end of file +|Windows 11 version 22H2|22621.382|Stable|| +|Windows 11 version 22H2|22621.1702|Stable|| +|Windows 11 version 23H2v1|22621.2428|Stable|| +|Windows 11 version 23H2v2|22621.2861|Unstable|Explorer crash on boot.| \ No newline at end of file