All About Resource Hacker in a brief Tutorial



NOTE: 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, it can be found in our "Download" section.

Also if you are getting error "Can't create file...", that means you have edited and saved the same file in past and there is a backup file which need to be deleted before saving this file again. Go to the folder containing this file and you'll see a similar file having "_original" in its name. Delete it and try to save the file in resource hacker.

Resource Hacker is a tool to edit Windows system files like .exe, .dll, .cpl, etc. You can edit these files and can change the look of various dialog boxes, menus and many other things in Windows.

NOTE: This tutorial is divided into 2 parts:

PART1 : BASIC INFORMATION
PART2 : ADVANCED INFORMATION

Basic part contains Basic details, like viewing/replacing resources, etc.
Advanced part covers some advance information which is described for geeks. Like Adding your own resources, using scripts with resource hacker, etc.

PART1 : BASIC INFORMATION

What is Resource Hacker:

Resource Hacker is a Free software to edit 32-bit windows files (DLL, EXE, CPL, and many other). You can add / delete / view / rename / modify existing resources in a file using this great piece of software.

Download Link:

You can download Resource Hacker from here.

You don't need to install it, simply extract the files and run the software. It also doesn't make any entry in Registry!

Using Resource Hacker:

When you open a file in Resource Hacker, it shows various directories in left-side pane, like:

AVI
Cursor
Bitmap
Icon
Menu
Dialog
String Table
Accelerators
Version Info

and so on...

These directories vary from file to file!
Following is a small description of these directories:

AVI : This directory contains AVI files.
Cursor : This directory contains Cursor files.
Bitmap : This directory contains Bitmaps.
Icon : This directory contains Icons.
Menu : This directory contains various Menus.
Dialog : This directory contains various Dialog boxes.
String Table : This directory contains various Strings.
Accelerators : This directory contains Shortcut keys.
Version Info : This directory contains version information of the file.

Viewing Resources:

You can view any resource embedded in the file. Simply expand the directory and click on the name of the resource.
Actually each resource contains 3 parts:

Resource Type
Resource Name
Resource Language

Resource Type : Its indicate that the resource is an AVI/Bitmap/Menu/Cursor/Icon/String/etc.
Resource Name : It describes the name of a resource, no 2 resource can hv the same name.
Resource Language : Its the language used in the file. For ENGLISH its 1033.

Changing the Resources:

=> For Icon/Cursor/Bitmap:

1.) Select the resource ( e.g. Bitmap -> 131 -> 1033 ).
2.) Click on Action -> Replace Icon/Cursor/Bitmap....

3.) It'll open a new window, click on Open file with new Icon/Cursor/Bitmap button.
4.) Select the desired resource in the OPEN dialog box and click on Open button and then Replace.

=> For other resources like AVI:

Its a little bit different.

1.) Click on Action -> Replace Other Resource....
2.) It'll open a new window, click on Open file with new resource button.
3.) Select the file and click on Open button.
4.) Now u hv to give the required information for this resource, which I mentioned earlier.

Resource Type
Resource Name
Resource Language

In type give the type of resource, e.g. if u r replacing AVI file then give the type as AVI.
In name give the exact name of the existing resource which u want to replace with this new one.
In language give 1033 for English.

5.) And finally click on Replace button.

=> For Menus/Strings/Dialogs:

To change String/Menu/Dialog boxes, Select the desired resource, e.g., String Table -> 4 -> 1033, and make ur changes and then click on Compile Script button. It'll compile the script and will give ERROR if something goes wrong so that u can correct the problem!

PART2 : ADVANCED INFORMATION

Adding ur own Resources:

Adding new Bitmaps/Icons/Cursors/AVIs:

1.) Click on Action -> Add a new Resource....
2.) Click on Open file with new resource button.

3.) Select the desired resource and click on Open button.
4.) Give Resource Type/Name/Language. (Remember: Resource Name should be different than the existing resources.)
5.) Click on Add Resource button.

Adding new Menu-items:

U can also add ur own Menu-items, like u can add extra menu (e.g., ur name) in Desktop Context Menu, etc.

1.) Goto desired menu, e.g., Menu -> 215 -> 1033, and add a line anywhere inside POPUP "" or something like that in following format:

MENUITEM "ur_desired_string", 12345, MFT_STRING, MFS_GRAYED | MFS_DEFAULT

Here:

"ur_desired_string" is the text which will be displayed on screen.
12345 is the the identifier, which must be different than other menuitems.
MFT_STRING describes that its a Menuitem with some text.
MFS_GRAYED disables our menuitem. U can also change it to MFS_ENABLED to enable it.
MFS_HILITE automatically select our menuitem. u can ignore it.
MFS_DEFAULT set our menuitem BOLD. u can also ignore it.

Actually u can only give MENUITEM "ur_desired_string", 12345 and Resource Hacker will automatically add other parts.

Adding Newly added Resources in Dialog Boxes:

Once u hv added ur own Icons/Bitmaps/AVIs, u may want to add them in dialog box so that they can be displayed when we open some dialog box (like RUN, Progress Dialog box, etc.).

1.) Goto the desired dialog box, in which u want to add ur own resource, e.g., Dialog -> 1020 -> 1033.
2.) Right-click on the dialog box and select Insert Control option.

3.) It'll open a new window, where u'll see many controls, like BITMAP, LABEL, ICON, BUTTON, SysAnimate32 (for AVIs), etc.
4.) Simply click on the desired control, like to use ur own added Bitmap click on the BITMAP control or to use ur own added AVI click on SysAnimate32 control. U can also add Date/Time control by clicking on SysDateTimePick32 control. :wink:

5.) Don't forget to fill the Caption entry. Actually we hv to enter the resource name in Caption so that our added resource can be displayed on that place! e.g., if u hv added a Bitmap and gave it name as 401, then give 401 in Caption.

PS: For AVI Control ( SysAnimate32 ), u hv to add # before the name in Caption. e.g., if the AVI name 144, then put #144 in Caption.

6.) Finally click on OK button & Compile the script.
7.) U can change its position on the dialog box by simply dragging it to ur desired position.

Using Scripts in Resource Hacker:

We can also use Resource Hacker from Command line w/o going thru its GUI and also can automate many repeatative tasks to save our time.

U can use the scripts in 2 forms:

1.) Single command
2.) Multiple commands

1.) Single Command:

Some useful commands with their format r as follows:

-add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-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,

Here:

ExeFileName : The original file which we want to edit in Resource Hacker
ResultingFileName : The name which we want to give when we save the file.
ResourceAddress : The resource address (like Bitmap location on our HDD).
ResourceType : The resource type (like Bitmap, AVI, etc.).
ResourceName : Resource name (like 131, 1020, etc.).

EX:- ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,

2.) Multiple commands

To use script first u hv to create a script file in notepad and then give following command:

ResHacker.exe -script ScriptFileName

Here: ScriptFileName is the name of the script file which u made in notepad.

Format of a script file:-

[FILENAMES]
Exe=
SaveAs=
Log=
[COMMANDS]
-addoverwrite ResourceAddress, ResourceType, ResourceName

Here:

EXE= is the original file location
SaveAs= is the saved file location
Log= is the LOG file location which will store the log of the process

In [COMMAND] section, we give the commands which we want to execute.

You can omit the LOG entry, then Resource Hacker will automatically create a LOG file named "ResHacker.log".

NOTE: If you face problem while saving the edited files, then use WFP Patcher or Replacer which can be found in "Downloads" section.



This article was posted in Resource Hacker, Software Zone.

Subscribe to RSS Feed | Email Newsletter | More Articles

Related Articles

Popular Articles



375 Comments

  • Any editors for 64 bit files?

  • VG

    ^^ Following tool does:

    http://www.askvg.com/anolis-resourcer-yet-another-resource-hacking-tool/

  • i want to chane the name of welcome name in win xp

  • how to change start button with my picture..........

  • Hey VG! Im making a script to overwrite The String : 37 in explorer.exe with the string in my data.txt.
    but i get soo many errors during scripting!
    Please Help me..

    This is my batch script

    ResourceHacker.exe -addoverwrite explorer.exe, explorermodified.exe, data.txt, STRING TABLE, 37,

    And the Log Shows the following...

    [09 Jul 2009, 20:26:35]
    ResourceHacker.exe -addoverwrite explorer.exe, explorermodified.exe, data.txt, STRING TABLE, 37,
    Error: Comma missing in - -addoverwrite explorer.exe, explorermodified.exe, winstartorbuser.rc, STRING TABLE, 37,
    Error: invalid resource definition.

    Thanks in Advance VG! Best of luck man for ur future works! I tell u from my down side of my heart u r the best and the unbeatable..
    Keep up..

  • Gooday mate:

    Congratulations for this website again.

    1. is impossible to change Windows Explorer without Styler? ... it is because Styler slows down my laptop stealing lots of RAM. if you know other method please let me know.

    2. Then if it is impossible I would like the change the Windows Explorer icons on the toolbar. These are: Back, forward, up, folders, search, refresh, stop, delete, undo, copy, cut, paste, properties and view; so using Resource Hacker, can I change them? is it possible?

    2.1 What files I must modify with resource hacker?
    2.2 which strings I must modify?
    2.3 what format the icons must have? (png, ico, bmp....)
    2.4 what size?

    thank you in advance and please let me know the tricks to make it in the case that it is possible of course.

    Regards,

    PS
    if the answer is too long please send it to my email.

  • hey would u plz tell that files which have unknown format then how could we find out the right software to open it from open with window.

    and above method i cant properly understand is that is to modify right protected files or program there we cant make change if yes then tell me sir

  • Hi VG, i use RH for modify shutdown screen, and replace bitmaps which u gave in Transform windows xp into windows 7 forum. plz can u tell me how can changes apply?
    like changes in msgina.dll thru HR i can follow all steps, now how can i save it replace with orignal one or use save as option or else?
    plz can u tell me?

  • I've been trying to replace AVI and BMP files in ieframe, msgina, shdocvw and shell32 but as soon as i get out of Resource Hacker or move to another .dll all of my changes are gone and it goes back to the old file. I'm not very computer savvy and i had to teach myself how this works so its probably just me but i'd like the help!

  • any one help me to create multi boot cd in which how to create multiple options of setup files such as win xp, win 98se, vista menu in single setup file

Add a Comment

NOTE: If you can't see your comment, please be patient. It'll appear as soon as we approve it.


Create an avatar that will appear with your comment.