SC1 unpacking tools

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2767 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-06-01 14:01:14 +00:00
parent c9095d9793
commit 325a882c5d
13 changed files with 1653 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
// Reverse engineered from the Star Control executable.
#ifndef _LZTFB
#define _LZTFB
#include <stdint.h>
#include <stdio.h>
typedef struct LZTFB LZTFB;
#include "../../shared/cbytesex.h"
#include "huff.h"
#define LZTFB_BUF_SIZE 0x2000
struct LZTFB {
uint8_t buf[LZTFB_BUF_SIZE];
uint8_t *bufPtr;
uint32_t bufFill;
uint32_t lastBufFill;
BitStreamContext bsc;
bool literalsEncoded;
Huff_Context *huffTable[3];
int state;
struct {
int32_t offset;
uint32_t count;
} stateData;
size_t compressedSize;
size_t uncompressedSize;
uint8_t table2Shift;
uint8_t lengthBias;
};
LZTFB *LZTFB_new(const char *buf, size_t len);
int LZTFB_output(LZTFB *lztfb, FILE *out);
void LZTFB_delete(LZTFB *lztfb);
#endif /* _LZTFB */