News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Please don't tell me Hex Editing is the only way...  (Read 13975 times)

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Please don't tell me Hex Editing is the only way...
« on: November 30, 2011, 02:55:31 pm »
I've always had a fascination with Megaman Hacks where the music is changed. I download so many hacks just to see what kind of music they put in them. I've always wanted to edit Megaman music as well.

...I'm sorry, but I CAN NOT figure out Hex Editors. I try editing numbers on random just to see what's changed, and nothing usually happens except misplaced sprites or malfunctioning objects. Please don't tell me Hex Editing is the only way to change the music. Please tell me there's an easier way.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 433
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #1 on: November 30, 2011, 03:30:19 pm »
I've always had a fascination with Megaman Hacks where the music is changed. I download so many hacks just to see what kind of music they put in them. I've always wanted to edit Megaman music as well.

...I'm sorry, but I CAN NOT figure out Hex Editors. I try editing numbers on random just to see what's changed, and nothing usually happens except misplaced sprites or malfunctioning objects. Please don't tell me Hex Editing is the only way to change the music. Please tell me there's an easier way.

Unless there are specific editors for the game in question that import something like a MIDI or other music sequence file you will 100% need to learn to use a hex editor.  And even then I and probably most of the people here will agree you should learn hex at some point if you plan on changing anything yourself in a game.  In other words at some point hex editing is a necessary activity whether you do it or someone codes a program to do it for you.  What to change a game?  Learn hex editing.  It really is the correct answer.

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Please don't tell me Hex Editing is the only way...
« Reply #2 on: November 30, 2011, 03:44:50 pm »
You're missing a few important steps, though. You need to understand how the NES plays sound, how the sound engine for the game in question works, and where exactly it stores its music data in the ROM.

Understanding hexadecimal is about the most basic skill a romhacker needs to know, but you can't just crack open a game in a hex editor and start making changes without understanding all the other aspects of the process. On the upside, if you have any programming skill at all, you might - once you understand all the details - be able to develop your own dedicated music editor.
In the event of a firestorm, the salad bar will remain open.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 433
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #3 on: November 30, 2011, 04:25:05 pm »
You're missing a few important steps, though. You need to understand how the NES plays sound, how the sound engine for the game in question works, and where exactly it stores its music data in the ROM.

I was trying to get at least him pointed in the right direction start.  No sense learning how a game console uses its sound chip if he doesn't even know how to use a hex editor right?    ;D  Baby steps my friend.   8)

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Please don't tell me Hex Editing is the only way...
« Reply #4 on: November 30, 2011, 05:48:17 pm »
I was addressing the TC. ;)
In the event of a firestorm, the salad bar will remain open.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 433
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #5 on: December 01, 2011, 08:23:17 am »
I was addressing the TC. ;)

Ah, gotcha.   :beer:

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #6 on: December 01, 2011, 03:14:14 pm »
I know I probably sound like an idiot when saying this, but ALBERT EINSTEIN couldn't figure out Hex Editing! I'm not trying to sound like I'm giving up, but damn, how am I supposed to know where the music hexes lie and how to change the music via Hex Editor. Isn't there a program that lets you select sound-bits and allows you to change music as you would in a Midi-Maker?

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Please don't tell me Hex Editing is the only way...
« Reply #7 on: December 01, 2011, 04:26:49 pm »
Like I said: you're missing a few steps.

Use a debugging emulator like FCEUXD to figure out where the music data comes from. Odds are the NES communicates with the sound hardware through registers: find out what those registers are, set a write breakpoint to that memory location, and catch the game in the act. Then trace the code until you find out where in the ROM the bytes being stored to that register are loaded from.
In the event of a firestorm, the salad bar will remain open.

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 580
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: Please don't tell me Hex Editing is the only way...
« Reply #8 on: December 01, 2011, 07:49:18 pm »
What you are trying to do would be like trying to edit a book by randomly changing letters around. You need to understand each letter, the words they make up, how they're put together into sentences, and how the sentences go together to express something meaningful.

Hacking is no different. You need to understand the number system (hex), the data structures, the program that uses the data (assembly), and how it fits together to make something meaningful (in your case, music). Just like learning to read takes a lot of time and effort, you need to dedicate yourself and spend a lot of time if you want to learn to hack. I think you're setting your sights a bit high. A lot of people tend to dive right in. Until you realize you're in over your head you'll keep floundering. If you're interested in hacking, try something simpler first.

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #9 on: December 02, 2011, 02:38:09 pm »
I don't have a debugging emulator. And even then, reading your guy's text is still like studying rocket science to me. I'm not sure I get it.

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Please don't tell me Hex Editing is the only way...
« Reply #10 on: December 02, 2011, 04:57:00 pm »
I don't have a debugging emulator. And even then, reading your guy's text is still like studying rocket science to me. I'm not sure I get it.

Then freaking download one. Geez. I already told you to get FCEUXD; what's hard to understand about that?

Snarfblam pretty much nailed it: you don't have the basic comprehension necessary to pull off the kind of hack you're talking about. Start with something simple: a text hack, a graphics hack, whatever suits you. Once you understand what I mean when I say "identify the sound registers and set a write breakpoint for them," come back to this and try again.
In the event of a firestorm, the salad bar will remain open.

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #11 on: December 02, 2011, 05:12:17 pm »
Well, I guess I am starting to have the urge to edit Megaman X graphics.

You would be surprised how many people I've met who think Megaman X is a promotion for animal cruelty. ANY AT ALL! But seriously, I personally just prefer animal VS animal as opposed to human VS animal or animal VS human, which is why I was hoping to make a hack of Megaman X that does nothing but replace X's sprites. ...Now I've seen plenty of sprite hacks before. I can think of THREE different Megaman 3 hacks that change the sprites: Kelvin the Lion (Decent Sprite Edits), Riddlers Escape from Arkahm (Mediocre Sprite Edits), and Mega Dan 3 (Really AWFUL Sprite Edits). I've also seen sprite edits of Megaman games that use sprites from other games, such as a Megaman 2 with X sprites from Megaman Xtreme. ...But I'm not sure if these kind of hacks also require hex editors. They might not, but... I've also noticed hacks that change background and effects as well. For some reason, these kind of edits seem too complicated for a Hex Editor. I've been able to switch parts from sprites with parts from other sprites, but I haven't been able to actually alter sprites and background without ending up using other bits and pieces from sprites and tiles.

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #12 on: December 02, 2011, 09:55:54 pm »
What you (as not japanese reading guy) are trying to do is to read a japanese book in your pc that have mixed pages (without page numbers), without index and your pc can't show you japanese characters.

Just a mission impossible!!!!


Let me get concrete:
As you maybe know, a pc (or game console) can actually understand only 0 or 1.
A rom that you download from the internet is just a sequence of many 0 and 1 (some hex editors can show you the file in this form as well).
To not have long sequences of 0 and 1, this 0 and 1 are "groupped" in a special way that give you hexadecimal (you can find on the net how this "groupping" works).
So now you have a nice screen of hex numbers on screen and you and the pc (or game console basically don't know what to do with them).
Let's take a melon, a piece of paper and a knife as example. Make a cut in the melon so that you can insert the piece of paper and then push the knife completely inside the melon. You will now have a melon with a piece of paper and a knife inside and it's actually not clear where is what....this is you and your screen full of hex numbers.
What will happen if you give this melon (with the knife and the piece of paper inside) to somebody that never saw a knife and a melon???
Probably not much; he will need instructions in what to do the problem is that you and that person don't speak the same language but fortunatelly, in the piece of paper inside the melon, there are the instructions in how to use the knife, how to cut the melon and that the melon can be eaten.
The only thing you can do now is to point the guy to the piece of paper in the melon hoping that he will take it out of the melon and read it. The same is happens in the pc (game console)...they try to communicate till the pc finds the piece of paper (the program part) that it can understand.
Now, the guy reads in the paper that there is a knife inside the melon so he has to search for it and extract it.
Exactly the same, the program tell to the pc to go search somewhere inside that screen of hex numbers for something to use.
Now your guy is armed to eat the melon but he still need to cut a piece out of it so he continue read the paper that tell him that the melon need to be cut before he can eat it. The program to exactly the same with those hex numbers, it cut it into pieces and "eat" them, the only difference if that your guy has only 1 mouth but a pc  has many mouth (the main processor, the sound processor, the graphic processor).
Now you probably start to understand that the same hex number on top of the rom, in the middle or at the bottom are in your eye all the same but not for your pc, it can be a piece of the melon, a piece of the knife or a piece of the paper.
The only way to find out what each of those numbers is, is a long work of trace and mapping the rom.
A good map for example is the one you will find here.

This is the top of the iceberg, even if you got a map like that before, you still need to find out how each part is stored so that it can be worked on by the program and "tasty" for the mouth that will eat it (the correct format for the hardware).

Now, you figured all of the above out and are ready to insert a new song but moment...your song is 10 second longer than the one that was inside that part before...what you do now?? Just cut it?? If you not do that, you will probably overwrite the next part in the rom (can be everything) and probably make the rom unusable (if you are lucky, you will only have the last 10 seconds of this song at the beginning of the next song).
What you really need to do is goto the program (piece of paper) and move everything after that song you want to insert, 10 seconds later but ...wait how many KB are 10 seconds of music?? You will need to know your audio format well to answer that...and did I forget something?? You and the pc don't talk the same language so how to modify the program???
By the way, the same apply to the graphics.

Still with me?? So what we conclude now??
Hexadecimal knowledge is required in any case but you will do absolutly nothing only with that.
You will need to learn ASM as well (to change the program), all graphics, audio formats in the game you are hacking, probably C#/C++ or any pc programming language so that you can convert the between formats, to manage all changes of offsets, to see what you are actually doing and finally alot of patience and time!!

I suggest you to read this and maybe you will understand what awsome piece of hacking you have in your hands with those hacks.





Jazz

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #13 on: December 03, 2011, 01:07:52 am »
More like he is trying to do something intermediate before he even knows the basics to beginners. Don't try to fly before you can crawl mate.

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #14 on: December 03, 2011, 10:46:21 am »
What do you guys suggest I try to do first?

Jazz

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #15 on: December 03, 2011, 07:16:25 pm »
Um, i really think you start with reading what Snarfblam said and start by playing with graphics and text to get an understanding of how hex works. Also, hex is very simple stuff.

Windows has a hex calculator option. Hex starts at $00 (the '$' sign represents the fact it's a hex value and not an address within the ROM). it then counts to $09 before it switches to letters.
eg. $00 $01 $02 $03 ..... $09 $0A $0B $0C $0D $0E $0F (then it goes) $10 $11 $12 $13.... $19 $1A so on. Until you reach $FF. Their are a total of 256. The best way to learn counting in Hex is to make a table file or read one someone has made.

I suggest grabbing a table file and a game that is in english. Then learn how to search. Once you reach this stage. Come back here for a second lesson.

Otherwise, read this http://www.romhacking.net/start/

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #16 on: December 20, 2011, 09:03:22 pm »
Okay, I'm starting to understand a bit of the know-how.

Alright, I'm working on sprites for a Megaman X hack I wish to make. Anyone know a good utility for extracting sprites so I can read them and get a better understanding of Hex Editing?

reyvgm

  • Hero Member
  • *****
  • Posts: 524
    • View Profile

Plint Michigan

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #18 on: December 21, 2011, 09:39:01 am »
Say, is it alright if I show some of my edits for the hack here? I'm... still a novice spriter and not very confident in my spriting skills, but I'm looking to improve.

Edit: Okay, so I have a good idea what Hex code is. 2F = 47.

0=0
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
A=10
B=11
C=12
D=13
E=14
F=15
10=16
11=17

And so on. ...But I'm still not sure what good it does me.
« Last Edit: December 21, 2011, 02:51:48 pm by Plint Michigan »

reyvgm

  • Hero Member
  • *****
  • Posts: 524
    • View Profile
Re: Please don't tell me Hex Editing is the only way...
« Reply #19 on: December 22, 2011, 12:47:29 pm »
Laughing out loud. You don't need to know hex to extract sprites. Just open an emulator, disable the backgrounds and take a screenshot of the sprite. That's it.

If you want ALL the sprites in a game, you need a video ram viewer like vsnes or bsnes, but bear in mind that sprites in videoram are not shown like you see them in the games, they are usually segmented to save space.

Now, to hack it in, you do need to learn how to hack and that involves a LOT more than learning hex or using a hex editor. Trust me, if after a month all you've learned is to count in hex, then you are not doing it fast enough.

Best of luck anyway.