This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
general:guides:hxd_guide [2018/05/24 15:41] – felixwright | general:guides:hxd_guide [2022/12/07 12:03] (current) – felixwright | ||
---|---|---|---|
Line 1: | Line 1: | ||
======HxD Hex Guide====== | ======HxD Hex Guide====== | ||
- | '' | + | '' |
- | Hello, and welcome to our current | + | Hello, and welcome to our current guide for HxD and hex editing in general. |
The main goal of this guide is to teach newbies how to edit ROMs with hexadecimal. | The main goal of this guide is to teach newbies how to edit ROMs with hexadecimal. | ||
Line 9: | Line 9: | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====2. What is Hexadecimal?===== | + | =====What is HxD?===== |
- | To understand hexadecimal, you need to understand decimal. Decimal (also called base-ten, and occasionally called denary) is the standard system | + | HxD is a hex editor, disk editor, and memory editor developed |
- | Example: 100 in Decimal is 100. | + | ________________________________________________________________________ |
+ | ====Downloading HxD==== | ||
- | Hexadecimal is a positional numeral system with a radix, or base, of 16. This means it uses sixteen symbols, in this case 0–9 to represent values zero to nine, and A–F to represent values ten to fifteen. In the romhacking scene, hex values are denoted with '' | + | HxD 2.0 RC can be [[https:// |
- | Example: 100 in Hexadecimal is $64. | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====2. What is HxD?===== | + | =====What is Hexadecimal?===== |
- | HxD is a hex editor, disk editor, and memory editor developed by Maël Hörz for Windows. It 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. | + | To understand hexadecimal, you need to understand decimal. Decimal (also called base-ten, and occasionally called denary) is the standard system |
- | ________________________________________________________________________ | + | Example: 100 in Decimal is 100. |
- | =====3. Downloading HxD===== | + | |
- | HxD 2.0 RC can be [[https:// | + | Hexadecimal is a positional numeral system with a radix, or base, of 16. This means it uses sixteen symbols, in this case 0–9 to represent values zero to nine, and A–F to represent values ten to fifteen. In the romhacking scene, hex values are denoted with '' |
+ | Example: 100 in Hexadecimal is $64, 0x64, or less commonly, 64h. | ||
+ | |||
+ | More examples: | ||
+ | < | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | ====Converting Hex to decimal==== | ||
+ | Select the " | ||
+ | {{general: | ||
+ | Paste in your hex value '' | ||
+ | Select the " | ||
+ | {{general: | ||
+ | '' | ||
+ | ====Converting decimal to Hex==== | ||
+ | Select the " | ||
+ | {{general: | ||
+ | Paste in your dec value '' | ||
+ | Select the " | ||
+ | {{general: | ||
+ | '' | ||
+ | =====Using HxD===== | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====4. Shortcuts===== | + | ====Keyboard |
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: | ||
Line 54: | Line 77: | ||
|Shift + F3 |Find Again (Reverse) | |Shift + F3 |Find Again (Reverse) | ||
|Shift + F6 | |Shift + F6 | ||
- | |Ctrl+Number (0-9) |Goto bookmark | ||
|Ctrl + F4/Ctrl + W | |Ctrl + F4/Ctrl + W | ||
+ | |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/ | ||
Line 61: | Line 84: | ||
|Shift + Up/Shift + Down |Select next/ | |Shift + Up/Shift + Down |Select next/ | ||
|Shift + Left/Shift + Right | |Shift + Left/Shift + Right | ||
+ | // | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====5. Conversions===== | + | ====Going to an offset==== |
- | 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 '' | + | |
- | ====Converting Hex to decimal==== | + | |
- | Select the " | + | |
- | {{general: | + | |
- | Paste in your hex value '' | + | |
- | Select the " | + | |
- | {{general: | + | |
- | '' | + | |
- | ====Converting decimal to Hex==== | + | |
- | Select the " | + | |
- | {{general: | + | |
- | Paste in your dec value '' | + | |
- | Select the " | + | |
- | {{general: | + | |
- | '' | + | |
- | ________________________________________________________________________ | + | |
- | =====6. | + | |
Going forward, Let's say you want to disable the low energy alarm in Zero Mission. '' | Going forward, Let's say you want to disable the low energy alarm in Zero Mission. '' | ||
Line 88: | Line 95: | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====7. Editing Hex Values===== | + | ====Editing Hex Values==== |
So we're at address '' | So we're at address '' | ||
+ | |||
+ | ________________________________________________________________________ | ||
+ | =====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 '' | ||
+ | |||
+ | **Examples: | ||
+ | |||
+ | ^ PC address ^ SNES address ^ | ||
+ | | $4000 | $80: | ||
+ | | $9500 | $81: | ||
+ | | $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. | ||
+ | |||
+ | It is not necessarily important to know //how// to convert between PC and LoROM addresses, since there is a program called [[http:// | ||
+ | |||
+ | To know at a glance whether or not an address is a SNES or PC address, know that Super Metroid, as well as just about every other SNES game, never comes close to reaching '' | ||
+ | |||
+ | ====List of SM's Banks at a Glance==== | ||
+ | From the SMMM: | ||
+ | < | ||
+ | --------------------------------------------------------------------------------------------------------------------- | ||
+ | Bank $80 $80: | ||
+ | Bank $81 $81: | ||
+ | Bank $82 $82: | ||
+ | Bank $83 $83: | ||
+ | Bank $84 $84: | ||
+ | Bank $85 $85: | ||
+ | Bank $86 $86: | ||
+ | Bank $87 $87: | ||
+ | Bank $88 $88: | ||
+ | Bank $89 $89: | ||
+ | Bank $8A $8A: | ||
+ | Bank $8B $8B: | ||
+ | Bank $8C $8C: | ||
+ | Bank $8D $8D: | ||
+ | Bank $8E $8E: | ||
+ | Bank $8F $8F: | ||
+ | |||
+ | Bank $90 $90: | ||
+ | Bank $91 $91: | ||
+ | Bank $92 $92: | ||
+ | Bank $93 $93: | ||
+ | Bank $94 $94: | ||
+ | Bank $95 $95: | ||
+ | Bank $96 $96: | ||
+ | Bank $97 $97: | ||
+ | Bank $98 $98: | ||
+ | Bank $99 $99: | ||
+ | Bank $9A $9A: | ||
+ | Bank $9B $9B: | ||
+ | Bank $9C $9C: | ||
+ | Bank $9D $9D: | ||
+ | Bank $9E $9E: | ||
+ | Bank $9F $9F: | ||
+ | |||
+ | Bank $A0 $A0: | ||
+ | Bank $A1 $A1: | ||
+ | Bank $A2 $A2: | ||
+ | Bank $A3 $A3: | ||
+ | Bank $A4 $A4: | ||
+ | Bank $A5 $A5: | ||
+ | Bank $A6 $A6: | ||
+ | Bank $A7 $A7: | ||
+ | Bank $A8 $A8: | ||
+ | Bank $A9 $A9: | ||
+ | Bank $AA $AA: | ||
+ | Bank $AB $AB: | ||
+ | Bank $AC $AC: | ||
+ | Bank $AD $AD: | ||
+ | Bank $AE $AE: | ||
+ | Bank $AF $AF: | ||
+ | |||
+ | Bank $B0 $B0: | ||
+ | Bank $B1 $B1: | ||
+ | Bank $B2 $B2: | ||
+ | Bank $B3 $B3: | ||
+ | Bank $B4 $B4: | ||
+ | Bank $B5 $B5: | ||
+ | Bank $B6 $B6: | ||
+ | Bank $B7 $B7: | ||
+ | Bank $B8 $B8: | ||
+ | Bank $B9 $B9: | ||
+ | Bank $BA $BA: | ||
+ | Bank $BB $BB: | ||
+ | Bank $BC $BC: | ||
+ | Bank $BD $BD: | ||
+ | Bank $BE $BE: | ||
+ | Bank $BF $BF: | ||
+ | |||
+ | Bank $C0 $C0: | ||
+ | Bank $C1 $C1: | ||
+ | Bank $C2 $C2: | ||
+ | Bank $C3 $C3: | ||
+ | Bank $C4 $C4: | ||
+ | Bank $C5 $C5: | ||
+ | Bank $C6 $C6: | ||
+ | Bank $C7 $C7: | ||
+ | Bank $C8 $C8: | ||
+ | Bank $C9 $C9: | ||
+ | Bank $CA $CA: | ||
+ | Bank $CB $CB: | ||
+ | Bank $CC $CC: | ||
+ | Bank $CD $CD: | ||
+ | Bank $CE $CE: | ||
+ | Bank $CF $CF: | ||
+ | |||
+ | Bank $D0 $D0: | ||
+ | Bank $D1 $D1: | ||
+ | Bank $D2 $D2: | ||
+ | Bank $D3 $D3: | ||
+ | Bank $D4 $D4: | ||
+ | Bank $D5 $D5: | ||
+ | Bank $D6 $D6: | ||
+ | Bank $D7 $D7: | ||
+ | Bank $D8 $D8: | ||
+ | Bank $D9 $D9: | ||
+ | Bank $DA $DA: | ||
+ | Bank $DB $DB: | ||
+ | Bank $DC $DC: | ||
+ | Bank $DD $DD: | ||
+ | Bank $DE $DE: | ||
+ | Bank $DF $DF: | ||
+ | |||
+ | Banks $E0-FF must be added by SMILE (" | ||
+ | |||
+ | Bank $E0 $E0: | ||
+ | Bank $E1 $E1: | ||
+ | Bank $E2 $E2: | ||
+ | Bank $E3 $E3: | ||
+ | Bank $E4 $E4: | ||
+ | Bank $E5 $E5: | ||
+ | Bank $E6 $E6: | ||
+ | Bank $E7 $E7: | ||
+ | Bank $E8 $E8: | ||
+ | Bank $E9 $E9: | ||
+ | Bank $EA $EA: | ||
+ | Bank $EB $EB: | ||
+ | Bank $EC $EC: | ||
+ | Bank $ED $ED: | ||
+ | Bank $EE $EE: | ||
+ | Bank $EF $EF: | ||
+ | Bank $F0 $F0: | ||
+ | |||
+ | Bank $F1 $F1: | ||
+ | Bank $F2 $F2: | ||
+ | Bank $F3 $F3: | ||
+ | Bank $F4 $F4: | ||
+ | Bank $F5 $F5: | ||
+ | Bank $F6 $F6: | ||
+ | Bank $F7 $F7: | ||
+ | Bank $F8 $F8: | ||
+ | Bank $F9 $F9: | ||
+ | Bank $FA $FA: | ||
+ | Bank $FB $FB: | ||
+ | Bank $FC $FC: | ||
+ | Bank $FD $FD: | ||
+ | Bank $FE $FE: | ||
+ | Bank $FF $FF: |