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

Author Topic: Not a noob but having hell with Xdelta  (Read 1147 times)

RexDart

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Not a noob but having hell with Xdelta
« on: May 09, 2020, 02:07:26 pm »
So I've been fiddling with roms since the 90s and patching files just about as long. Lately, though, these Xdelta patches have been giving me hell.  I'll confirm that the CRC32 and/or SHA-1 checksum match what I'm supposed to have, but Xdelta always refuses to patch, saying xdelta3: target window checksum mismatch: XD3_INVALID_INPUT. What gives? Is this some 32/64 bit or admin mode tomfoolery?

FAST6191

  • Hero Member
  • *****
  • Posts: 2864
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #1 on: May 10, 2020, 07:20:31 am »
Two usual things to check

1) That you are using the right ROM. Xdelta checks input. A lot of the things people use xdelta on (mainly things IPS struggles with, like the later GBA, DS, PSP and their contemporaries) also have trimmed versions floating around in the wild (indeed they seem to be more resistant to automated searches so might even be more common in some places). In the case of the DS there are also an awful lot of pointless redumps out there that change a byte in the header nobody cares about and will never care about (one of the older dumpers skipped it, with the introduction of the DSi anti flash cart protections then said previously unused area contained a hash no emulator author, ROM botherer, flash cart marker or flash cart user will ever care about but the older dumper continued to be used as it was solid and then came a spate of "redumps", typically from a group called Pussycat).
Trimming you can probably undo easily enough (pad it out with either 00 or FF to make something match the hash, ROMs should be on the standard power of 2 sizes)
Redumps is harder but you can probably force it through in some versions.
Also make sure you have on inadvertently got a v1.1 and it was made for v1.0 or something. Patches were not a thing back on those consoles but even many tiny games got rereleases with a version bump.

2) That you are using the right version of xdelta.
There are two main forks
i) https://www.evanjones.ca/software/xdelta-win32.html is an older version but was used fairly extensively in earlier ROMs as the main project had stalled.
ii) http://xdelta.org/ The main project came back.

RexDart

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #2 on: May 10, 2020, 09:59:06 am »
Two usual things to check
1) That you are using the right ROM.
2) That you are using the right version of xdelta.

1) As I said, the checksums match.
2) I have XDelta 3.0u, 3.1.0, and DeltaPatcher.

Maybe the patch's documentation about which ROM is required is wrong? Is there a way to get XDelta to tell you the checksum that it expects to see for a certain patch, rather than relying on ROMhacking info pages?
« Last Edit: May 10, 2020, 04:13:53 pm by RexDart »

Cyneprepou4uk

  • Sr. Member
  • ****
  • Posts: 455
  • I am the baldest romhacker
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #3 on: May 10, 2020, 10:11:55 am »
There is a theoretical way. You need to create the same patch with xdelta for 2 roms with different checksum, then compare these patches in a hex editor, and the only thing that should differ will be checksum. Then find the same area in your wanted patch
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

RexDart

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #4 on: May 10, 2020, 04:15:02 pm »
There is a theoretical way. You need to create the same patch with xdelta for 2 roms with different checksum, then compare these patches in a hex editor, and the only thing that should differ will be checksum. Then find the same area in your wanted patch

I'm sorry, I've read and re-read this and I don't understand the process here. I need to create a patch? Of what, how?

PhOeNiX

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #5 on: May 10, 2020, 05:49:38 pm »
In DeltaPatcher you can choose to apply the patch by ignoring the checksum check. You can at least see if the patch works, after disabling the check.

Cyneprepou4uk

  • Sr. Member
  • ****
  • Posts: 455
  • I am the baldest romhacker
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #6 on: May 10, 2020, 06:12:28 pm »
I'm sorry, I've read and re-read this and I don't understand the process here. I need to create a patch? Of what, how?

You have 2 different roms, romA and romB. Make copies of them, then change a single byte in these copies, let's say write FF at 0x1234. Then create patches using xdelta. Now you have 2 same patches, the only thing that should be different is a checksum taken from original roms. And this difference you will see in comparsion, which will point to location where xdelta stores checksum. Find this location in your wanted patch and take checksum from it.

May 10, 2020, 06:17:14 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Now that I think about it, there is an easier way. You can make any patch for any rom, and since you know this rom checksum, you can just search for it in a patch
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Dracula X

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • My YouTube Page for ROM hacking
Re: Not a noob but having hell with Xdelta
« Reply #7 on: May 10, 2020, 06:56:11 pm »
Wow! This info really helped me alot just now. Thank you very much!
I might go back to Thunder Force II hacking again.

RexDart

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #8 on: May 10, 2020, 09:07:23 pm »
In DeltaPatcher you can choose to apply the patch by ignoring the checksum check. You can at least see if the patch works, after disabling the check.

It does not work after disabling the check. Two emulators refuse to run it.

May 10, 2020, 09:11:19 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
You have 2 different roms, romA and romB. Make copies of them, then change a single byte in these copies, let's say write FF at 0x1234. Then create patches using xdelta. Now you have 2 same patches, the only thing that should be different is a checksum taken from original roms. And this difference you will see in comparsion, which will point to location where xdelta stores checksum. Find this location in your wanted patch and take checksum from it.

May 10, 2020, 06:17:14 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Now that I think about it, there is an easier way. You can make any patch for any rom, and since you know this rom checksum, you can just search for it in a patch

Seems that it would be just as easy, if not easier, to just attempt to run the patch on all these roms I'm collecting to scavange checksums from.

May 10, 2020, 09:35:04 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Okay. In this one instance, I figured out that the problem is that the romhacking submission is incorrect & the site does not verify submissions. The article has the wrong checksum listed; another dump worked instead.  Wonderful. Gonna be lots of fun trying every possible dump for this folder full of failed xdelta patches I have.

How does one go about reporting this?
« Last Edit: May 10, 2020, 10:27:53 pm by RexDart »

Cyneprepou4uk

  • Sr. Member
  • ****
  • Posts: 455
  • I am the baldest romhacker
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #9 on: May 11, 2020, 04:37:01 am »
"flag as noncompliant" button
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

PolishedTurd

  • Full Member
  • ***
  • Posts: 179
    • View Profile
Re: Not a noob but having hell with Xdelta
« Reply #10 on: May 12, 2020, 04:53:48 pm »
I gather you are frustrated. It's not ideal, but someone has helped you solve your problem for free, so you can play ROM hacks that people made for free. Maybe they made a mistake with the submission, but that's how it goes sometimes.

On the bright side, the work you do to identify the problems can help others have an easier time in the future.