Introduction to Hex Editing (HxD) - beckabooo/DAV_Modding GitHub Wiki

Intro to Hex Editing

by Gabett

Picture this: you have an idea for a mod. Even better, you find the file you need to edit to make it happen.

…And then the editor says this:

01

Could not find the type […].

Not ideal.

But don’t give up just yet! You can still edit the file, you just need to employ

✧・゚: ✧・゚: Hex Editing :・゚✧:・゚✧

Yay!

Tools you will need:

  • Your friend, the Frosty Editor.
  • Some kind of hex editor. We are going to use HxD in this guide. You can download it here: https://mh-nexus.de/en/hxd/
  • A software to view yaml files. I use Visual Studio Code for this.

Once you have HxD installed, it will look something like this:

02

Set it aside for now and return to the Frosty Editor.

Before anything else, go to Tools -> Options and check the option to Export debug offsets.

03

Now find the file you want to edit. I’m going to show you how I tweaked the timer on the wisps, so I look for PLC_Wisp.

Right click and Export it.

04

Save it once as a yaml (.yaml) file and then export it again and save it as a binary (.bin) file.

05

Now look for exactly what you want to tweak in the Editor. For the wisp mod, I had to edit the Speed value of the TimerEntityData which was the seventh entry (index 6) of the Objects list.

06

The next step is to find this same value within our exported yaml file.

Searching for TimerEntityData will get us to the right entry. Mind the member index, as there are often multiple of the same type of entry, but the member indices can help you orient yourself.

07

See that string of random characters separated by hyphens? It is the GUID (Globally Unique Identifier) of our entry, and you can copy and search for it to get to the right place.

08

Here we can see the same data we did in the Editor, including the Speed value that needs changing.

Now see those zeros followed by numbers and/or letters at the start of each line? These are our offsets (the ones we asked the Editor to export in the Options menu.)

Take note of the offset of the value you want to change and open your binary file in HxD.

You can find your offset by using the first seven characters to identify the right row and the last character to identify to right column.

9

10

But it’s much easier to double click Offset in the bottom left corner and ask it to bring you to the right place.

11

We can see that our value starts at 00 and ends at 03 (since the next entry starts at 04)

10

This, 00 00 80 3F, is the series of characters that stands for “1” in decimal and needs to be edited to change the speed of the timer. To remove the timer, we can overwrite it with zeros:

12

Notice how the numbers are red now? This is how HxD shows you what you edited. They will turn back to their original colors once you save your file.

To figure out what to replace the existing characters with, you can always look for a different entry with the value you want and copy it over. For example, if I wanted to halve the timer’s speed instead of nullify it, I could go:

13

Once you made your changes and saved the file, you can return to the Frosty Editor to Import it.

14

Don’t forget to close the edited file's tab in the Editor and open it again to see the changes.

15