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

Author Topic: YouTube ROM hacking guide (idea)  (Read 612 times)

Psyklax

  • Full Member
  • ***
  • Posts: 154
    • View Profile
    • Psyklax Translations
YouTube ROM hacking guide (idea)
« on: June 19, 2017, 11:38:41 am »
Guys, for a long time I've wanted to make a YouTube series explaining, in mind-numbing detail, how to hack ROMs. I'm a teacher so explaining things like this comes quite naturally, and the main reason is the tutorial situation as it is right now. I see guys popping up periodically saying "can you hack my game?" or "what do these hex values do?" and so on, and I feel like people need to learn some fundamentals. Don't get me wrong: everything I learnt about hacking I learnt from the guides on this site, and to a lesser extent other sites, but it's not very intuitive in general.

My intention is to start with the most basic of basics, for people who barely know what a computer is ("I press the icon on the screen and a game appears"). I can't claim to be a l33t h4x0r, but I do know more than the average guy who stumbles onto RHDN and can barely make a table file. So I'd like to help people understand how it all works, from scratch. The easier it is for people to learn how to hack, the more people will get into it and contribute something meaningful (and stop bothering you guys with n00b queries :D ).

Just to make clear, this is just in the planning stage at the moment, and I know it's probably far too early to make a thread on the topic as a result. But I wanted to put it out there in case anyone has some input on this, and any ideas about how I should go about this. I think YouTube is a good way of doing this, rather than written docs. Sometimes poring over docs can be more useful, but in many cases it's more helpful to just spell it out in a video.

Thoughts? I've got plenty of ideas about topics to cover but suggestions are welcome. ;)

Corvo

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #1 on: June 19, 2017, 12:14:51 pm »
Just keep in mind the "please translate this game" comments that will surely flood your inbox.

Suggestions? Get the very basic out of the way first. Something like a comparison.
What you think ROMhacking is: <video of someone pushing BACKSPACE to delete characters onscreen while the game is running, and inserting his own words>
What ROMhacking really is: <video of a messy screen with an hex editor, a tile editor and a debugger - you insert a letter and the game crashes>
« Last Edit: June 19, 2017, 12:27:35 pm by Corvo »

FAST6191

  • Hero Member
  • *****
  • Posts: 2114
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #2 on: June 19, 2017, 12:50:04 pm »
" in mind-numbing detail, how to hack ROMs"
That was never really a problem; the issue always seemed to be how to convey such things in a compelling way. Also occasionally having to slow down to explain things (or what one saw), or having to be more organised in approaches (as far as forum posts go I can have 50 completely dead ends in my approaches*, skip between 10 different methods as my whims dictate and then finally arrive at something completely out of left field -- the end results mean all).

*actually for a guide once I spent a couple of hours chasing down a table file via a name entry screen. Turns out for that game it would not have worked and it used a different encoding to the game proper, and missing several other things the game did. I was able to salvage something from it and use it as a more abstract version of that method. I am one of the more given to watching long form videos you meet but you waste two hours covering something you can't use and not so many will come back for part 2, I would certainly hesitate.

Thread from last year that we went there
http://www.romhacking.net/forum/index.php?topic=21383.0

"but it's not very intuitive in general"
Is it a process that is given to being intuitively solved or understood? It is not a hobby with a high barrier to entry because we are all elitist pricks but because the halting problem combined with coders being given free reign to do almost whatever they like in their code makes the amount of you have to know and comprehend to reliably be able to walk up to a game and figure out how it works is rather high and not commonly taught anywhere.
I would like to see some video guides to things, it would certainly help with a few concepts to see it in real time rather than described on a page and static pictures, however I am still not sure how to set about doing it.

Psyklax

  • Full Member
  • ***
  • Posts: 154
    • View Profile
    • Psyklax Translations
Re: YouTube ROM hacking guide (idea)
« Reply #3 on: June 19, 2017, 01:13:17 pm »
I would like to see some video guides to things, it would certainly help with a few concepts to see it in real time rather than described on a page and static pictures, however I am still not sure how to set about doing it.

My idea is to cover every topic in the most general way possible, so that whatever system or game you're going for, you can get into it somehow. I feel like I've been hacking for years and only NOW do I really understand some of the fundamental things that would have made life a lot easier had I known them in the beginning. Up until a couple of months ago, ASM was impenetrable. Now I can hack things I never had a clue about, and I feel like if I gave people an easy to understand (and enjoyable to watch) video, they might do it themselves. Well, I'll try anyway. :)

Just keep in mind the "please translate this game" comments that will surely flood your inbox.

I think I can deal with that. :D I'm more of a hacker than a translator: I translate games myself mainly because going up to someone and saying "translate my game" seems awfully needy. :laugh:

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #4 on: June 19, 2017, 02:48:07 pm »
I love the sound of it Psyklax. You write well and your information is always on point and if you're a teacher you have  training in this sort of field. I would love to see how you would approach the extraordinarily varied world of video game hacking.

filler

  • Hero Member
  • *****
  • Posts: 553
  • "WINNERS DON'T SELL REPROS"
    • View Profile
    • Filler's Translation Projects
Re: YouTube ROM hacking guide (idea)
« Reply #5 on: June 19, 2017, 06:31:05 pm »
I think this is a good idea.

SleepyFist

  • Hero Member
  • *****
  • Posts: 639
    • View Profile
    • Project List - Updated Sometimes
Re: YouTube ROM hacking guide (idea)
« Reply #6 on: June 19, 2017, 09:11:36 pm »
Sounds good, I'll be watching. :thumbsup:
Sleepy's tune of the week: E-Minor - Super Paper Mario: The Ultimate Show(Dimentio Remix Medley) - https://www.youtube.com/watch?v=TqySf_Zybs8

STARWIN

  • Sr. Member
  • ****
  • Posts: 433
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #7 on: June 19, 2017, 09:32:19 pm »
I think well written text is a better format than any video, because videos have forced pacing.

Chronosplit

  • Hero Member
  • *****
  • Posts: 894
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #8 on: June 19, 2017, 09:56:55 pm »
Do it do it do it!  I'll give it a watch.

I think well written text is a better format than any video, because videos have forced pacing.
That's a good point, but some learn more effectively through audio/visual as opposed to text.

RainbowDash321

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #9 on: June 19, 2017, 11:00:18 pm »
 That's a good idea. :)
My goal is to find most of utilities everywhere and upload to RHDN data base.

KaioShin

  • Hero Member
  • *****
  • Posts: 5727
    • View Profile
    • The Romhacking Aerie
Re: YouTube ROM hacking guide (idea)
« Reply #10 on: June 20, 2017, 02:03:22 pm »
My only suggestion when doing this via the Youtube route is to always have finely grained timecodes in the description. I personally find video tutorials and reviews completely unusable otherwise. I don't sit at a video once from start to finish. Usually I have a clear idea of what I want to know. Let's say for example in a review for a graphics card I want to know how loud the fans are. In a text review I can just gloss over the page and very fast zoom in on the area where the topic is discussed. In a video, I can only blindly jump around in the video, listening for 10 seconds each jump trying to figure out what the current topic is. It's unusable to me. If you have well organized timecodes it alleviates that a lot.

My idea is to cover every topic in the most general way possible, so that whatever system or game you're going for, you can get into it somehow.

That is the only sensible way of teaching things right. As a teacher I'm sure I don't need to tell you this. I thought about doing a similiar thing once but in book form, but it never came to be because of free time constraints. A lot of people want step by step guides that tell them exactly where to click at what time, but that won't work on any other game than the example one and people who learn that way usually don't make the mental transfer of applying what they are doing to other things. One has to teach the basics so people actually understand what they are doing instead of following a memorized list of instructions.
All my posts are merely personal opinions and not statements of fact, even if they are not explicitly prefixed by "In my opinion", "IMO", "I believe", or similar modifiers. By reading this disclaimer you agree to reply in spirit of these conditions.

goldenband

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #11 on: June 20, 2017, 02:51:42 pm »
I think the biggest thing is to have a sense of exactly how you "crack" a particular issue. A lot of us understand the principles behind things like (for example) pointers, but simply don't know where or how to start tinkering with them. It's not necessary to write a step-by-step guide, but a step-by-step model is extremely helpful.

flame

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #12 on: June 20, 2017, 07:45:01 pm »
I would like to see one on reverse engineering script formats because I have no idea how to do it, despite having succeeded several times.

Method 1:
1) Someone else figured out from a different version or port of the game so I just stole their work

Method 2:
1) Look for patterns
2) Maybe it's this!
3) Try it
4) If it works, done, if not, back to step 1

I saw an article one place about how a script format was figured out but I haven't seen any others:
http://gbatemp.net/threads/romhacking-in-tales-of-destiny-2.373960/

elmer

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #13 on: June 20, 2017, 10:38:58 pm »
I would like to see one on reverse engineering script formats because I have no idea how to do it, despite having succeeded several times.

Seriously???  :'(

What about "Method 3:", disassemble the script interpreter and figure out what it is doing.

If you actually have the skill to do it, then the end-result is 100% accuracy ... and no bugs when changing stuff.

Is that beyond people these days? Are we truly in the era of cargo-cult ROM-hacking?

FAST6191

  • Hero Member
  • *****
  • Posts: 2114
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #14 on: June 21, 2017, 08:39:15 am »
Is that beyond people these days? Are we truly in the era of cargo-cult ROM-hacking?

Yes but surely the trick is to make those people useful anyway.

Do you think every 3d printer sold is sold to an engineer, or someone with some kind of in depth appreciation of the matter? You make tools so people can do something anyway. Previously I have phrased it along the lines of grunt work -- if someone wants to brute force a font encoding so I can come along and skip that in favour of making a VFW then carry on. Or maybe in the case of games with scripting involved then how many hackers would instead subvert the scripting engine to run their own asm routine when the base engine itself was capable of it? My goal in ROM hacking is to be able to walk up to any game, theoretically on any system but more practically on those I already know, and be able to make decent headway in figuring out any aspect of the game. At the same time I do have to recognise what I learned after about a year of learning in earnest would have able to do serious damage to a lot of games and that is enough for some people.

Also on timecodes I quite liked the effect it gave
http://www.gdcvault.com/play/1023470/-It-s-Just-Emulation
vs the straight youtube video
https://www.youtube.com/watch?v=HLWY7fCXUwE
Video however has so many problems and I have not yet seen them solved for ROM hacking type activities -- I can watch multi hour long videos on machining but depending upon how you want to view things it is 10% setup, 90% doing where hacking is inverse of that (think finding a table vs loading it into a .tbl and then into a viewer).

darkmoon2321

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: YouTube ROM hacking guide (idea)
« Reply #15 on: June 21, 2017, 10:28:25 am »
I would like to see one on reverse engineering script formats because I have no idea how to do it, despite having succeeded several times.

When deciphering script, actually going in and looking at the disassembly in a log file or a debugger is the best way to go.  However, at times many of the script instructions can end up involving a lot of code, making it impractical for somebody new to assembly to understand.  Also, some systems still lack a decent debugging emulator.  In this instance, a simpler approach often works.  What I would recommend is a variation of the data-corruption technique, where you change a single byte and note the effects in game.  If you are hacking a game for a system that is fortunate enough to have a good debugger and breakpoints, you have some other good options as well.  Almost all scripting uses "indirect" addressing to load the data from the script.  On the NES or SNES, the log file or disassembly for an indirect would look something like:

LDA ($0A),y
or just
LDA ($0A)

In the case of scripting, this indirect LDA command will appear frequently, and each time either y or the $0A will be increased, so the bytes should be read sequentially.  Once you see where the indirect LDA occurs, you can set a breakpoint for the program counter here (or a read on the indirect variable itself, $0A in this case).  Then you can hit "run" repeatedly on your debugger, each time noting the value of the byte that is loaded, and the code will run until the next time a new script instruction is loaded.  For games with large, complicated script instructions, this technique often allows you to visually see the effects of the commands.  Often times though, several instructions will execute before you actually see something happen on screen.  In these cases, the last instruction that executes prior to seeing something is some type of "wait for X" or "delay" instruction.

Also, you might note that if you set a breakpoint for the indirect variable ($0A above) instead of the program counter, you will sometimes see a byte loaded from a different program counter.  Often times a script instruction consists of multiple bytes, where the first is the primary instruction/command, and the other bytes are operands that make the instruction more specific.  It might take some practice, but after looking at some log files for awhile you should be able to note which bytes are the main instructions and which are operands.  What works most of the time to identify instructions is that the value of the byte is used at some point to determine the program counter, typically through an indirect JMP($XXXX) or JSR($XXXX) type opcode.  Some other methods used involve another indirect LDA type command, followed by a push to the stack, and then a return function (RTS,RTL).  There is a different (though rarer and more inefficient) way as well, where the value of the byte read determines the program counter through branch statements.  Ninja Gaiden does this for the scripting involved in its cut-scenes, reading a byte, then checking it repeatedly for specific values before branching to the code for the instruction.

After you've started to understand which bytes are instructions and which are operands, you are well on your way to understanding the script.  For instructions that have operands, often times slightly changing the value of the operand and observing the results is enough to help you determine what the instruction and operand do.  Once you have started to idenfity a few, identifying the rest gets easier.  In cases where you need to understand the instruction itself and changing an operand(if any) has no visible effect, try replacing the instruction with one or more instructions that you have already identified (make sure to match the length of the original instruction), and then observe the results.  There is a lot of trial and error involved, so make sure that you keep good notes throughout the process.  Keeping notes helps you as a hacker, and also allows you to pass your knowledge onto others.

BlackDog61

  • Hero Member
  • *****
  • Posts: 781
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: YouTube ROM hacking guide (idea)
« Reply #16 on: June 21, 2017, 06:34:32 pm »
What about "Method 3:", disassemble the script interpreter and figure out what it is doing.

If you actually have the skill to do it, then the end-result is 100% accuracy ... and no bugs when changing stuff.

Is that beyond people these days? Are we truly in the era of cargo-cult ROM-hacking?
Well... I've provided a pretty good script editor to the SRW AP translator, allowing to change who's speaking, add and delete lines/text boxes, add sound effect plays, and a couple of things. But reversing the whole engine is too much of a beast for me, to be honest. It's a pretty big piece of ASM (well, many big pieces, more accuractely) and you really need to be very familiar with the ASM of the CPU of that console to read it fast enough that you can build a higher-level view of what the heck the code is doing.
It's great if you can, but I think most programmers can't. And I don't think I'm bad with programs, really. It's just a skill to acquire, and it requires time to hone. I've probably spent over 3-4000 hours on this game, but that wasn't enough to be ASM-fluent. (Though arguably most of that time wasn't spent on ASM itself.)
Again, I'm a nobody in ASM. I just want to point out that the people who can reverse a game's scripting engine are an elite. A small, very productive group of people who are very useful to the hobby.

Madsiur

  • Full Member
  • ***
  • Posts: 168
  • FF6 enthusiast!
    • View Profile
    • madsiur's lair
Re: YouTube ROM hacking guide (idea)
« Reply #17 on: July 01, 2017, 09:50:38 am »
My intention is to start with the most basic of basics, for people who barely know what a computer is [...]

I know this is probably not literally what you mean to say but aiming total newbies involve many basic things that can be explained in a 5 min video but require practice in order to go on the next hacking level. I can quickly think of hexadecimal system, that can be summarize (and probably totally explained) in 1 minute but adding $3E to $A1 in your head is another thing. Sure there is the windows calculator for this for beginners. Another thing that can seem stupid but was a thing for a lot day-zero IT student is an offset starting at 0 instead of the "common conception" for non-coders or non-romhackers that you "start at 1" (dunno how else to explain this thing).

You'd have also to break the GUI-only users habits, I know 5 years+ romhackers that are still afraid of command line utilities which can be powerful and sometimes essential for hacking some games. Explaining some basic and intermediate common hex editor features could make enough content for a 10min video.

I could easily see one or more video about graphic hacking (as far as 8-bit and 16-bit system goes without diving into 3D models of specific games of more powerful systems). The use of common GFX utilities could be explained as well as a few GFX formats (without diving into the bit detail of the GFX). Also the "concept" of the relation between a palette and a graphic data as "indexed pictures".

One or more video could also explain text hacking and this is a good opportunity to introduce the concept of Table and pointer. Font editing could also be part of this.

I'd leave assembly for a season 2 and I think it would be the worst candidate to make a popular and effective video tutorial. People need eventually to dive into technical details and read about addressing modes, memory mapping, assembly instructions and such. I would personally find it hard to make this accesible to newbies via a video tutorial or explanation.

All these things except last point can be explained well in a video by using examples in popular games and / or games that have been documented a lot (second thing usually implies first).