经常编译软件的人,肯定会使用一些编译和反编译的工具,Resource Hacker作为一款资源编译工具,非常的小巧好用,Resource Hacker没有任何广告,支持打开.exe、.dll、.scr、.mui等windows下的可执行文件,无论是编译还是编辑,都可以轻松完成。
Overview:
Resource Hacker™ has been designed to be the complete resource editing tool: compiling, viewing, decompiling and recompiling resources for both 32bit and 64bit Windows executables. Resource Hacker™ can open any type of Windows executable (*.exe; *.dll; *.scr; *.mui etc) so that individual resources can be added modified or deleted within these files. Resource Hacker™ can create and compile resource script files (*.rc), and edit resource files (*.res) too.
Compiling:
Compiling can be initiated either by passing a resource script file as a parameter on the the command line (see below), or by using Resource Hacker’s text editor.
Supported compiler directives include: #DEFINE, #UNDEF, #IF, #ELIF, #ELSE, #IFDEF, #IFNDEF, #INCLUDE, and #PRAGMA.
The #INCLUDE, #IF, and #IFDEF directives can all be nested to multiple levels.
Strings within resource statements are defined between double-quote (“) characters. These strings can also contain typical ‘C’ style backslashed ‘escaped’ characters — \t , \n , \\ , \” , and \000 .. \377 (octal). A double-quote within a string can be ‘escaped’ by preceding it with either a backslash or with another double-quote character.
Script comments are preceded either by double forward-slashes (//) or by a semi-colon (;).
Filenames in within resource statements can only be parsed as strings, so they MUST be enclosed within double-quote characters otherwise compile errors will be raised.
A complete list of Resource-Definition Statements can be found here.
Viewing Resources:
Once a file has been opened, most resources will be displayed as either an image (or group of images) or as decompiled text:
However, some resource types will be displayed in both its compiled form (eg dialog or popup menu) and in its decompiled text format.
Some resource types can only be displayed as a dump of raw byte data:
Using the internal editor to modify text-based resources:
Dialog, menu, string-table, message-table, accelerators and Borland form resources can all be easily edited and recompiled using the internal resource editor.
Dialog controls can be visually resized and/or moved, with any changes being reflected in the resource script automatically. Conversion between screen pixels and dialog units is done automatically. Select a control by clicking it in the displayed dialog. Alternatively, the Tab or Shift-Tab keys can be used to select next or prior controls respectively. The selected control will show resizing handles. To move a control without resizing, once the control has been selected, click and drag it to its new location. The arrow keys can also be used to move a control once it has been selected. A control can be resized by clicking and dragging one of its resizing handles. Alternatively, the arrow keys combined with the shift key can be used to resize a control.
The Dialog Editor can be opened from the popup menu which is displayed by right-clicking the preview dialog. The Control Editor can be opened from the same menu once a control has been selected.
New controls can also be added. The Control Editor supports almost all of Microsoft’s standard and common control classes. User defined custom classes can also be added to the predefined list of classes by carefully editing the “Dialog.def” text file which can be found in the same folder as Resource Hacker™. Toolbar buttons enable selection of the most commonly used controls. The top-left corner of the control to be added will default to the point at which the dialog was originally right-clicked.
Replacing Images:
If the resource item to be replaced is an icon, cursor, or bitmap, the source can be an *.ico, *.cur or *.bmp file respectively or selected from a *.res or another *.exe file. Select Action|Replace Icon (Cursor or Bitmap) from the menu.
Command Line Syntax:
Just about all the functionality of Resource Hacker™ can be accessed from the command line without having to open the Resource Hacker™ GUI.
Command line instructions and Resource Hacker™ scripts can remove the drudgery entailed with repeating Resource Hacker™ tasks.
Home Page: http://www.angusj.com/resourcehacker/