Difference between revisions of "GRAF:Stella Games LzmaPack"

From XentaxWiki
Jump to: navigation, search
(Games)
(Games)
 
Line 68: Line 68:
 
* [[Mystery of Mortlake Mansion]] [[Stella Games LzmaPack|*.pack]]
 
* [[Mystery of Mortlake Mansion]] [[Stella Games LzmaPack|*.pack]]
 
* [[Secrets of Power: Alexander the Great]] [[Stella Games LzmaPack|*.pack]]
 
* [[Secrets of Power: Alexander the Great]] [[Stella Games LzmaPack|*.pack]]
 
+
<br><br>
  
  

Latest revision as of 15:27, 4 April 2021

Back to index | Edit this page

PACK

Format Specifications

uint8 {1}   - LZMA decoder properties size

byte {X}    - LZMA decoder properties bytes (typically 5 bytes)

uint32 {4}  - File count
// for each file
char {X}    - File name (.NET style string with size byte followed by characters)
int64 {8}   - File length
int64 {8}   - Compressed length
int64 {8}   - File content offset
uint16 {2}  - Attributes and flags (0: Uncompressed, 1: Compressed)
byte {x}    - File data

Programmatic Extraction

You can use the game engine itself to extract files. From one of the games listed below, obtain either LuckySoftCore.dll or Engine.dll (name depends on game) and reference it in your .NET code. The following shows how to call the engine function to obtain a handle to the LzmaPack.

using EngineBase; //using LuckySoftCore;
using EngineBase.Core; // using LuckySoftCore.Core;
using EngineBase.Compression; // using LuckySoftCore.Compression;

IDirectoryInfo repo = LzmaPack.OpenLZMAPack(strPathToLzmaPack);

IDirectoryInfo is similar to System.IO.DirectoryInfo, except it allows arbitrary underlying implementations, so you could read files from e.g. LzmaPacks.

Notes and Comments

Archive files of this format out in the wild is encrypted with an XOR stream cipher based on an Mersenne Twister implementation. You can find a Stream class for decryption in the Engine named GammaXoringStream.

MultiEx BMS Script

Note: not working. Decoder properties are stored once at the beginning of the archive instead of in each file.

# Lucky Soft/Stella Games LzmaPack (unfinished)
# script for QuickBMS http://quickbms.aluigi.org
# (C) 2012 GMMan

comtype lzma
get DECODERPROPSLEN byte
goto DECODERPROPSLEN + 1

get FILECOUNT long
for N = 1 to FILECOUNT
	get NAMELEN byte
	getdstring NAME NAMELEN
	get REALSIZE longlong
	get COMPRESSEDSIZE longlong
	get ADDRINSTREAM longlong
	get ATTRANDFLAGS short
	if ATTRANDFLAGS = 0
		log NAME ADDRINSTREAM REALSIZE
	else
		clog NAME ADDRINSTREAM COMPRESSEDSIZE REALSIZE
	endif
next N

Supported by Programs

Links

Forum thread regarding format

Games