GetStringResource command added.

Homes32
2024-01-06 21:07:29 -06:00
parent 159cb37cce
commit 763afd67ae
3 changed files with 48 additions and 3 deletions

@@ -23,6 +23,7 @@ Click on a Command below for more information.
| [[FileDeleteEx]] | Delete a file if it exists. | | [[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. | | [[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. | | [[GetBinaryResource]] | Extract a binary resource from an executable file. |
| [[GetStringResource]] | Extract a string resource from an executable file. |
| [[InnoCleanup]] | Cleanup extracted Inno Setup files. | | [[InnoCleanup]] | Cleanup extracted Inno Setup files. |
| [[InnoExtract]] | Extract files from an Inno Setup installer. | | [[InnoExtract]] | Extract files from an Inno Setup installer. |
| [[InnoRename]] | Rename extracted Inno Setup files. | | [[InnoRename]] | Rename extracted Inno Setup files. |

@@ -13,8 +13,8 @@ GetBinaryResource,<Source>,<ResourceType>,<ResourceID>,<OutputPath>[,NOERR]
| Argument | Description | | Argument | Description |
| --- | --- | | --- | --- |
| Source | The full path to the source file (.exe, .dll, .mui, .mun, .sys, etc.). | | 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 | | 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 | | ResourceID | ID of the resource to extract. eg. `NTDRIVER`, `RC_DATA`, or `#1000` |
| OutputPath | The full path where the resource will be saved. | | 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 | | NOERR | (Optional) Do not Halt on error, just return the exit code passed by GetBinaryResource.exe |
@@ -41,6 +41,6 @@ GetBinaryResource,<Source>,<ResourceType>,<ResourceID>,<OutputPath>[,NOERR]
```pebakery ```pebakery
GetBinaryResource,"#$q%TargetPrograms%\%ProgramFolder%\%ProgramExe%#$q BINRES RCDBGSYS #$q%TargetSystem32%\drivers\Dbgv.sys#$q" GetBinaryResource,"%TargetPrograms%\%ProgramFolder%\%ProgramExe","BINRES","RCDBGSYS","%TargetSystem32%\drivers\Dbgv.sys"
``` ```

@@ -0,0 +1,44 @@
# GetStringResource
Extract a string resource from an executable file.
## Syntax
```pebakery
GetStringResource,<Source>,<StringID>[,NOERR]
```
### Arguments
| Argument | Description |
| --- | --- |
| Source | The full path to the binary containing the string resource (.exe, .dll, .mui, .mun, .sys, etc.). |
| StringID | ID of the string resource to extract. eg. `1000` |
| NOERR | (Optional) Do not Halt on error, just return the exit code passed by GeStringResource.exe |
## Return Codes
| Variable | Description |
| --- | --- |
| #r | One of the following: |
| | 0 - Success |
| | 1 - Could not load exe |
| | 2 - Could not load string |
| | 3 - Could not create .ini file |
| | 4 - Could not write string |
| | 99 - Syntax Error |
## Remarks
## Related
## Examples
### Example 1
```pebakery
GetStringResource,"%TargetPrograms%\%ProgramFolder%\%ProgramExe",64800
Echo,#r
```