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

Author Topic: Is Searching Through a ROM This Hard?  (Read 818 times)

Bob789

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Is Searching Through a ROM This Hard?
« on: September 19, 2017, 04:56:14 pm »
Hello all,

I've been searching through a ROM to try and find specific bytes but I was wondering, when searching through a ROM, do you really have to change every couple bytes and see what they did? Because that would be a huge pain in the butt.

Thanks,
Bob789

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Is Searching Through a ROM This Hard?
« Reply #1 on: September 19, 2017, 05:08:06 pm »
I don't really follow you. Emulators have debugging tools that mean you don't have to go through a ROM changing bytes randomly forever. Maybe people had to do that in the old days, but not any more.

Then again, I don't know what system you're working on. :) If it's the NES, for example, FCEUX has a wonderful set of tools. Once you learn a thing or two about assembly and using the debugger, it will tell you the bytes you need very easily. But as I said, you should give more information before you can get help. ;)

Zynk

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 803
  • WIP Roll-chan: The Wily Wars
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #2 on: September 19, 2017, 07:58:58 pm »
You can try this tool - https://www.romhacking.net/utilities/2/

You can corrupt a specific line then press restore the ROM with less hassle.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #3 on: September 19, 2017, 11:38:30 pm »
I have never used random ROM corruption and I cannot imagine it being a very productive means to find stuff versus trying to track it down the "smarter" way.

But maybe in the days before good debuggers, it was a means of tracking data (such as level data). Obviously just to get a foothold in the game.
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

nesrocks

  • Sr. Member
  • ****
  • Posts: 423
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #4 on: September 20, 2017, 09:18:43 am »
The only hack I've done for atari 2600 was a test by blind hex editing. The rom is so small, I opened it on a HEX editor, looked for a $A9 byte and edited the following byte. Result, the igloo in frostbite was now brown. I don't think it is too impossible to imagine an atari rom being disassembled with this method, but there are much better ways using proper debuggers indeed.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #5 on: September 20, 2017, 02:19:18 pm »
I'd image 2600 games being easier to disassemble, being typically like 4KB, right?

But it sounds like ASM hacking on it would be harder as timing was a far bigger deal from what I've read.
Whereas with NES, code timing isn't usually a big deal unless you're dealing with like NMI/IRQ stuff.
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

BlackDog61

  • Hero Member
  • *****
  • Posts: 775
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Is Searching Through a ROM This Hard?
« Reply #6 on: September 20, 2017, 07:05:32 pm »
There are different methods and tools for different purposes. I'm sure if you tell more about what you are trying to achieve on which console, then people here can help, advice and sympathize better.
Have you checked Fast's guide for romhacking?

Bob789

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #7 on: September 20, 2017, 07:48:30 pm »
Sorry for the ambiguity, I wrote the original post quickly.

To clarify, I am using FCEUX and I am trying to look through the original Legend of Zelda.
I have no experience with Assembly, but I plan on changing that.

EDIT: I am not trying to change anything specifically, just trying to see what does what to see what I have available to do.

Hope that clarified!
« Last Edit: September 21, 2017, 12:59:48 pm by Bob789 »

NERV Agent

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #8 on: September 20, 2017, 08:31:24 pm »
What exactly are you trying to change? It would help out everyone else here if they knew what you need help with.

Anyway, maybe this will give you some clues?

http://www.romhacking.net/documents/87/

http://www.romhacking.net/documents/90/

http://www.romhacking.net/documents/91/

http://www.romhacking.net/documents/385/

https://github.com/camthesaxman/zeldasource

The Legend of Zelda is obviously a popular game, so it is very possible that someone has figured out the source code. I mean, that's what happened with Metroid.
« Last Edit: September 20, 2017, 08:40:06 pm by NERV Agent »

BlackDog61

  • Hero Member
  • *****
  • Posts: 775
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Is Searching Through a ROM This Hard?
« Reply #9 on: October 20, 2017, 05:45:01 pm »
I guess we can say that it's, in general, indeed a very long process if you're trying to find what every single little byte does in a ROM (even with some other methods / tools).
The NES has some of the better emulators for that, still, since a lot of memory is explained by graphics / whatever-since-I-don't-focus-on-NES.  ::)
But yeah - you could spend a decade figuring out everything in, say, a PSP game.

ShadyRounds

  • Jr. Member
  • **
  • Posts: 12
  • Apathetic, yet Helpful.
    • View Profile
Re: Is Searching Through a ROM This Hard?
« Reply #10 on: October 26, 2017, 01:50:11 am »
As what I would consider to be a successful newbie, "changing values randomly" only works with "controlled randomness".

I could not make much progress in Megaman Legends romhacking, if I searched single bytes. 56k matches.

However, it is successful when deployed in the following scenarios:

1) Using a real debugger, to trace a function to a location in ram, and copying the entire 16 byte line it sits on to search the rom for. I find plenty of values, even values referenced in 2 separate locations within the same rom, by searching longer strings in what appears to be a part of ram loaded from game start or that's always actively loaded.

2) Finding a location in ram/rom, and then searching for similar value bytes in the nearby neighborhood. For instance, I can change what item is given AND which is equipped, by searching a location I found, and checking for any similar values located fairly close in proximity. However, recently, I found 7 references of a equipment byte, and changing all of them severely broke the character and crashed the game, but changing JUST THE 1 THAT WAS POINTED TO, worked fine. So sometimes precision is better than carpetbomb-swapping.

As far as platform-specific tips, I only know what I've read and have no hands-on experience. However, I started from knowing literally nothing about assembly, to knowing still almost nothing about assembly, and I can literally build an item randomizer now, so there's always hope. Just focus on finding debug-tracing and the tools/emulator to use for the task, and study all the documentation you can about the tools and/or the various games people have used the tools on. When you need assembly, you'll need a lot less of it than you probably think.
« Last Edit: October 26, 2017, 01:56:24 am by ShadyRounds »
Apathetic, yet Helpful. :beer:
Project: Megaman Legends: Second Quest