HACK ANY EXE FILE - PART2 : ADVANCED INFORMATION
PART 1 <
Adding New Bitmaps / Icons / Cursors / AVIs:
1. Click on Action -> Add a new Resource....
2. Now click on Open file with new resource button.
3. Select the desired resource and click on Open button.
4. Give Resource Type, Name and Language as mentioned earlier. But keep in mind that Resource Name should not match with any existing resources name.
5. At last click on Add Resource button.
Adding New Menus:
Go to desired menu, e.g. Menu -> 215 -> 1033. Now add a new line anywhere inside POPUP "" using following format:
Inserting Newly Added Resources in Dialog Boxes
Once you finish adding new Icons / Bitmaps / AVIs, you can insert them in any dialog box so that you can show in various Windows dialog boxes like RUN, Progress Dialog box, etc.
1. Go to the desired dialog box, e.g. Dialog -> 1020 -> 1033
2. Right-click in the dialog box and select Insert Control option.
3. It'll open a new window. You'll see many controls in the new window, like BITMAP, LABEL, ICON, BUTTON, SysAnimate32 (for AVIs), etc.
4. Click on any desired control, e.g. to insert a Bitmap, click on the BITMAP control or to insert an AVI, click on SysAnimate32 control.
PS: You can also insert Date/Time in dialog box using SysDateTimePick32 control.
5. Don't forget to fill the Caption entry. You need to enter the Resource Name in Caption textbox, e.g. if you have added a Bitmap and set its Resource Name as 401, then give the same 401 in Caption textbox.
PS: For AVI Control ( SysAnimate32 ), you'll need to append # in Caption value, e.g if the AVI name is 144, then put #144 in Caption textbox.
6. At last click on OK button & then Compile the script.
7. If you want to change the position of the new control in dialog box, simply click on the control and drag it to your desired location or you can also use arrow keys to move it.
You can use scripts in 2 ways:
You can use following commands in Command Prompt to perform actions using Resource Hacker:
You can also run a series of commands using script. First you'll need to create the script file using Notepad and then you can run it using following command:
Following is the required format of the script file:
EXE= contains source file name SaveAs= contains output file name Log= contains LOG file name which will store a detailed log of the operation
[COMMANDS] section contains the command-set which we want to perform on the source file.
PS: You can omit the LOG= entry in script file. In this case, Resource Hacker will automatically create a LOG file with the name "ResHacker.log".
NOTE 1: If you are facing problems while saving a file after editing in resource hacker, then make sure you have disabled WFP (Windows File Protection) service using "WFP Patcher" or use "Replacer" to replace the file.
NOTE 2: If you get "Cannot create file" error message while saving the file, please check following tutorial:
How to Fix "Cannot Create File" Error Message While Saving Files in Resource Hacker?
Adding New ResourcesPART2 : ADVANCED INFORMATION
Adding New Bitmaps / Icons / Cursors / AVIs:
1. Click on Action -> Add a new Resource....
2. Now click on Open file with new resource button.
3. Select the desired resource and click on Open button.
4. Give Resource Type, Name and Language as mentioned earlier. But keep in mind that Resource Name should not match with any existing resources name.
5. At last click on Add Resource button.
Adding New Menus:
Go to desired menu, e.g. Menu -> 215 -> 1033. Now add a new line anywhere inside POPUP "" using following format:
MENUITEM "Custom_String", 12345, MFT_STRING, MFS_GRAYED | MFS_DEFAULTWhere:
- "Custom_String" is the actual text which you want to show in menu.
- 12345 is the identifier. It must be different from existing menuitems.
- MFS_GRAYED disables the menuitem. You can change it to MFS_ENABLED if you want to show your menuitem enabled.
- MFS_DEFAULT shows your menuitem in BOLD. You can omit it.
- You can also add a new attribute in the code MFS_HILITE which automatically selects your menuitem.
MENUITEM "Custom_String", 12345And Resource Hacker will automatically insert other remaining values as mentioned above.
Inserting Newly Added Resources in Dialog Boxes
Once you finish adding new Icons / Bitmaps / AVIs, you can insert them in any dialog box so that you can show in various Windows dialog boxes like RUN, Progress Dialog box, etc.
1. Go to the desired dialog box, e.g. Dialog -> 1020 -> 1033
2. Right-click in the dialog box and select Insert Control option.
3. It'll open a new window. You'll see many controls in the new window, like BITMAP, LABEL, ICON, BUTTON, SysAnimate32 (for AVIs), etc.
4. Click on any desired control, e.g. to insert a Bitmap, click on the BITMAP control or to insert an AVI, click on SysAnimate32 control.
PS: You can also insert Date/Time in dialog box using SysDateTimePick32 control.
5. Don't forget to fill the Caption entry. You need to enter the Resource Name in Caption textbox, e.g. if you have added a Bitmap and set its Resource Name as 401, then give the same 401 in Caption textbox.
PS: For AVI Control ( SysAnimate32 ), you'll need to append # in Caption value, e.g if the AVI name is 144, then put #144 in Caption textbox.
6. At last click on OK button & then Compile the script.
7. If you want to change the position of the new control in dialog box, simply click on the control and drag it to your desired location or you can also use arrow keys to move it.
We can also run Resource Hacker using Command Prompt and can use scripts to automate lots of repeatative tasks to save our time.Using Scripts in Resource Hacker
You can use scripts in 2 ways:
- Single Command
- Multiple Commands
You can use following commands in Command Prompt to perform actions using Resource Hacker:
-add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,Where:
-addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-extract ExeFileName, ResourceAddress, ResourceType, ResourceName,
-delete ExeFileName, ResultingFileName, ResourceType, ResourceName,
- ExeFileName - Source file name
- ResultingFileName - Output file name
- ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk)
- ResourceType - Resource type (e.g. Bitmap, AVI, etc.)
- ResourceName - Resource name (e.g. 131, 1020, etc.)
ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,Multiple Commands
You can also run a series of commands using script. First you'll need to create the script file using Notepad and then you can run it using following command:
ResHacker.exe -script ScriptFileNameWhere, ScriptFileName is the name of the script file which you created in Notepad.
Following is the required format of the script file:
[FILENAMES]Where:
Exe=
SaveAs=
Log=
[COMMANDS]
-addoverwrite ResourceAddress, ResourceType, ResourceName
EXE= contains source file name SaveAs= contains output file name Log= contains LOG file name which will store a detailed log of the operation
[COMMANDS] section contains the command-set which we want to perform on the source file.
PS: You can omit the LOG= entry in script file. In this case, Resource Hacker will automatically create a LOG file with the name "ResHacker.log".
NOTE 1: If you are facing problems while saving a file after editing in resource hacker, then make sure you have disabled WFP (Windows File Protection) service using "WFP Patcher" or use "Replacer" to replace the file.
NOTE 2: If you get "Cannot create file" error message while saving the file, please check following tutorial:
How to Fix "Cannot Create File" Error Message While Saving Files in Resource Hacker?
No comments