general:guides:hxd_guide
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
general:guides:hxd_guide [2024/10/18 21:58] – created felixwright | general:guides:hxd_guide [2024/10/18 22:28] (current) – [Downloading HxD] felixwright | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | HxD Hex Guide | + | ====== |
By FelixWright and Nodever2 | By FelixWright and Nodever2 | ||
Line 9: | Line 9: | ||
Let's get started. | Let's get started. | ||
- | What is HxD? | + | ===== What is HxD? ===== |
HxD is a hex editor, disk editor, and memory editor developed for Windows. HxD can open files larger than 4 GiB and open and edit the raw contents of disk drives, as well as display and edit the memory used by running processes. Among other features, it can calculate various checksums, compare files, or shred files. The most recent version was created in 2009 by Maël Hörz. | HxD is a hex editor, disk editor, and memory editor developed for Windows. HxD can open files larger than 4 GiB and open and edit the raw contents of disk drives, as well as display and edit the memory used by running processes. Among other features, it can calculate various checksums, compare files, or shred files. The most recent version was created in 2009 by Maël Hörz. | ||
- | Downloading HxD | + | ===== Downloading HxD ===== |
- | HxD 2.0 RC can be downloaded from mh-nexus. | + | HxD 2.0 RC can be [[https:// |
What is Hexadecimal? | What is Hexadecimal? | ||
Line 29: | Line 29: | ||
More examples: | More examples: | ||
- | DECIMAL | + | |
- | + | HEX = 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F | |
- | HEX = 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F | + | |
There are many online resources for converting hex to decimal, but in this tutorial I will explain how to convert hex to decimal and decimal to hex using windows calculator. Before we begin, run calc.exe and press Alt + 3. This will put the calculator in programming mode. | There are many online resources for converting hex to decimal, but in this tutorial I will explain how to convert hex to decimal and decimal to hex using windows calculator. Before we begin, run calc.exe and press Alt + 3. This will put the calculator in programming mode. | ||
- | Converting Hex to decimal | + | |
+ | ===== Converting Hex to decimal | ||
Select the “Hex” Bubble. | Select the “Hex” Bubble. | ||
Line 41: | Line 41: | ||
Ctrl + C to copy converted value to clipboard. | Ctrl + C to copy converted value to clipboard. | ||
- | Converting decimal to Hex | + | |
+ | ===== Converting decimal to Hex ===== | ||
Select the “Dec” Bubble. | Select the “Dec” Bubble. | ||
Line 48: | Line 49: | ||
Ctrl + C to copy converted value to clipboard. | Ctrl + C to copy converted value to clipboard. | ||
- | Using HxD | + | |
+ | ===== Using HxD ===== | ||
Keyboard Shortcuts | Keyboard Shortcuts | ||
Before we get into hex editing you should learn keyboard shortcuts. For ROMHacking, here's what you will need to know: | Before we get into hex editing you should learn keyboard shortcuts. For ROMHacking, here's what you will need to know: | ||
- | Key Combination | + | ^ Key Combination |
- | F3 Find Again | + | |F3 | Find Again | |
- | F6 Next Difference (File Compare) | + | |F6 | Next Difference (File Compare) |
- | Delete | + | |Delete |
- | CTRL + A Select All | + | |CTRL + A | Select All | |
- | CTRL + E Select Block… | + | |CTRL + E | Select Block… |
- | CTRL + G Go To… | + | |CTRL + G | Go To… | |
- | CTRL + K File Compare… | + | |CTRL + K | File Compare… |
- | CTRL + N New file (Empty) | + | |CTRL + N | New file (Empty) |
- | CTRL + C Copy Selection | + | |CTRL + C | Copy Selection |
- | CTRL + X Cut Selection | + | |CTRL + X | Cut Selection |
- | CTRL + V Paste Insert (Note: This increases filesize!) | + | |CTRL + V | Paste Insert (Note: This increases filesize!) |
- | CTRL + B Paste Write (Overwrite) | + | |CTRL + B | Paste Write (Overwrite) |
- | CTRL + Z Undo | + | |CTRL + Z | Undo | |
- | CTRL + Y Redo | + | |CTRL + Y | Redo | |
- | CTRL + O Open a file… | + | |CTRL + O | Open a file… |
- | CTRL + R Find & Replace… | + | |CTRL + R | Find & Replace… |
- | CTRL + S Save a file | + | |CTRL + S | Save a file | |
- | Shift + F3 Find Again (Reverse) | + | |Shift + F3 | Find Again (Reverse) |
- | Shift + F6 Previous Difference (File Compare) | + | |Shift + F6 | Previous Difference (File Compare) |
- | Ctrl + F4/Ctrl + W Close file | + | |Ctrl + F4/Ctrl + W | Close file | |
- | Ctrl+Number (0-9) Goto bookmark | + | |Ctrl+Number (0-9) | Goto bookmark |
- | Ctrl+Shift+Number (0-9) Add bookmark | + | |Ctrl+Shift+Number (0-9) | Add bookmark |
- | Left and Right Arrow keys Move to next/ | + | |Left and Right Arrow keys | Move to next/ |
- | Up and Down Arrow keys Move to next/ | + | |Up and Down Arrow keys | Move to next/ |
- | Shift + Up/Shift + Down Select next/ | + | |Shift + Up/Shift + Down | Select next/ |
- | Shift + Left/Shift + Right Select next/ | + | |Shift + Left/Shift + Right | Select next/ |
WARNING: Changes in filesize could destroy your ROM if you're not careful! | WARNING: Changes in filesize could destroy your ROM if you're not careful! | ||
- | Going to an offset | + | |
+ | ===== Going to an offset | ||
Going forward, Let's say you want to disable the low energy alarm in Zero Mission. 0x52888 = 1D 2F to 14 E0 | Going forward, Let's say you want to disable the low energy alarm in Zero Mission. 0x52888 = 1D 2F to 14 E0 | ||
Line 90: | Line 93: | ||
As you can see, by default HxD assumes you want to put in a hex address, and the address above is hex so that is fine. If you run into a decimal or octal address though, you can select the dec or oct bubbles and then paste in the address. | As you can see, by default HxD assumes you want to put in a hex address, and the address above is hex so that is fine. If you run into a decimal or octal address though, you can select the dec or oct bubbles and then paste in the address. | ||
- | Editing Hex Values | + | ===== Editing Hex Values |
So we're at address 0x52888. The text cursor should be blinking to the left of 1D. Select 1D, and type 14. Your cursor should now be blinking to the left of 2F. Select 2F, and replace it with E0. Save your changes with Ctrl + S. You have just performed a hex tweak! Open your ROM in an emulator, and reduce samus' energy below 30. There should no longer be a low energy alarm. | So we're at address 0x52888. The text cursor should be blinking to the left of 1D. Select 1D, and type 14. Your cursor should now be blinking to the left of 2F. Select 2F, and replace it with E0. Save your changes with Ctrl + S. You have just performed a hex tweak! Open your ROM in an emulator, and reduce samus' energy below 30. There should no longer be a low energy alarm. | ||
- | PC vs SNES addresses | + | ===== PC vs SNES addresses |
SNES roms are divided into banks, which are $8000 bytes long (32,768 bytes in decimal). Super Metroid is of the rom type LoROM, so it can address banks from bank $80-$FF. Because HxD uses PC addresses, and the majority of documentation for SNES games is written with SNES addresses, it's important to know the distinction between the two. PC addresses start at $000000, while SNES addresses start at $80:8000. Every SNES bank starts at $XX:8000, where XX is the bank number. The game reads addresses in this LoROM format. In a LoROM address, the bank is number separated by a colon. | SNES roms are divided into banks, which are $8000 bytes long (32,768 bytes in decimal). Super Metroid is of the rom type LoROM, so it can address banks from bank $80-$FF. Because HxD uses PC addresses, and the majority of documentation for SNES games is written with SNES addresses, it's important to know the distinction between the two. PC addresses start at $000000, while SNES addresses start at $80:8000. Every SNES bank starts at $XX:8000, where XX is the bank number. The game reads addresses in this LoROM format. In a LoROM address, the bank is number separated by a colon. | ||
Examples: | Examples: | ||
- | PC address | + | |
- | $4000 $80:C000 | + | ^ PC address |
- | $9500 $81:0500 | + | | $4000 |
- | $791F8 | + | | $9500 |
- | $7FFFF | + | | $791F8 |
+ | | $7FFFF | ||
Looking at the LoROM addresses, we can see these addresses are referring to locations in banks 80, 81, 8F, and 8F (again), respectively. | Looking at the LoROM addresses, we can see these addresses are referring to locations in banks 80, 81, 8F, and 8F (again), respectively. | ||
Line 114: | Line 119: | ||
From the SMMM: | From the SMMM: | ||
+ | < | ||
Bank $## LoROM address | Bank $## LoROM address | ||
--------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ||
Line 253: | Line 259: | ||
Bank $FE $FE: | Bank $FE $FE: | ||
Bank $FF $FF: | Bank $FF $FF: | ||
- | + | </ |
general/guides/hxd_guide.1729288686.txt.gz · Last modified: by felixwright