Difference between revisions of "HackerTools"

From UFOpaedia
Jump to navigation Jump to search
(A few additions, plus the note on screencaps)
m
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Windows comes with the simple but effective EDIT hex editor. To use it:
 
  
* /Start /Run then enter EDIT
+
<big>'''NOTE: A move has been made to delete this page and/or redirect it to [[Game_editors#Useful_Generic_File_Editors]] - see Talk page '''</big>
* Point to the game file of interest. This DOS tool has some old conventions such as: clicking on the two periods (..) at the top of the Directory list moves you up one directory level. Use Help (F1) for more info. Once you've highlighted the file of interest,
 
* Checkmark "Open Binary"
 
* If you know the record length for your file of interest, enter it on "Line Width". For example, SOLDIER.DAT has record lengths of 68. This causes file entries to "line up" and makes patterns obvious.
 
* If you're new to hacking, checkmark "Open Read-Only". This prevents you from making changes.
 
  
  
Editing:
+
Windows 95 and beyond offer a simple but effective text editor that can be used to hex edit binary files: [[MS-Edit]].
* The "Col" and "Value" info along the bottom bar show you the current byte column you're in, and its value. Use this when comparing your file against e.g. the [[SOLDIER.DAT]] and [[UNITREF.DAT]] wiki entries.
 
* Many folks talk about byte positions using <i>offsets</i> (starts at 0, and is indicated by [square brackets]) whereas EDIT does not (starts with column 1). If the values don't seem to be jiving, try looking one column to the right (or left!).
 
* <b>WARNING:</b> When you first start to edit, hit the Insert key <b>once</b> to get the big block cursor. This puts you in Overwrite mode instead of Insert mode (the small underline cursor). Be VERY CAREFUL about hitting the Insert key again. Insert mode is a Very Bad Thing<i>(tm)</i> for binary files. Inserting a byte moves every subsequent byte over by one, thus nuking position-based files (i.e., most XCOM files). If your game has gone south and you're SOL though, you might give it a shot... you never know what might happen!
 
* Likewise, be VERY CAREFUL about hitting keys like Delete, Backspace, or Enter. All these (and more!) mess with positionality. If you ever see that records aren't lining up, Close without saving!!
 
* To enter numeric values into a byte:
 
** Hold down an Alt key (either one)
 
** Using the NUMERIC KEYPAD (the numbers on right side of keyboard, not the ones along the top of keyboard), type in the number you want to enter. It doesn't matter if Numlock is on or off.
 
** Let go of the Alt key
 
** The number will now be entered. However, for values less than 28, you have to go through special gyrations (these were "control characters" for DOS). First, hit Control-P (^P). Then:
 
*** For 0, hit ^2 (don't ask why)
 
*** For 1-26, hit ^A to ^Z. For example, ^A is 1, ^M is 13, ^Z is 26.
 
*** For 27, hit ^[
 
* A handy lookup table for numbers versus characters can be found as a .GIF [[Media:DOS_Chars_In_MsEdit.gif|here]] or the same thing in a .PDF [[Media:DOS_Chars_In_MsEdit.pdf|here]]
 
* If you see that your number makes a "regular" character (e.g. 65=A), you can also simply type in that character. However, the space character (number 32) looks just like a null character (number 0); don't use a space to mean zero!
 
* Make a copy of the file if you're unsure of what you're doing. EDIT prompts you about making a .BAK backup file when you save edits, which is a nice convenience.
 
 
 
 
 
Also:
 
* Some savegame files store 'rubbish' in a field that's not being used. For example, not all soldier and alien names are 25 characters long (26 including the null byte, value 00, that shows where it ends). You'll usually find rubbish stored in the columns past the name end. It can be the remains of old (longer) names, or might even be e.g. random Windows crap that was in that position in RAM when the file was last in memory. Garbage characters may also show up in e.g. fields that an alien doesn't use (but soldiers do). Don't worry about them... if there's no reason for the game to use them, they're meaningless.
 
* Another <b>WARNING</b>: If you have a file open in EDIT, it may be LOCKED by the system. This means that other programs (like XCOM) can't write to it. XCOM won't necessarily complain!... but then you might end up with major weirdness. Or maybe not. Anyway, be sure to Close a file before XCOM might try to write to it.
 
  
 +
----
  
 
Another hex editor that some folks use is Hex Workshop by [http://www.bpsoft.com www.BPSoft.com]. Hex Workshop has the nice feature that you can make a 'structure library' with the meaning (field name) of each byte, turning the file into a little database. You will see some of these definitions (.HSLs) in the game file wikis. Hex Workshop is free for 30 days and then costs $50 if you want to keep using it. While it has a number of nice features, it does have some drawbacks. Examples: 1) Its display field can't be more than 64 characters wide (unlike EDIT), so you can't do a "one row equals one record" display for e.g. SOLDIER.DAT (reclength 68) or UNITREF.DAT (reclength 124). Related to this, 2) although it's a "modern" Windows app, you can't e.g. go to some tiny font and see a lot more in your data display window (even though you probably have 1600x1200 screen rez as a L33T gamer).
 
Another hex editor that some folks use is Hex Workshop by [http://www.bpsoft.com www.BPSoft.com]. Hex Workshop has the nice feature that you can make a 'structure library' with the meaning (field name) of each byte, turning the file into a little database. You will see some of these definitions (.HSLs) in the game file wikis. Hex Workshop is free for 30 days and then costs $50 if you want to keep using it. While it has a number of nice features, it does have some drawbacks. Examples: 1) Its display field can't be more than 64 characters wide (unlike EDIT), so you can't do a "one row equals one record" display for e.g. SOLDIER.DAT (reclength 68) or UNITREF.DAT (reclength 124). Related to this, 2) although it's a "modern" Windows app, you can't e.g. go to some tiny font and see a lot more in your data display window (even though you probably have 1600x1200 screen rez as a L33T gamer).
Line 41: Line 17:
  
 
----
 
----
 +
 +
Another VERY useful hex editing program is the Universal Game Editor (UGE). It is a hex editor which displays numbers in digits instead of hex codes. It uses templates that can store variables found in the game files, so that they can be easily edited (including variables with 1, 2, or 4 bytes, or text entries).
 +
 +
It can be found from a variety of locations using a search engine. The program is only about 400kb and is free to use (shareware with full capabilities, but has a reminder screen).
 +
 +
----
 +
 +
If you REALLY know what you are doing, you could also use Raihan Kibria's frhed (FRee Hex EDitor) found [http://www.kibria.de/frhed.html here] (237 kB plus source). Unlike the above two examples, this editor is completely free.
 +
 +
----
 +
  
 
Return to [[Game_Files]]
 
Return to [[Game_Files]]

Latest revision as of 15:21, 12 September 2012

NOTE: A move has been made to delete this page and/or redirect it to Game_editors#Useful_Generic_File_Editors - see Talk page


Windows 95 and beyond offer a simple but effective text editor that can be used to hex edit binary files: MS-Edit.


Another hex editor that some folks use is Hex Workshop by www.BPSoft.com. Hex Workshop has the nice feature that you can make a 'structure library' with the meaning (field name) of each byte, turning the file into a little database. You will see some of these definitions (.HSLs) in the game file wikis. Hex Workshop is free for 30 days and then costs $50 if you want to keep using it. While it has a number of nice features, it does have some drawbacks. Examples: 1) Its display field can't be more than 64 characters wide (unlike EDIT), so you can't do a "one row equals one record" display for e.g. SOLDIER.DAT (reclength 68) or UNITREF.DAT (reclength 124). Related to this, 2) although it's a "modern" Windows app, you can't e.g. go to some tiny font and see a lot more in your data display window (even though you probably have 1600x1200 screen rez as a L33T gamer).


If you're on a budget, EDIT is a fine little tool. I, for one, once used Hex Workshop, but now exclusively use EDIT.


NOTE: To make screen captures, see this.



Another VERY useful hex editing program is the Universal Game Editor (UGE). It is a hex editor which displays numbers in digits instead of hex codes. It uses templates that can store variables found in the game files, so that they can be easily edited (including variables with 1, 2, or 4 bytes, or text entries).

It can be found from a variety of locations using a search engine. The program is only about 400kb and is free to use (shareware with full capabilities, but has a reminder screen).


If you REALLY know what you are doing, you could also use Raihan Kibria's frhed (FRee Hex EDitor) found here (237 kB plus source). Unlike the above two examples, this editor is completely free.



Return to Game_Files