The Binding if Isaac Afterbirth

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ssl
Posts: 3
Joined: Sat Oct 31, 2015 6:35 am

The Binding if Isaac Afterbirth

Post by ssl »

Hello zenhax.
I am currently developing a logging application for BOI (run stats etc), and having the game's assets helped a lot with, well, everything.
Then, the much hyped Afterbirth DLC was released yesterday.

Unfortunately, this tool doesn't work with the one and only new resource file.

Any help would be much appreciated.

>shameless plug
Comments, suggestions and mainly criticism about my code are very welcome.

Thanks!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: The Binding if Isaac Afterbirth

Post by aluigi »

In my opinion there is no encryption because I can easily decompress the chunks of the filesystem.
Anyway let's wait what Ekey says, he already worked on this game.
ssl
Posts: 3
Joined: Sat Oct 31, 2015 6:35 am

Re: The Binding if Isaac Afterbirth

Post by ssl »

Unfortunately all the versions create a folder named UNKNOWN and throw this exception:
Unhandled Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Gibbed.Rebirth.FileFormats.ArchiveCompression.Decompress(Entry entry, Stream input, Stream output, Endian endian)
at Gibbed.Rebirth.Unpack.Program.Main(String[] args)


I also (tried to) read the code.
What sorcery is this.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: The Binding if Isaac Afterbirth

Post by Ekey »

Problem in the method of compression. In previous versions all tools supported only method 1 it's (LZW), but in this new archive used method 2 and it's (Deflate)

Code: Select all

struct AHeader
{
   uint8_t    iMagic[7]; // ARCH000
   uint8_t    iVersion; // 0 - Encrypted (Method 1), 1 - LZW (Chunks), 2 - DEFLATE (Chunks), 5 - Encrypted (Method 2)
   uint32_t   dwTableOffset;
   uint16_t   iEntryCount;
};


Code: Select all

struct AEntry
{
   uint32_t   dwNameHashA;
   uint32_t   dwNameHashB;
   uint32_t   dwOffset;
   uint32_t   dwSize; // Uncompressed size
   uint32_t   dwCRC;
};


if compressed:

Code: Select all

goto AEntry.dwOffset;

Code: Select all

get ZSIZE long
----GET COMPRESSED DATA----
----UNCOMPRESS----
Repeat until the output size is not equal to AEntry.dwSize
Last edited by Ekey on Tue Nov 03, 2015 3:19 pm, edited 1 time in total.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: The Binding if Isaac Afterbirth

Post by Ekey »

ssl
Posts: 3
Joined: Sat Oct 31, 2015 6:35 am

Re: The Binding if Isaac Afterbirth

Post by ssl »

Aye, saw the reddit post aswell.
Great job.

Thanks.