It is currently Sat Sep 21, 2019 9:24 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: NES hacking
PostPosted: Sun Mar 10, 2019 9:10 pm 
Offline

Joined: Sun Mar 10, 2019 9:05 pm
Posts: 5
Hello guys!
I'm new here but I was watching this site for a long time (6-7 years :D).
I have a question for you from a total noob, I have some nes hacks pretty awesome and I'l like to ask you how they were made.

https://www.youtube.com/watch?v=R8VpR1sgYqY

Look at this hack DB 3 Rosetta Stone... how is that even made? How can you hack a game and use its bosses? What you need to know? You need to use debugger, assembly or what? I'm total lost with debugger. Any answear will be appreciated.
Thanks a lot and sorry for this english xD (not native speaker).


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Sun Mar 10, 2019 10:23 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4208
Location: A world gone mad
What is your native tongue?


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Sun Mar 10, 2019 11:39 pm 
Offline

Joined: Sun Mar 10, 2019 9:05 pm
Posts: 5
Romanian.


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Mon Mar 11, 2019 10:04 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2564
Location: DIGDUG
Quote:
how is that even made?


Lots of hard work.

You would need to identify the code and graphics for each boss, and redirect the hero's code to use that instead of his own.

Probably, you would disassemble the ROM, and run the game in a debugger with CDL (code/data logger) running, and mark each bit of code that each boss used, and which code the hero uses, etc. Rewrite and reassemble.

It could take a year, or more.

This would not be a first project. It would help if you studied 6502 opcodes, NES architecture, game cartridge mappers, and reverse engineering techniques.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Wed Mar 27, 2019 4:59 am 
Offline

Joined: Sun Mar 10, 2019 9:05 pm
Posts: 5
Sounds like you need a lot of work...
But, my last question is:
When you use a debugger, lets's say Mesen's debugger, how can you find a specific value for speed or for special attack, for changing how powerfull your character to be and stuff like that.
You guys have any idea?
Best wishes,
fourtwenty.


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Wed Mar 27, 2019 2:19 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2564
Location: DIGDUG
This is a long discussion.

First, it would help if you knew what you were looking at (in a disassembly window). So, study all the opcodes of the processor. Study all the hardware registers.

Then you want to isolate the exact moment that an event happens, with save states. If you save the game at 1 or 2 frames before "a speed value changes", you can then do a trace on those 2 frames, and see all the code that occurs, then you read every line, and write down every RAM address that it could be, and then test every one, one by one.

Or you could try the corruption method. And just poke at every RAM address, one by one, and take notes about what happens. Eventually you will get lucky and find it. Really, you only have about 1500 (0x600) addresses to test.

It's boring and slow, but it works.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Wed Mar 27, 2019 8:44 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 418
Location: Rio de Janeiro - Brazil
My two prefered methods for the first steps of reverse engineering a rom's code are:

1 - use cheat search to find relevant ram addresses and locate in rom where they are manipulated.
2 - "comment" (replace with EA EA EA) jsr's in certain loops marked by code data logger, for example, in a main menu, and detect what behavior changed. This usually does not break the game and is great for doing broad RE.

After that it is more tedious, but I find fceux's debugger great for mapping everything, labeling rom and ram addresses and adding bookmarks.

_________________
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Thu Mar 28, 2019 3:13 am 
Offline

Joined: Sun Mar 10, 2019 9:05 pm
Posts: 5
Sound easy :D
But, sounds easier if you could make a tutorial... let's say super mario bros, make it to jump higher, do a tutorial with trace logger, debugger and stuff... only to have a little clue from where I can start.
Best wishes,
fourtwenty.


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Thu Mar 28, 2019 4:05 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4208
Location: A world gone mad
Attachment:
VennDiagram.png
VennDiagram.png [ 26.09 KiB | Viewed 5175 times ]


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Thu Mar 28, 2019 5:23 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2564
Location: DIGDUG
I don't have time. Maybe some future day.

I was exaggerating a bit on the 1500.

If I can get a save state exactly before an event happens, I can look at the RAM, and reload the save state over and over, and I can usually narrow it down to about 50 just by watching how values change.

That still takes an hour.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Fri Mar 29, 2019 4:11 am 
Offline

Joined: Sun Mar 10, 2019 9:05 pm
Posts: 5
koitsu wrote:
Attachment:
VennDiagram.png

Nice one, but in theory, I know how an airplane is made but i can't make one.
If someone can make a good tutorial about how can you get specific values in debugger would be great.
I mean how can I find values of Mario jump, to change how high you can make him jump.
Sorry if i'm too noob for skilled hackers/programmers like you (i'm a total noob at this, I can't understand this debugger things, but I was amazed about these games since I was child).
Best of luck,
fourtwenty.


Top
 Profile  
 
 Post subject: Re: NES hacking
PostPosted: Fri Mar 29, 2019 6:38 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1289
I wrote this: viewtopic.php?p=138364#p138364

It's debugger agnostic, because different emulators have different debuggers and controls. FCEUX's tools, RAM Search allows one to narrow down values as described in that post.

Debug, Debugger opens a way to find the code that changes these variables. Add, under breakpoints in the top right lets you set the conditions. If the above information doesn't get you there, I mean... Understand that there's not much incentive to write about how to specifically change Mario's jump height, because it ends up glossing over lots of the prerequisite knowledge.

I don't consider hacking to be a good first step to programming, because hacking often relies on intuition that only comes with rather extreme programming experience. Modifying open source things is a slightly better start, because then at least you can get some of the intention of what's there. (Variable names, comments.)

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group