Jump to content

Hex editing the arm9 file


Recommended Posts

I've been PMing Poryhack about this topic, since he was the one who posted about it over at TPC. However, since I've been having trouble understanding what exactly it is that I need to do, I thought I'd ask publicly over here:

Alpha tells me that the copy of the arm9 that PPRE creates in the tmp folder is compressed, and Poryhack has told me that the file must be decompressed for it to be edited properly... however, I've tried a lot of different file compression programs (Winrar, Winzip, ALZip, and a few others), and none of them are able to interpret/process the file at all, let alone decompress it.

Do I need to rename arm9.bin to another filetype?

Do I need to use a specific decompression program?

Have I misunderstood an unspoken middle step, here?

My understanding is that most of the time, when people talk about compressing or decompressing .bin files, they're talking about things like data CD rips and things of that nature. I'm not sure exactly how a DS card works, but I'm assuming it doesn't necessarily have the same digital image kind of setup as a CD, right?

My goal is just to replace three 32bit numbers so that I can replace the starters in HG (J). I've messed around enough with Hex Workshop to know how it works and what I can do to search for the correct offset/value. I just need to know from someone with more experience what it means to "decompress the arm9 file," since nothing I do seems to work properly.

Thanks.

Link to comment
Share on other sites

A friend of mine found an excerpt that he thought would solve my problems.

Is this the direction I need to go in?

Let's say you're using it and you know that the first block of text in the game is located in the ROM at 12345 (hexidecimal). Well, that's not where it's going to be loaded in memory, because the 6502 can only address 64 KB of memory and 12345 goes past the 64 KB barrier, which is at FFFF. Instead, it is likely that a bank will be switched in somewhere around 8000 through DFFF. However, your script block will still be located at some x345 in memory. So, you set breakpoints for reads from 8345, 9345, A345, B345, C345, and D345. Then let's say emulation stops at a line like this:

$EDB5:B1 20 LDA ($20),Y @ $8B00 = #$80

That bit with the "@ $8B00" means that ($20),Y points to that address. So write down this line and look at $8B00 in memory and see if the bytes match what's in your script. If so, you've found the bit of code you need.

Retrieved from "http://romhack.wikia.com/wiki/Assembly_hacking"

Link to comment
Share on other sites

Alright, I've been tooling around for a while and I feel like I'm still missing a step, here.

For both the Japanese & USA versions of HG, I have extracted the arm9 file and tried to find the offset/value that poryhack specified: 0x107A60, 98000000009B000000009E00000000. Neither exist. The offset doesn't exist because there aren't near enough lines to constitute such an offset, and the hex values simply aren't there like I've been told. The arm9 file I extracted caps out @ B9CA9. I've tried searching the entire rom for the specified hex values, but the search function always finds nothing. Going to the offset specified when I open the entire rom also doesn't work.

I must still be doing something wrong! If what I'm doing (changing the starter pokemon) is as simple as changing 6 little values to 85, then why is it impossible to find where these values are located in the rom? You guys make it sound like this is a pretty obvious thing, but I've been trying to make this work, with what little free time I have, for quite a few days now. It's not that I'm not trying, it's just that everything you tell me to do doesn't work. So, once again, I know there's got to be more information needed on my part.

I'm not an idiot, I simply have no experience with this sort of thing, so I would appreciate any help on the matter you guys can offer.

Link to comment
Share on other sites

  • 10 years later...
  • 2 weeks later...
On 8/27/2020 at 4:23 PM, FryingPan_II said:

I just wanted to hop on this thread because I was also having a problem with CrystalTile2, it says "Out Of Memory" whenever I try to extract the Arm9 file, what do i do?

 

im getting this error as well. there seems to be no other mention of it anywhere apart from here.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...