Page 1 of 1

Here are a couple files to fix the XBE Title extraction.

Posted: Sun Apr 15, 2018 7:22 am
by Rocky5
For some reason they read the XBEHeadersize instead of the certificate offset. So what this done was break xbe titles that were not formatted correctly and had a wrong xbeheadersize.
Anyhow replace these files in the source and build to fix it.

There are quite a few games that have broken xbeheader sizes.
Animaniacs - The Great Edgar Hunt is one and the reason I fixed it.

Re: Here are a couple files to fix the XBE Title extraction.

Posted: Mon May 07, 2018 9:57 pm
by Dan Dar3
I've attached a diff patch if you want to put it into a ticket and propose it to be merged into main codebase:
fix_xbe_title_extraction.zip
Patch
(854 Bytes) Downloaded 308 times

Had a quick look around for the .XBE file format and the original code probably worked for most titles if the Certificate structure was right after the Header structure? and that is why reading a chunk the size of the header and then a chunk the size of the certificate worked, not having to use the actual Certificate pointer value. http://www.caustik.com/cxbx/download/xbe.htm

Not sure I agree with the change for the "Certificate Address" from a structure pointer (4 bytes?) to a USHORT (2 bytes?) and how that worked in tour tests. From what I see the "Certificate Address" should be 4 byte size. I assume you have tried keeping _XBE_HEADER.Certificate as it was, a pointer to the structure and it didn't work? Or maybe I'm wrong and the compiler just sized this correctly...

Re: Here are a couple files to fix the XBE Title extraction.

Posted: Tue May 08, 2018 1:49 am
by Rocky5
Yeah it didn’t work, I had to change it to USHORT. I would have had to subtract 1000 off it so there was no point when the certificate pointer is actually only 2bytes, the other 2bytes are not required.


Example:
2bytes
0x0184
4bytes
0x00010184

Re: Here are a couple files to fix the XBE Title extraction.

Posted: Tue May 08, 2018 8:16 am
by Dan Dar3
Rocky, I think there is an important point about the size - sizing any field incorrectly will affect the values of the fields defined after it in the structure as that will shift their positions.

Re: Here are a couple files to fix the XBE Title extraction.

Posted: Tue May 08, 2018 4:31 pm
by Rocky5
That’s what I though but it just goes through each entry and grabs the offsets in the h file.

I seen no adverts effect in changing the value. All features of XBMC work still with the updated files.


Also that’s why I put the files up and not a patch file, as folk can see if I botched it or there was a better way lol