..

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
venixuc
Posts: 14
Joined: Tue Aug 13, 2019 10:12 pm

..

Post by venixuc »

..
Last edited by venixuc on Sat Oct 10, 2020 2:43 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Godfather 2 - help with .str files

Post by aluigi »

Link expired
venixuc
Posts: 14
Joined: Tue Aug 13, 2019 10:12 pm

..

Post by venixuc »

..
Last edited by venixuc on Sat Oct 10, 2020 2:44 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Godfather 2 - help with .str files

Post by aluigi »

There is already a topic about these files I guess:
viewtopic.php?t=1840

The str files are compressed with the RefPack algorithm:

Code: Select all

comtype dk2
goto 0x34
get SIZE long
goto 0x44
get ZSIZE long
savepos OFFSET
get NAME basename
clog NAME OFFSET ZSIZE SIZE
The decompressed file has the LCH2 magic at the beginning.

Anyway already exist tools so find and use them.
venixuc
Posts: 14
Joined: Tue Aug 13, 2019 10:12 pm

..

Post by venixuc »

..
Last edited by venixuc on Sat Oct 10, 2020 2:43 am, edited 1 time in total.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Godfather 2 - help with .str files

Post by Delutto »

aluigi wrote:The str files are compressed with the RefPack algorithm:

Code: Select all

comtype dk2
goto 0x34
get SIZE long
goto 0x44
get ZSIZE long
savepos OFFSET
get NAME basename
clog NAME OFFSET ZSIZE SIZE
The packages could have many files and they are chunked, and not all chunks are always compressed, only when they have the "kapR" identificator. Something like this (Pascal):

Code: Select all

type
   TDataChunk = packed record
      Magic: Array[0 .. 3] of AnsiChar;
      ZSize: UInt32;
      ComType: Array[0 .. 3] of AnsiChar;
   end;

type
   TData = record
      Magic: Array[0 .. 3] of AnsiChar;
      HeaderSize: UInt32;
      RDHS: Array[0 .. 3] of AnsiChar;
      Unknown: Array[0 .. 27] of Byte;
      DataSize: UInt32;
      Chunks: TArray<TDataChunk>;
   end;

type
   TStr = record
      Magic: Array[0 .. 3] of AnsiChar;
      HeaderSize: UInt32;
      Unknown: UInt32;
      Files: TArray<TData>;
   end;
venixuc
Posts: 14
Joined: Tue Aug 13, 2019 10:12 pm

..

Post by venixuc »

..
Last edited by venixuc on Sat Oct 10, 2020 2:43 am, edited 1 time in total.
venixuc
Posts: 14
Joined: Tue Aug 13, 2019 10:12 pm

..

Post by venixuc »

..