Romhacking => Newcomer's Board => Topic started by: ThegreatBen on May 19, 2020, 08:36:26 pm

Title: Comparing roms
Post by: ThegreatBen on May 19, 2020, 08:36:26 pm
What's the easiest way to compare a patched ROM to an unpatched one to see only the bytes that have been changed?
Title: Re: Comparing roms
Post by: eskayelle on May 19, 2020, 08:50:11 pm
If the patch is small enough, and an IPS file, I sometimes open it in a hex editor and analyze.  Otherwise, I make a .bat file using Notepad and use these commands:

Code: [Select]

Replace the names in quotes with your files, and the compare.txt file is your result.
Title: Re: Comparing roms
Post by: FAST6191 on May 19, 2020, 10:08:38 pm
Depends what system. For something with a filesystem (basically anything on Windows, arguably some arcade stuff, anything on a floppy disc, the DS on upwards and anything that came on optical media) then if everything gets rebuilt, or possibly even encrypted again (the wii is the most notable for a lot of this but is hardly the only one).
Even on the older systems you do also have the different formats, headers and whatever else to account for, though for a simple patched vs unpatched it is not so bad.

Personally I like the compare feature hex workshop has, and it can also attempt to compare things and has a more advanced more where it will try to see if it picks up the trail again after an insertion or deletion.

Bonus tip in case of iso based stuff.
Unpack the original and patched versions, and then hash all the files within them and compare hashes. Anything that is different will show up there and you can go with simpler tools.
Bonus 2.
In the case of the DS, and various other programs for other systems, you have a tool called crystaltile2. Its hex window will happily tell you what file that given selection/cursor placement belongs to.
Title: Re: Comparing roms
Post by: sics on May 19, 2020, 10:29:39 pm
I recommend you try the Fairdell HexCmp2, and to complete it HxD Hex Editor :thumbsup:

(This capture was made for other purposes)

Title: Re: Comparing roms
Post by: ThegreatBen on May 20, 2020, 07:03:15 am
Thanks this should do the trick