This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
general:guides:hxd_guide [2018/05/24 14:48] – felixwright | general:guides:hxd_guide [2020/07/08 04:00] – nodever2 | ||
---|---|---|---|
Line 9: | Line 9: | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====2. What is Hexadecimal? | + | =====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. | ||
+ | |||
+ | ________________________________________________________________________ | ||
+ | ====Downloading HxD==== | ||
+ | |||
+ | HxD 2.0 RC can be [[https:// | ||
+ | |||
+ | |||
+ | ________________________________________________________________________ | ||
+ | =====What is Hexadecimal? | ||
To understand hexadecimal, | To understand hexadecimal, | ||
Line 15: | Line 26: | ||
Example: 100 in Decimal is 100. | Example: 100 in Decimal is 100. | ||
- | 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 '' | + | 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</ | ||
- | Example: 100 in Hexadecimal is 64. | ||
- | ________________________________________________________________________ | ||
- | =====2. Conversions===== | ||
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 '' | 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==== | ====Converting Hex to decimal==== | ||
Select the " | Select the " | ||
- | {{general: | + | {{general: |
Paste in your hex value '' | Paste in your hex value '' | ||
Select the " | Select the " | ||
- | {{general: | + | {{general: |
'' | '' | ||
====Converting decimal to Hex==== | ====Converting decimal to Hex==== | ||
Select the " | Select the " | ||
- | {{general: | + | {{general: |
Paste in your dec value '' | Paste in your dec value '' | ||
Select the " | Select the " | ||
- | {{general: | + | {{general: |
'' | '' | ||
+ | =====Using HxD===== | ||
________________________________________________________________________ | ________________________________________________________________________ | ||
- | =====3. What is HxD?===== | + | ====Keyboard |
- | + | ||
- | 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. | + | |
- | + | ||
- | ________________________________________________________________________ | + | |
- | =====4. Downloading HxD===== | + | |
- | + | ||
- | HxD 2.0 RC can be [[https:// | + | |
- | + | ||
- | ________________________________________________________________________ | + | |
- | =====5. | + | |
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 52: | Line 59: | ||
^Key Combination ^Description | ^Key Combination ^Description | ||
|F3 |Find Again | | |F3 |Find Again | | ||
- | |Shift + F3 |Find Again (Reverse) | ||
- | |Ctrl + F4/Ctrl + W | ||
|F6 |Next Difference (File Compare) | |F6 |Next Difference (File Compare) | ||
- | |Shift + F6 | ||
|Delete | |Delete | ||
- | |Left and Right Arrow keys |Move to next/ | ||
- | |Up and Down Arrow keys |Move to next/ | ||
|CTRL + A | |CTRL + A | ||
|CTRL + E | |CTRL + E | ||
Line 73: | Line 75: | ||
|CTRL + R |Find & Replace... | |CTRL + R |Find & Replace... | ||
|CTRL + S |Save a file | | |CTRL + S |Save a file | | ||
- | ________________________________________________ | + | |Shift + F3 |Find Again (Reverse) |
+ | |Shift + F6 | ||
+ | |Ctrl + F4/Ctrl + W | ||
+ | |Ctrl+Number (0-9) |Goto bookmark | ||
+ | |Ctrl+Shift+Number (0-9) |Add bookmark | ||
+ | |Left and Right Arrow keys |Move to next/ | ||
+ | |Up and Down Arrow keys |Move to next/ | ||
+ | |Shift + Up/Shift + Down |Select next/ | ||
+ | |Shift + Left/Shift + Right | ||
+ | // | ||
+ | ________________________________________________________________________ | ||
+ | ====Going to an offset==== | ||
+ | |||
+ | Going forward, Let's say you want to disable the low energy alarm in Zero Mission. '' | ||
+ | |||
+ | Open Zero Mission in HxD, and use Goto... '' | ||
+ | {{general: | ||
+ | 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==== | ||
+ | |||
+ | 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: |