lzma support for ps1 from Jens

This commit is contained in:
László Molnár
2006-08-11 11:18:01 +02:00
parent 4715cbb70d
commit 1554e2b135
11 changed files with 2250 additions and 1182 deletions
+188 -111
View File
@@ -41,18 +41,6 @@ static const
#include "stub/mipsel.r3000-ps1.h" #include "stub/mipsel.r3000-ps1.h"
#if 0
// lui / ori
# define MIPS_HI(a) ((a) >> 16)
#else
// lui / addiu
# define MIPS_HI(a) (((a) >> 16) + (((a) & 0x8000) >> 15))
#endif
#define MIPS_LO(a) ((a) & 0xffff)
#define MIPS_JP(a) ((0x08 << 24) | (((a) & 0x0fffffff) >> 2))
#define MIPS_PC16(a) ((a) >> 2)
#define TIL_ALIGNED(a,b) (((b) - ((a) & ((b) - 1))) & (b) - 1)
#define CD_SEC 2048 #define CD_SEC 2048
#define PS_HDR_SIZE CD_SEC #define PS_HDR_SIZE CD_SEC
#define PS_RAM_SIZE ram_size #define PS_RAM_SIZE ram_size
@@ -62,6 +50,18 @@ static const
#define SZ_IH_BKUP (10 * sizeof(LE32)) #define SZ_IH_BKUP (10 * sizeof(LE32))
#define HD_CODE_OFS (sizeof(ps1_exe_t)) #define HD_CODE_OFS (sizeof(ps1_exe_t))
#if 0
// lui / ori
# define MIPS_HI(a) ((a) >> 16)
#else
// lui / addiu
# define MIPS_HI(a) (((a) >> 16) + (((a) & 0x8000) >> 15))
#endif
#define MIPS_LO(a) ((a) & 0xffff)
//#define MIPS_JP(a) ((0x08 << 24) | (((a) & 0x0fffffff) >> 2))
#define MIPS_PC16(a) ((a) >> 2)
#define MIPS_PC26(a) (((a) & 0x0fffffff) >> 2)
#define K0_BS (0x80000000) #define K0_BS (0x80000000)
#define K1_BS (0xa0000000) #define K1_BS (0xa0000000)
#define FIX_PSVR (K1_BS - (ih.epc & K0_BS)) + (PS_HDR_SIZE - HD_CODE_OFS) #define FIX_PSVR (K1_BS - (ih.epc & K0_BS)) + (PS_HDR_SIZE - HD_CODE_OFS)
@@ -83,10 +83,12 @@ static const
PackPs1::PackPs1(InputFile *f) : PackPs1::PackPs1(InputFile *f) :
super(f), super(f),
isCon(!opt->ps1_exe.boot_only), is32Bit(!opt->ps1_exe.do_8bit), build_Loader(0), isCon(!opt->ps1_exe.boot_only), is32Bit(!opt->ps1_exe.do_8bit),
overlap(0), sa_cnt(0) sa_cnt(0), overlap(0), sz_unc(0), sz_cpr(0), pad_code(0)
{ {
COMPILE_TIME_ASSERT(sizeof(ps1_exe_t) == 188); COMPILE_TIME_ASSERT(sizeof(ps1_exe_t) == 136);
COMPILE_TIME_ASSERT(sizeof(ps1_exe_cp_t) == 44);
COMPILE_TIME_ASSERT(PS_HDR_SIZE > sizeof(ps1_exe_t)); COMPILE_TIME_ASSERT(PS_HDR_SIZE > sizeof(ps1_exe_t));
COMPILE_TIME_ASSERT(SZ_IH_BKUP == 40); COMPILE_TIME_ASSERT(SZ_IH_BKUP == 40);
#if 0 // 1 || defined(WITH_NRV) #if 0 // 1 || defined(WITH_NRV)
@@ -131,6 +133,8 @@ Linker* PackPs1::newLinker() const
value -= rel->section->offset + rel->offset; value -= rel->section->offset + rel->offset;
set_le16(location, get_le16(location) + MIPS_PC16(value)); set_le16(location, get_le16(location) + MIPS_PC16(value));
} }
else if (strcmp(type, "R_MIPS_26") == 0)
set_le32(location, get_le32(location) + MIPS_PC26(value));
else if (strcmp(type, "R_MIPS_32") == 0) else if (strcmp(type, "R_MIPS_32") == 0)
set_le32(location, get_le32(location) + value); set_le32(location, get_le32(location) + value);
else else
@@ -159,6 +163,21 @@ int PackPs1::readFileHeader()
return UPX_F_PS1_EXE; return UPX_F_PS1_EXE;
} }
bool PackPs1::readBkupHeader()
{
fi->seek(sizeof(ps1_exe_t), SEEK_SET);
fi->readx(&bh, sizeof(bh));
if (bh.ih_csum != upx_adler32(&bh, SZ_IH_BKUP))
{
// Compatibility
fi->seek(sizeof(ps1_exe_t)+8, SEEK_SET);
fi->readx(&bh, sizeof(bh));
if (bh.ih_csum != upx_adler32(&bh, SZ_IH_BKUP))
return false;
}
return true;
}
bool PackPs1::checkFileHeader() bool PackPs1::checkFileHeader()
{ {
@@ -229,54 +248,109 @@ bool PackPs1::canPack()
// //
**************************************************************************/ **************************************************************************/
int PackPs1::buildLoader(const Filter *) void PackPs1::buildPS1Loader(const Filter *)
{ {
initLoader(nrv_loader,sizeof(nrv_loader)); const char *p = NULL;
unsigned gap = 0;
if (isCon)
addLoader("ps1.con.start", ph.c_len & 3 ? "ps1.con.padcd" : "",
ih.tx_ptr & 0xffff ? "ps1.con.nrv.ptr" : "ps1.con.nrv.ptr.hi",
"ps1.con.entry",
NULL);
else
addLoader("ps1.cdb.start", "ps1.cdb.entry",
ih.tx_ptr & 0xffff ? "ps1.cdb.nrv.ptr" : "ps1.cdb.nrv.ptr.hi",
NULL);
if (ph.method == M_NRV2B_8) if (ph.method == M_NRV2B_8)
addLoader(isCon ? "ps1.small.nrv2b" : p = isCon ? "nrv2b.small,gb.8bit.sub,nrv.small.done" :
"ps1.cdb.nrv2b.8bit", NULL); "nrv2b.8bit";
else if (ph.method == M_NRV2D_8) else if (ph.method == M_NRV2D_8)
addLoader(isCon ? "ps1.small.nrv2d" : p = isCon ? "nrv2d.small,gb.8bit.sub,nrv.small.done" :
"ps1.cdb.nrv2d.8bit", NULL); "nrv2d.8bit";
else if (ph.method == M_NRV2E_8) else if (ph.method == M_NRV2E_8)
addLoader(isCon ? "ps1.small.nrv2e" : p = isCon ? "nrv2e.small,gb.8bit.sub,nrv.small.done" :
"ps1.cdb.nrv2e.8bit", NULL); "nrv2e.8bit";
else if (ph.method == M_NRV2B_LE32) else if (ph.method == M_NRV2B_LE32)
addLoader(isCon ? "ps1.small.nrv2b" : p = isCon ? "nrv2b.small,gb.32bit.sub,nrv.small.done" :
"ps1.cdb.nrv2b.32bit", NULL); "nrv2b.32bit";
else if (ph.method == M_NRV2D_LE32) else if (ph.method == M_NRV2D_LE32)
addLoader(isCon ? "ps1.small.nrv2d" : p = isCon ? "nrv2d.small,gb.32bit.sub,nrv.small.done" :
"ps1.cdb.nrv2d.32bit", NULL); "nrv2d.32bit";
else if (ph.method == M_NRV2E_LE32) else if (ph.method == M_NRV2E_LE32)
addLoader(isCon ? "ps1.small.nrv2e" : p = isCon ? "nrv2e.small,gb.32bit.sub,nrv.small.done" :
"ps1.cdb.nrv2e.32bit", NULL); "nrv2e.32bit";
else if (ph.method == M_LZMA)
p = "nrv2b.small,gb.8bit.sub,nrv.small.done,lzma.prep";
else else
throwInternalError("unknown compression method"); throwInternalError("unknown compression method");
if (isCon) if ((gap = ALIGN_GAP((ph.c_len + (isCon ? sz_cpr : 0)),4)))
addLoader(is32Bit ? "ps1.getbit.32bit.sub" : "ps1.getbit.8bit.sub", NULL); pad_code = gap;
else
pad_code = 0;
linker->addSection("pad.code", &pad_code, gap, 0);
if (sa_cnt)
addLoader(sa_cnt > (0x10000 << 2) ? "ps1.mset.long" : "ps1.mset.short",
ih.tx_len & 3 ? "ps1.mset.unaligned" : "ps1.mset.aligned",
NULL);
addLoader(isCon ? "ps1.con.exit" : "ps1.cdb.exit", "IDENTSTR", "UPX1HEAD", NULL);
if (isCon) if (isCon)
addLoader("ps1.con.regs", if (ph.method == M_LZMA)
is32Bit ? "ps1.getbit.32bit.size" : "ps1.getbit.8bit.size", NULL); addLoader("con.start", p,
ih.tx_ptr & 0xffff ? "dec.ptr" : "dec.ptr.hi",
"con.entry", "pad.code", "lzma.exec", NULL);
else
addLoader("con.start", "con.mcpy",
ph.c_len & 3 ? "con.padcd" : "",
ih.tx_ptr & 0xffff ? "dec.ptr" : "dec.ptr.hi",
"con.entry", p,
sa_cnt ? sa_cnt > (0x10000 << 2) ? "memset.long" : "memset.short" : "",
"con.exit", "pad.code", NULL);
else
if (ph.method == M_LZMA)
addLoader("cdb.start.lzma", "pad.code", "cdb.entry.lzma", p, "cdb.lzma.cpr",
ih.tx_ptr & 0xffff ? "dec.ptr" : "dec.ptr.hi",
"lzma.exec", NULL);
else
addLoader("cdb.start", "pad.code", "cdb.entry",
ih.tx_ptr & 0xffff ? "cdb.dec.ptr" : "cdb.dec.ptr.hi",
p,
sa_cnt ? sa_cnt > (0x10000 << 2) ? "memset.long" : "memset.short" : "",
"cdb.exit", "pad.code", NULL);
addLoader("UPX1HEAD", "IDENTSTR", NULL);
}
int PackPs1::buildLoader(const Filter *)
{
unsigned sa_tmp = sa_cnt;
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method) || ph.method == M_LZMA)
{
if (ph.overlap_overhead > sa_cnt)
{
if (!opt->force)
{
infoWarning("not in-place decompressible");
throwCantPack("packed data overlap (try --force)");
}
else
sa_tmp += overlap = ALIGN_UP((ph.overlap_overhead-sa_tmp),4);
}
if (ph.method == M_LZMA && !build_Loader)
{
initLoader(nrv_loader,sizeof(nrv_loader));
addLoader("LZMA_DEC10", "lzma.init", NULL);
addLoader(sa_tmp > (0x10000 << 2) ? "memset.long" : "memset.short",
"con.exit", NULL);
}
else if (ph.method == M_LZMA && build_Loader)
{
unsigned char *cprLoader = new unsigned char[MemBuffer::getSizeForCompression(sz_unc)];
int r = upx_compress(getLoader(), sz_unc, cprLoader, &sz_cpr, NULL, M_NRV2B_8, 10, NULL, NULL );
if (r != UPX_E_OK || sz_cpr >= sz_unc)
throwInternalError("loader compression failed");
initLoader(nrv_loader,sizeof(nrv_loader), 0, (ph.method != M_LZMA || isCon) ? 0 : 1);
linker->addSection("lzma.exec", cprLoader, sz_cpr, 0);
delete [] cprLoader;
buildPS1Loader();
}
else
{
initLoader(nrv_loader,sizeof(nrv_loader), 0, (ph.method != M_LZMA || isCon) ? 0 : 1);
buildPS1Loader();
}
}
else
throwInternalError("unknown compression method");
freezeLoader(); freezeLoader();
return getLoaderSize(); return getLoaderSize();
@@ -314,26 +388,37 @@ void PackPs1::pack(OutputFile *fo)
// compress (max_match = 65535) // compress (max_match = 65535)
upx_compress_config_t cconf; cconf.reset(); upx_compress_config_t cconf; cconf.reset();
cconf.conf_ucl.max_match = 65535; cconf.conf_ucl.max_match = 65535;
compressWithFilters(&ft, 512, 0, NULL, &cconf); cconf.conf_lzma.max_num_probs = 1846 + (768 << 4); // ushort: ~28KB stack
compressWithFilters(&ft, sa_cnt, 0, NULL, &cconf);
if (ph.overlap_overhead > sa_cnt) if (overlap)
{ {
if (!opt->force) opt->info_mode += !opt->info_mode ? 1 : 0;
{ infoWarning("%s: memory overlap %d bytes",fi->getName(),overlap);
infoWarning("not in-place decompressible"); sa_cnt += overlap;
throwCantPack("packed data overlap (try --force)"); }
}
else unsigned lzma_init = 0;
{
overlap = ALIGN_UP((ph.overlap_overhead-sa_cnt),4); if (ph.method == M_LZMA)
opt->info_mode += !opt->info_mode ? 1 : 0; {
infoWarning("%s: memory overlap %d bytes",fi->getName(),overlap); sz_unc = getLoaderSize();
}
lzma_init = 0u-(sz_unc-linker->getSymbolOffset("lzma.init"));
defineDecompressorSymbols();
linker->defineSymbol("lzma_decoder", linker->getSymbolOffset("LZMA_DEC10"));
linker->defineSymbol("entry", ih.epc);
linker->defineSymbol("SC",
sa_cnt > (0x10000 << 2) ? sa_cnt >> 5 : sa_cnt >> 2);
linker->relocate();
build_Loader = 1;
buildLoader(&ft);
} }
memcpy(&oh, &ih, sizeof(ih)); memcpy(&oh, &ih, sizeof(ih));
memcpy(&oh.ih_bkup, &ih.epc, SZ_IH_BKUP); memcpy(&bh, &ih.epc, SZ_IH_BKUP);
oh.ih_csum = upx_adler32(&ih.epc, SZ_IH_BKUP); bh.ih_csum = upx_adler32(&ih.epc, SZ_IH_BKUP);
if (ih.is_ptr == 0) if (ih.is_ptr == 0)
oh.is_ptr = PS_RAM_SIZE-0x10; oh.is_ptr = PS_RAM_SIZE-0x10;
@@ -347,37 +432,38 @@ void PackPs1::pack(OutputFile *fo)
MemBuffer loader(lsize); MemBuffer loader(lsize);
memcpy(loader, getLoader(), lsize); memcpy(loader, getLoader(), lsize);
unsigned pad = 0;
unsigned filelen = ALIGN_UP(ih.tx_len, 4); unsigned filelen = ALIGN_UP(ih.tx_len, 4);
unsigned pad_code = TIL_ALIGNED(ph.c_len, 4);
const unsigned decomp_data_start = ih.tx_ptr; const unsigned decomp_data_start = ih.tx_ptr;
const unsigned comp_data_start = ((decomp_data_start + filelen + overlap) - ph.c_len); const unsigned comp_data_start = (decomp_data_start + filelen + overlap) - ph.c_len;
const int h_len = lsize - getLoaderSectionStart("IDENTSTR"); const int h_len = lsize - getLoaderSectionStart("UPX1HEAD");
int d_len = 0; int d_len = 0;
int e_len = 0; int e_len = 0;
if (isCon) if (isCon)
{ {
e_len = lsize - h_len; e_len = lsize - h_len;
d_len = e_len - getLoaderSectionStart("ps1.con.entry"); d_len = e_len - getLoaderSectionStart("con.entry");
} }
else else
{ {
d_len = (lsize - h_len) - getLoaderSectionStart("ps1.cdb.entry"); d_len = (lsize - h_len) - getLoaderSectionStart((ph.method == M_LZMA) ? "cdb.entry.lzma" : "cdb.entry");
e_len = (lsize - d_len) - h_len; e_len = (lsize - d_len) - h_len;
} }
linker->defineSymbol("JPEP", MIPS_JP(ih.epc)); linker->defineSymbol("entry", ih.epc);
linker->defineSymbol("SC", MIPS_LO(sa_cnt > (0x10000 << 2) ? linker->defineSymbol("SC", MIPS_LO(sa_cnt > (0x10000 << 2) ?
sa_cnt >> 5 : sa_cnt >> 2)); sa_cnt >> 5 : sa_cnt >> 2));
linker->defineSymbol("DECO",decomp_data_start); linker->defineSymbol("DECO",decomp_data_start);
const unsigned entry = comp_data_start - e_len - pad_code; linker->defineSymbol("LS", (ph.method == M_LZMA ? sz_unc+16 : (d_len-pad_code)));
oh.tx_ptr = entry;
oh.tx_len = ph.c_len + e_len + pad_code; const unsigned entry = comp_data_start - e_len;
oh.epc = comp_data_start - e_len - pad_code; oh.epc = oh.tx_ptr = entry;
oh.tx_len = ph.c_len + e_len;
unsigned pad = 0;
if (!opt->ps1_exe.no_align) if (!opt->ps1_exe.no_align)
{ {
@@ -390,57 +476,52 @@ void PackPs1::pack(OutputFile *fo)
ibuf.clear(0,fdata_size); ibuf.clear(0,fdata_size);
upx_bytep paddata = ibuf; upx_bytep paddata = ibuf;
if (ph.method == M_LZMA)
{
linker->defineSymbol("lzma_init_off", lzma_init);
defineDecompressorSymbols();
}
if (isCon) if (isCon)
{ {
const char *p = is32Bit ? "ps1.getbit.32bit.sub" : "ps1.getbit.8bit.sub"; linker->defineSymbol("PAD", pad_code);
unsigned decomp_done = getLoaderSectionStart(p); if (ph.method == M_LZMA)
linker->defineSymbol("DCRT", (entry + getLoaderSectionStart("lzma.exec")));
p = is32Bit ? "ps1.getbit.32bit.size" : "ps1.getbit.8bit.size"; else
decomp_done += get_le32(&loader[getLoaderSectionStart(p)]); linker->defineSymbol("DCRT", (entry + (e_len - d_len)));
linker->defineSymbol("PC", pad_code);
linker->defineSymbol("DCRT", entry + (e_len - d_len));
linker->defineSymbol("LS",
d_len + get_le32(&loader[getLoaderSectionStart("ps1.con.regs")]));
linker->defineSymbol("decomp_done", decomp_done);
linker->relocate(); linker->relocate();
memcpy(loader, getLoader(), lsize); memcpy(loader, getLoader(), lsize);
patchPackHeader(loader, lsize); patchPackHeader(loader, lsize);
// ps1_exe_t structure 188 bytes // ps1_exe_t structure
fo->write(&oh,sizeof(oh)); fo->write(&oh,sizeof(oh));
fo->write(&bh,sizeof(bh));
// id & upx header // id & upx header
fo->write(loader + e_len, h_len); fo->write(loader + e_len, h_len);
} }
else else
{ {
linker->defineSymbol("CPDO", comp_data_start);
linker->defineSymbol("PSVR", FIX_PSVR); linker->defineSymbol("PSVR", FIX_PSVR);
linker->defineSymbol("CPDO", comp_data_start);
if (ph.method == M_LZMA)
linker->defineSymbol("lzma_cpr", getLoaderSectionStart("lzma.exec")
- getLoaderSectionStart("cdb.entry.lzma"));
linker->relocate(); linker->relocate();
memcpy(loader, getLoader(), lsize); memcpy(loader, getLoader(), lsize);
patchPackHeader(loader,lsize); patchPackHeader(loader,lsize);
// ps1_exe_t structure 188 bytes // ps1_exe_t structure
fo->write(&oh,sizeof(oh)); fo->write(&oh,sizeof(oh));
fo->write(&bh,sizeof(bh));
// decompressor // decompressor
fo->write(loader + e_len, d_len); fo->write(loader + e_len, d_len + h_len);
// id & upx header
fo->write(loader + e_len + d_len, h_len);
} }
// header size is 2048 bytes // header size is 2048 bytes + sector alignment
fo->write(paddata, PS_HDR_SIZE - fo->getBytesWritten()); fo->write(paddata, (pad + PS_HDR_SIZE) - fo->getBytesWritten());
// sector alignment
if (pad)
fo->write(paddata, pad);
// entry // entry
fo->write(loader, e_len); fo->write(loader, e_len);
// code must be aligned to 4! // compressed body
if (pad_code)
fo->write(paddata, pad_code);
// compressed binary / data
fo->write(obuf, ph.c_len); fo->write(obuf, ph.c_len);
verifyOverlappingDecompression(); verifyOverlappingDecompression();
@@ -458,7 +539,7 @@ void PackPs1::pack(OutputFile *fo)
char method_name[32+1]; set_method_name(method_name, sizeof(method_name), ph.method, ph.level); char method_name[32+1]; set_method_name(method_name, sizeof(method_name), ph.method, ph.level);
printf("%-13s: compressor : %s\n", getName(), method_name); printf("%-13s: compressor : %s\n", getName(), method_name);
#endif #endif
} }
/************************************************************************* /*************************************************************************
@@ -469,11 +550,10 @@ int PackPs1::canUnpack()
{ {
if (!readFileHeader()) if (!readFileHeader())
return false; return false;
if (!readPackHeader(1024)) if (!readPackHeader(CD_SEC))
return false; return false;
// check header as set by packer // check header as set by packer
if (ih.ih_csum != upx_adler32(&ih.ih_bkup, SZ_IH_BKUP) && if (!readBkupHeader() || ph.c_len >= fdata_size)
(ph.c_len >= fdata_size))
throwCantUnpack("header damaged"); throwCantUnpack("header damaged");
// generic check // generic check
if (!checkFileHeader()) if (!checkFileHeader())
@@ -490,7 +570,7 @@ void PackPs1::unpack(OutputFile *fo)
{ {
// restore orig exec hdr // restore orig exec hdr
memcpy(&oh, &ih, sizeof(ih)); memcpy(&oh, &ih, sizeof(ih));
memcpy(&oh.epc, &ih.ih_bkup, SZ_IH_BKUP); memcpy(&oh.epc, &bh, SZ_IH_BKUP);
// check for removed sector alignment // check for removed sector alignment
assert(oh.tx_len >= ph.u_len); assert(oh.tx_len >= ph.u_len);
@@ -502,9 +582,6 @@ void PackPs1::unpack(OutputFile *fo)
fi->seek(PS_HDR_SIZE, SEEK_SET); fi->seek(PS_HDR_SIZE, SEEK_SET);
fi->readx(ibuf, fdata_size); fi->readx(ibuf, fdata_size);
// clear backup and checksum of header
memset(&oh.ih_bkup, 0, SZ_IH_BKUP+4);
// decompress // decompress
decompress(ibuf + (fdata_size - ph.c_len), obuf); decompress(ibuf + (fdata_size - ph.c_len), obuf);
@@ -515,8 +592,8 @@ void PackPs1::unpack(OutputFile *fo)
fo->write(&oh, sizeof(oh)); fo->write(&oh, sizeof(oh));
// align the ps exe header (mode 2 sector data size) // align the ps exe header (mode 2 sector data size)
ibuf.clear(); ibuf.clear();
fo->write(ibuf, PS_HDR_SIZE - fo->getBytesWritten());
// write uncompressed data + pad // write uncompressed data + pad
fo->write(ibuf, PS_HDR_SIZE - sizeof(oh));
obuf.clear(ph.u_len, pad); obuf.clear(ph.u_len, pad);
fo->write(obuf, ph.u_len + pad); fo->write(obuf, ph.u_len + pad);
} }
+19 -11
View File
@@ -42,7 +42,7 @@ class PackPs1 : public Packer
{ {
typedef Packer super; typedef Packer super;
public: public:
PackPs1(InputFile *f); PackPs1(InputFile *f);
virtual int getVersion() const { return 13; } virtual int getVersion() const { return 13; }
virtual int getFormat() const { return UPX_F_PS1_EXE; } virtual int getFormat() const { return UPX_F_PS1_EXE; }
virtual const char *getName() const { return "ps1/exe"; } virtual const char *getName() const { return "ps1/exe"; }
@@ -56,6 +56,8 @@ public:
virtual int canUnpack(); virtual int canUnpack();
protected: protected:
virtual bool readBkupHeader();
virtual void buildPS1Loader(const Filter *ft=0);
virtual int buildLoader(const Filter *ft); virtual int buildLoader(const Filter *ft);
virtual Linker* newLinker() const; virtual Linker* newLinker() const;
@@ -84,25 +86,31 @@ protected:
LE32 sp, fp, gp0, ra, k0; LE32 sp, fp, gp0, ra, k0;
// origin Jap/USA/Europe // origin Jap/USA/Europe
char origin[60]; char origin[60];
// some safety space after that
char pad[8];
// backup of the original header (epc - is_len) // backup of the original header (epc - is_len)
LE32 ih_bkup[10]; // id & the upx header ...
// plus checksum for the backup
LE32 ih_csum;
// id & the upx header.
} }
__attribute_packed; __attribute_packed;
struct ps1_exe_cp_t
{
LE32 ih_bkup[10];
// plus checksum for the backup
LE32 ih_csum;
}
__attribute_packed;
// unpack_only
ps1_exe_cp_t bh;
ps1_exe_t ih, oh; ps1_exe_t ih, oh;
bool build_Loader;
bool isCon; bool isCon;
bool is32Bit; bool is32Bit;
unsigned ram_size; unsigned ram_size;
unsigned overlap; unsigned sa_cnt, overlap;
unsigned sa_cnt; unsigned sz_unc, sz_cpr;
unsigned pad_code;
// filesize-PS_HDR_SIZE // filesize-PS_HDR_SIZE
unsigned fdata_size; unsigned fdata_size;
}; };
+1
View File
@@ -657,6 +657,7 @@ mipsel.r3000-ps1.h : tc_list = mipsel.r3000-ps1 default
tc.mipsel.r3000-ps1.as = mipsel-elf-as -O2 -mno-pdr tc.mipsel.r3000-ps1.as = mipsel-elf-as -O2 -mno-pdr
tc.mipsel.r3000-ps1.pp-asm = gcc -E -nostdinc -x assembler-with-cpp -Wall tc.mipsel.r3000-ps1.pp-asm = gcc -E -nostdinc -x assembler-with-cpp -Wall
tc.mipsel.r3000-ps1.gcc = mipsel-elf-gcc
mipsel.r3000-ps1.h : $(srcdir)/src/mipsel.r3000-ps1.asm mipsel.r3000-ps1.h : $(srcdir)/src/mipsel.r3000-ps1.asm
# call gpp_inc to generate .d file # call gpp_inc to generate .d file
+1403 -930
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,47 @@
MAKEFLAGS += -rR
.SUFFIXES:
.SECONDEXPANSION:
ifndef top_srcdir
__dir_list = . .. ../.. ../../.. ../../../.. ../../../../..
__dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
default.targets = all
STUBS = NO_STUBS
include $(top_srcdir)/src/stub/Makefile
STUBS =
# /***********************************************************************
# // mipsel.r3000-lzma
# ************************************************************************/
ifneq ($(wildcard $(UPX_LZMADIR)/C/7zip/.),)
STUBS += lzma_d_cf.S lzma_d_cs.S
lzma_d_c%.S : tc_list = mipsel-lzma mipsel.r3000-ps1 default
lzma_d_c%.S : tc_bfdname = elf32-littlemips
tc.mipsel-lzma.gcc = $(tc.mipsel.r3000-ps1.gcc)
tc.mipsel-lzma.gcc += -march=r3000 -pie -fomit-frame-pointer
tc.mipsel-lzma.gcc += -G0 -fPIC -mabi=eabi
tc.mipsel-lzma.gcc += -ffunction-sections
tc.mipsel-lzma.gcc += -I$(UPX_LZMADIR)
tc.mipsel-lzma.gcc += -I$(top_srcdir)/src
lzma_d_c%.S : lzma_d_c.c
$(call tc,gcc) $(PP_FLAGS) -c $< -o tmp/$T.o
$(call tc,objstrip) tmp/$T.o
$(call tc,m-objcopy) -O binary --only-section .text.LzmaDecode tmp/$T.o tmp/$T.bin
head -c-0 tmp/$T.bin > tmp/$T.out
$(call tc,m-objdump) -b binary -m mips:3000 -D tmp/$T.out > tmp/$T.out.lst
$(call tc,bin2h) --mode=gas tmp/$T.out $@
lzma_d_cf.% : PP_FLAGS = -DFAST -Os
lzma_d_cs.% : PP_FLAGS = -DSMALL -O3
endif
+12 -12
View File
@@ -37,22 +37,22 @@
#define tmp at #define tmp at
#define src a0 #define dst t0
#define dst a1 #define src a1
#define pc a2 #define pc a0
#define cnt t0 #define cnt a2
#define src_ilen src #define src_ilen src
#define bb t0 #define bb t1
#define ilen t1 #define ilen t2
#define last_m_off t2 #define last_m_off t3
#define m_len t3 #define m_len t4
#define bc t4 #define bc t5
#define var t5 #define var t6
#define m_off t6 #define m_off t7
#define m_pos t6 #define m_pos t7
;////////////////////////////////////// ;//////////////////////////////////////
@@ -0,0 +1,70 @@
/* lzma_d.S -- MIPS R3000 decompressor for LZMA
This file is part of the UPX executable compressor.
Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2006 Laszlo Molnar
Copyright (C) 2000-2006 John F. Reiser
Copyright (C) 2002-2006 Jens Medoch
All Rights Reserved.
UPX and the UCL library are free software; you can redistribute them
and/or modify them under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Markus F.X.J. Oberhumer Laszlo Molnar
<mfx@users.sourceforge.net> <ml1050@users.sourceforge.net>
John F. Reiser Jens Medoch
<jreiser@users.sourceforge.net> <jssg@users.sourceforge.net>
*/
section lzma.init
li tmp,%lo(UPXa-lzma_args_sz)
addu sp,tmp
/*
move var,sp
1:
sw zero,0(var)
addiu tmp,4
bnez tmp,1b
addiu var,4
*/
addiu src,2
la inSize,UPXc
la outSize,UPXb
addu poutSizeProcessed,sp,outSizeProcessed
addiu pinSizeprocessed,sp,inSizeProcessed
la tmp,UPXd
sw dst,dst_save(sp)
addiu CLzmaDecoderState,sp,lzma_args_sz
bal lzma_decoder
sw tmp,0(CLzmaDecoderState)
lw dst,dst_save(sp)
li tmp,%lo(UPXa-lzma_args_sz)
addu dst,t3
subu sp,tmp
section LZMA_DEC10
#include "lzma_d_cs.S"
section LZMA_DEC20
#include "lzma_d_cf.S"
// vi:ts=8:et
@@ -0,0 +1,191 @@
.byte 152,255,189, 39, 16, 0,180,175, 33,160, 0, 0, 20, 0,181,175 /* 0x0000 */
.byte 33,168, 0, 0, 28, 0,190,175, 33,240, 0, 0, 0, 0,176,175 /* 0x0010 */
.byte 1, 0, 16, 52, 48, 0,176,175, 52, 0,176,175, 84, 0,176,175 /* 0x0020 */
.byte 24, 0,182,175, 12, 0,179,175, 33, 24, 0, 0, 8, 0,178,175 /* 0x0030 */
.byte 4, 0,177,175, 2, 0,143,144, 4, 0,130, 36, 4,200,240, 1 /* 0x0040 */
.byte 255,255, 44, 39, 1, 0,153,144, 96, 0,172,175, 4,112, 48, 3 /* 0x0050 */
.byte 255,255,204, 37,100, 0,172,175, 0, 0,140,144, 0, 0,224,172 /* 0x0060 */
.byte 0, 0, 64,173, 1, 0,143,144, 80, 0,172,175, 33,192,143, 1 /* 0x0070 */
.byte 0, 3, 13, 52, 4,112, 13, 3, 54, 7,207, 37, 7, 0,224, 17 /* 0x0080 */
.byte 44, 0,162,175, 2, 0, 66, 36, 0, 4, 25, 52, 1, 0, 99, 36 /* 0x0090 */
.byte 43,192,111, 0,251,255, 0, 23,254,255, 89,164, 33, 88,160, 0 /* 0x00a0 */
.byte 33,152,166, 0, 33, 16, 0, 0,255,255, 3, 36, 33,120, 0, 0 /* 0x00b0 */
.byte 176, 2,115, 17, 1, 0,239, 37, 0, 0,121,145, 0,114, 2, 0 /* 0x00c0 */
.byte 37, 16,217, 1, 5, 0,248, 41,249,255, 0, 23, 1, 0,107, 37 /* 0x00d0 */
.byte 160, 2, 0, 16, 43,104,137, 2, 64,121, 30, 0, 44, 0,161,143 /* 0x00e0 */
.byte 96, 0,172,143, 33,112, 47, 0, 36,176,140, 2, 64,104, 22, 0 /* 0x00f0 */
.byte 33,136,205, 1, 0, 1, 25, 60, 43,192,121, 0, 7, 0, 0, 19 /* 0x0100 */
.byte 92, 0,177,175,155, 2,115, 17, 0, 26, 3, 0, 1, 0,107, 37 /* 0x0110 */
.byte 255,255,121,145, 0,114, 2, 0, 37, 16,217, 1, 0, 0, 36,150 /* 0x0120 */
.byte 194,194, 3, 0, 24, 0, 4, 3, 18, 48, 0, 0, 43,120, 70, 0 /* 0x0130 */
.byte 137, 0,224, 17, 0, 8, 13, 52, 35,112,164, 1, 67,201, 14, 0 /* 0x0140 */
.byte 100, 0,172,143, 33, 32,153, 0, 36,192,140, 2, 80, 0,172,143 /* 0x0150 */
.byte 0, 0, 36,166, 4,120,152, 1, 8, 0, 13, 52, 35,112,172, 1 /* 0x0160 */
.byte 7,200,213, 1, 33,192,249, 1,128,112, 24, 0, 35,120,216, 1 /* 0x0170 */
.byte 44, 0,161,143, 64,122, 15, 0, 33,104, 47, 0,108, 14,177, 37 /* 0x0180 */
.byte 33, 24,192, 0, 7, 0,217, 43, 90, 0, 32, 23, 1, 0, 18, 52 /* 0x0190 */
.byte 35,192,144, 2, 33,120, 24, 1, 0, 0,236,145, 0, 0, 0, 0 /* 0x01a0 */
.byte 40, 0,172,175,108, 16,172, 37, 60, 0,172,175, 40, 0,161,143 /* 0x01b0 */
.byte 0, 0, 0, 0, 64, 96, 1, 0, 0, 1,149, 49, 33,112,178, 2 /* 0x01c0 */
.byte 60, 0,161,143, 64,104, 14, 0, 40, 0,172,175, 0, 1, 12, 60 /* 0x01d0 */
.byte 43,200,108, 0, 7, 0, 32, 19, 33,176, 45, 0,101, 2,115, 17 /* 0x01e0 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,109,145, 0,122, 2, 0 /* 0x01f0 */
.byte 37, 16,237, 1, 0, 0,196,150,194,202, 3, 0, 24, 0, 36, 3 /* 0x0200 */
.byte 18, 48, 0, 0, 43,192, 70, 0, 11, 0, 0, 19, 64,120, 18, 0 /* 0x0210 */
.byte 64,144, 18, 0, 0, 8, 14, 52, 35,120,196, 1, 67,105, 15, 0 /* 0x0220 */
.byte 33, 32,141, 0, 0, 0,196,166, 10, 0,160, 18, 33, 24,192, 0 /* 0x0230 */
.byte 49, 0, 0, 16, 0, 1, 79, 42, 1, 0,242, 37, 35, 16, 70, 0 /* 0x0240 */
.byte 67,193, 4, 0, 35, 32,152, 0, 0, 0,196,166, 41, 0,160, 18 /* 0x0250 */
.byte 35, 24,102, 0, 0, 1, 77, 42,212,255,160, 21, 0, 0, 0, 0 /* 0x0260 */
.byte 37, 0, 0, 16, 0, 1, 79, 42, 64,104, 18, 0, 0, 1, 25, 60 /* 0x0270 */
.byte 43,192,121, 0, 7, 0, 0, 19, 33,168, 45, 2, 61, 2,115, 17 /* 0x0280 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,121,145, 0,114, 2, 0 /* 0x0290 */
.byte 37, 16,217, 1, 0, 0,164,150,194,194, 3, 0, 24, 0, 4, 3 /* 0x02a0 */
.byte 18, 48, 0, 0, 43,120, 70, 0, 12, 0,224, 17, 0, 0, 0, 0 /* 0x02b0 */
.byte 0, 8, 13, 52, 35,112,164, 1, 67,201, 14, 0, 33, 32,153, 0 /* 0x02c0 */
.byte 0, 0,164,166, 64,144, 18, 0, 0, 1, 79, 42,230,255,224, 21 /* 0x02d0 */
.byte 33, 24,192, 0, 11, 0, 0, 16, 33,104, 20, 1, 35, 24,102, 0 /* 0x02e0 */
.byte 35, 16, 70, 0, 67,193, 4, 0, 35, 32,152, 0, 0, 0,164,166 /* 0x02f0 */
.byte 1, 0,178, 37, 0, 1, 79, 42,220,255,224, 21, 64,104, 18, 0 /* 0x0300 */
.byte 33,104, 20, 1, 1, 0,148, 38,255, 0, 85, 50, 0, 0,181,161 /* 0x0310 */
.byte 4, 0,217, 43, 5, 0, 32, 19, 43,104,137, 2,110,255,160, 21 /* 0x0320 */
.byte 33,240, 0, 0, 14, 2, 0, 16, 0, 1, 25, 60, 10, 0,216, 43 /* 0x0330 */
.byte 5, 0, 0, 19, 0, 0, 0, 0,103,255,160, 21,253,255,222, 39 /* 0x0340 */
.byte 7, 2, 0, 16, 0, 1, 25, 60, 99,255,160, 21,250,255,222, 39 /* 0x0350 */
.byte 3, 2, 0, 16, 0, 1, 25, 60, 67,121, 4, 0, 35, 32,143, 0 /* 0x0360 */
.byte 0, 0, 36,166, 44, 0,161,143, 64,112, 30, 0, 33,144, 46, 0 /* 0x0370 */
.byte 128, 1, 81, 38, 35, 24,102, 0, 0, 1, 13, 60, 43,200,109, 0 /* 0x0380 */
.byte 7, 0, 32, 19, 35, 16, 70, 0,250, 1,115, 17, 0, 26, 3, 0 /* 0x0390 */
.byte 1, 0,107, 37,255,255,109,145, 0,122, 2, 0, 37, 16,237, 1 /* 0x03a0 */
.byte 0, 0, 36,150,194,202, 3, 0, 24, 0, 36, 3, 18, 48, 0, 0 /* 0x03b0 */
.byte 43,192, 70, 0, 24, 0, 0, 19, 3, 0, 24, 52, 0, 8, 14, 52 /* 0x03c0 */
.byte 35,120,196, 1, 67,105, 15, 0, 52, 0,172,143, 33, 32,141, 0 /* 0x03d0 */
.byte 84, 0,172,175, 48, 0,172,143, 0, 0, 36,166, 52, 0,172,175 /* 0x03e0 */
.byte 48, 0,176,175, 7, 0,217, 43, 2, 0, 32, 19, 33, 24,192, 0 /* 0x03f0 */
.byte 33,192, 0, 0, 0, 1, 15, 60, 44, 0,161,143, 43,112,111, 0 /* 0x0400 */
.byte 100, 6, 49, 36, 33,168, 32, 2,173, 0,192, 17, 33,240, 0, 3 /* 0x0410 */
.byte 165, 0, 0, 16, 0, 0, 0, 0, 67,193, 4, 0, 35, 32,152, 0 /* 0x0420 */
.byte 0, 0, 36,166,152, 1, 81, 38, 35, 24,102, 0, 0, 1, 15, 60 /* 0x0430 */
.byte 43,112,111, 0, 7, 0,192, 17, 35, 16, 70, 0,205, 1,115, 17 /* 0x0440 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,111,145, 0,202, 2, 0 /* 0x0450 */
.byte 37, 16, 47, 3, 0, 0, 36,150,194,114, 3, 0, 24, 0,196, 1 /* 0x0460 */
.byte 18, 48, 0, 0, 43,104, 70, 0, 56, 0,160, 17, 0, 8, 24, 52 /* 0x0470 */
.byte 35,200, 4, 3, 67,121, 25, 0, 33, 32,143, 0, 92, 0,161,143 /* 0x0480 */
.byte 0, 0, 36,166, 33, 24,192, 0, 0, 1, 14, 60, 43,104,110, 0 /* 0x0490 */
.byte 7, 0,160, 17,224, 1, 49, 36,182, 1,115, 17, 0, 26, 3, 0 /* 0x04a0 */
.byte 1, 0,107, 37,255,255,110,145, 0,194, 2, 0, 37, 16, 14, 3 /* 0x04b0 */
.byte 0, 0, 36,150,194,106, 3, 0, 24, 0,164, 1, 18, 48, 0, 0 /* 0x04c0 */
.byte 43,200, 70, 0, 23, 0, 32, 19, 0, 8, 15, 52, 35,192,228, 1 /* 0x04d0 */
.byte 67,113, 24, 0, 33, 32,142, 0, 0, 0, 36,166,165, 1,128, 18 /* 0x04e0 */
.byte 33, 24,192, 0, 7, 0,217, 43, 2, 0, 32, 19, 11, 0, 24, 52 /* 0x04f0 */
.byte 9, 0, 24, 52, 33,104, 20, 1, 33,240, 0, 3, 35,192,144, 2 /* 0x0500 */
.byte 33,120, 24, 1, 0, 0,245,145, 1, 0,148, 38, 0, 0,181,161 /* 0x0510 */
.byte 43,104,137, 2,241,254,160, 21, 64,121, 30, 0,144, 1, 0, 16 /* 0x0520 */
.byte 0, 1, 25, 60, 67,201, 4, 0, 35, 32,153, 0, 11, 0, 25, 52 /* 0x0530 */
.byte 35, 16, 70, 0, 0, 0, 36,166, 7, 0,216, 43, 83, 0, 0, 19 /* 0x0540 */
.byte 35, 24,102, 0, 81, 0, 0, 16, 8, 0, 25, 52, 67,193, 4, 0 /* 0x0550 */
.byte 35, 32,152, 0, 0, 0, 36,166,176, 1, 81, 38, 35, 24,102, 0 /* 0x0560 */
.byte 0, 1, 15, 60, 43,112,111, 0, 7, 0,192, 17, 35, 16, 70, 0 /* 0x0570 */
.byte 128, 1,115, 17, 0, 26, 3, 0, 1, 0,107, 37,255,255,111,145 /* 0x0580 */
.byte 0,202, 2, 0, 37, 16, 47, 3, 0, 0, 36,150,194,114, 3, 0 /* 0x0590 */
.byte 24, 0,196, 1, 18, 48, 0, 0, 43,104, 70, 0, 14, 0,160, 17 /* 0x05a0 */
.byte 0, 8, 24, 52, 35,200, 4, 3, 67,121, 25, 0, 48, 0,185,143 /* 0x05b0 */
.byte 48, 0,176,175, 33,128, 32, 3, 11, 0, 25, 52, 33, 32,143, 0 /* 0x05c0 */
.byte 0, 0, 36,166, 7, 0,216, 43, 48, 0, 0, 19, 33, 24,192, 0 /* 0x05d0 */
.byte 46, 0, 0, 16, 8, 0, 25, 52, 67,113, 4, 0, 35, 32,142, 0 /* 0x05e0 */
.byte 0, 0, 36,166,200, 1, 81, 38, 35, 24,102, 0, 0, 1, 13, 60 /* 0x05f0 */
.byte 43,200,109, 0, 7, 0, 32, 19, 35, 16, 70, 0, 93, 1,115, 17 /* 0x0600 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,109,145, 0,122, 2, 0 /* 0x0610 */
.byte 37, 16,237, 1, 0, 0, 36,150,194,202, 3, 0, 24, 0, 36, 3 /* 0x0620 */
.byte 18, 48, 0, 0, 43,192, 70, 0, 8, 0, 0, 19, 0, 8, 14, 52 /* 0x0630 */
.byte 35,120,196, 1, 67,105, 15, 0, 33, 32,141, 0, 0, 0, 36,166 /* 0x0640 */
.byte 52, 0,185,143, 9, 0, 0, 16, 33, 24,192, 0, 35, 24,102, 0 /* 0x0650 */
.byte 35, 16, 70, 0, 67,201, 4, 0, 35, 32,153, 0, 0, 0, 36,166 /* 0x0660 */
.byte 52, 0,172,143, 84, 0,185,143, 84, 0,172,175, 7, 0,216, 43 /* 0x0670 */
.byte 48, 0,172,143, 48, 0,176,175, 33,128, 32, 3, 11, 0, 25, 52 /* 0x0680 */
.byte 2, 0, 0, 19, 52, 0,172,175, 8, 0, 25, 52, 0, 1, 15, 60 /* 0x0690 */
.byte 44, 0,161,143, 43,112,111, 0,104, 10, 49, 36, 33,168, 32, 2 /* 0x06a0 */
.byte 7, 0,192, 17, 33,240, 32, 3, 50, 1,115, 17, 0, 26, 3, 0 /* 0x06b0 */
.byte 1, 0,107, 37,255,255,111,145, 0,202, 2, 0, 37, 16, 47, 3 /* 0x06c0 */
.byte 0, 0,164,150,194,114, 3, 0, 24, 0,196, 1, 18, 48, 0, 0 /* 0x06d0 */
.byte 43,104, 70, 0, 20, 0,160, 17, 0, 8, 24, 52, 35,200, 4, 3 /* 0x06e0 */
.byte 67,121, 25, 0, 33, 32,143, 0, 0, 0,164,166, 0,113, 22, 0 /* 0x06f0 */
.byte 33,104, 46, 2, 4, 0,181, 37, 1, 0, 18, 52, 64,112, 18, 0 /* 0x0700 */
.byte 33,136,174, 2, 3, 0, 22, 52, 76, 0,182,175, 33, 24,192, 0 /* 0x0710 */
.byte 0, 1, 12, 60, 43,200,108, 0, 66, 0, 32, 19, 88, 0,160,175 /* 0x0720 */
.byte 58, 0, 0, 16, 0, 0, 0, 0, 67,201, 4, 0, 35, 32,153, 0 /* 0x0730 */
.byte 0, 0,164,166, 2, 0, 53, 38, 35, 24,102, 0, 0, 1, 24, 60 /* 0x0740 */
.byte 43,120,120, 0, 7, 0,224, 17, 35, 16, 70, 0, 9, 1,115, 17 /* 0x0750 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,120,145, 0,106, 2, 0 /* 0x0760 */
.byte 37, 16,184, 1, 0, 0,164,150,194,122, 3, 0, 24, 0,228, 1 /* 0x0770 */
.byte 18, 48, 0, 0, 43,112, 70, 0, 21, 0,192, 17, 1, 0, 18, 52 /* 0x0780 */
.byte 0, 8, 25, 52, 35,104, 36, 3, 67,193, 13, 0, 33, 32,152, 0 /* 0x0790 */
.byte 0, 0,164,166, 0,121, 22, 0, 33,112, 47, 2, 4, 1,213, 37 /* 0x07a0 */
.byte 64,112, 18, 0, 33,136,174, 2, 3, 0, 22, 52, 33, 24,192, 0 /* 0x07b0 */
.byte 8, 0, 12, 52, 88, 0,172,175, 0, 1, 12, 60, 43,200,108, 0 /* 0x07c0 */
.byte 24, 0, 32, 19, 76, 0,182,175, 16, 0, 0, 16, 0, 0, 0, 0 /* 0x07d0 */
.byte 35, 24,102, 0, 35, 16, 70, 0, 67,105, 4, 0, 35, 32,141, 0 /* 0x07e0 */
.byte 0, 0,164,166, 4, 2, 53, 38, 16, 0, 12, 52, 88, 0,172,175 /* 0x07f0 */
.byte 8, 0, 22, 52, 76, 0,182,175, 64,112, 18, 0, 0, 1, 12, 60 /* 0x0800 */
.byte 43,200,108, 0, 7, 0, 32, 19, 33,136,174, 2,217, 0,115, 17 /* 0x0810 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,109,145, 0,122, 2, 0 /* 0x0820 */
.byte 37, 16,237, 1, 0, 0, 36,150,194,202, 3, 0, 24, 0, 36, 3 /* 0x0830 */
.byte 18, 48, 0, 0, 43,192, 70, 0, 11, 0, 0, 19,255,255,214, 38 /* 0x0840 */
.byte 64,144, 18, 0, 0, 8, 14, 52, 35,120,196, 1, 67,105, 15, 0 /* 0x0850 */
.byte 33, 32,141, 0, 0, 0, 36,166,231,255,192, 22, 33, 24,192, 0 /* 0x0860 */
.byte 9, 0, 0, 16, 4, 0,205, 43, 1, 0,210, 37, 35, 16, 70, 0 /* 0x0870 */
.byte 67,201, 4, 0, 35, 32,153, 0, 0, 0, 36,166,222,255,192, 22 /* 0x0880 */
.byte 35, 24,102, 0, 4, 0,205, 43, 76, 0,172,143, 1, 0, 14, 52 /* 0x0890 */
.byte 4,120,142, 1, 88, 0,172,143, 35,144, 79, 2,157, 0,160, 17 /* 0x08a0 */
.byte 33,144, 76, 2, 3, 0, 24, 52, 4, 0, 89, 42, 2, 0, 32, 19 /* 0x08b0 */
.byte 7, 0,222, 39, 33,192, 64, 2, 6, 0, 21, 52, 44, 0,161,143 /* 0x08c0 */
.byte 192,193, 24, 0, 33,120, 56, 0, 96, 3,241, 37, 1, 0, 22, 52 /* 0x08d0 */
.byte 64,192, 22, 0, 0, 1, 12, 60, 43,112,108, 0, 7, 0,192, 17 /* 0x08e0 */
.byte 33,128, 56, 2,163, 0,115, 17, 0, 26, 3, 0, 1, 0,107, 37 /* 0x08f0 */
.byte 255,255,111,145, 0,202, 2, 0, 37, 16, 47, 3, 0, 0, 4,150 /* 0x0900 */
.byte 194,114, 3, 0, 24, 0,196, 1, 18, 48, 0, 0, 43,104, 70, 0 /* 0x0910 */
.byte 11, 0,160, 17,255,255,181, 38, 64,176, 22, 0, 0, 8, 24, 52 /* 0x0920 */
.byte 35,200, 4, 3, 67,121, 25, 0, 33, 32,143, 0, 0, 0, 4,166 /* 0x0930 */
.byte 231,255,160, 22, 33, 24,192, 0, 9, 0, 0, 16,192,255,214, 38 /* 0x0940 */
.byte 1, 0, 22, 39, 35, 16, 70, 0, 67,113, 4, 0, 35, 32,142, 0 /* 0x0950 */
.byte 0, 0, 4,166,222,255,160, 22, 35, 24,102, 0,192,255,214, 38 /* 0x0960 */
.byte 4, 0,217, 42, 98, 0, 32, 23, 1, 0,207, 50, 2, 0,240, 53 /* 0x0970 */
.byte 67,192, 22, 0, 14, 0,206, 42, 19, 0,192, 17,255,255, 21, 39 /* 0x0980 */
.byte 64,120, 22, 0, 1, 0, 22, 52, 4,128,176, 2, 44, 0,161,143 /* 0x0990 */
.byte 64,104, 16, 0, 33,200, 45, 0, 96, 5, 57, 39, 35,112, 47, 3 /* 0x09a0 */
.byte 254,255,209, 37, 64,104, 22, 0, 33, 96, 45, 2, 32, 0,172,175 /* 0x09b0 */
.byte 0, 1, 12, 60, 43,192,108, 0, 42, 0, 0, 19, 36, 0,182,175 /* 0x09c0 */
.byte 34, 0, 0, 16, 0, 0, 0, 0,251,255, 21, 39, 0, 1, 25, 60 /* 0x09d0 */
.byte 43,104,121, 0, 7, 0,160, 17, 0, 0, 0, 0,101, 0,115, 17 /* 0x09e0 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,110,145, 0,194, 2, 0 /* 0x09f0 */
.byte 37, 16, 14, 3, 66, 24, 3, 0, 43,104, 67, 0, 3, 0,160, 21 /* 0x0a00 */
.byte 64,128, 16, 0, 35, 16, 67, 0, 1, 0, 16, 54,255,255,181, 38 /* 0x0a10 */
.byte 240,255,160, 22, 43,104,121, 0, 0,129, 16, 0, 44, 0,161,143 /* 0x0a20 */
.byte 4, 0, 21, 52, 68, 6, 49, 36, 1, 0, 22, 52, 36, 0,182,175 /* 0x0a30 */
.byte 64,104, 22, 0, 33, 96, 45, 2, 32, 0,172,175, 0, 1, 12, 60 /* 0x0a40 */
.byte 43,192,108, 0, 7, 0, 0, 19, 0, 0, 0, 0, 73, 0,115, 17 /* 0x0a50 */
.byte 0, 26, 3, 0, 1, 0,107, 37,255,255,121,145, 0,114, 2, 0 /* 0x0a60 */
.byte 37, 16,217, 1, 32, 0,164,143,194,194, 3, 0, 0, 0,132,148 /* 0x0a70 */
.byte 32, 0,161,143, 24, 0, 4, 3, 18, 48, 0, 0, 43,120, 70, 0 /* 0x0a80 */
.byte 14, 0,224, 17,255,255,181, 38, 0, 8, 13, 52, 35,112,164, 1 /* 0x0a90 */
.byte 67,201, 14, 0, 33, 32,153, 0, 0, 0, 36,164, 36, 0,161,143 /* 0x0aa0 */
.byte 64,176, 22, 0, 64, 96, 1, 0, 36, 0,172,175,224,255,160, 22 /* 0x0ab0 */
.byte 33, 24,192, 0, 16, 0, 0, 16, 1, 0, 16, 38, 35, 16, 70, 0 /* 0x0ac0 */
.byte 36, 0,172,143, 67,193, 4, 0, 37,128, 12, 2, 64, 96, 12, 0 /* 0x0ad0 */
.byte 36, 0,172,175, 35, 32,152, 0, 0, 0, 36,164, 1, 0,182, 37 /* 0x0ae0 */
.byte 211,255,160, 22, 35, 24,102, 0, 3, 0, 0, 16, 1, 0, 16, 38 /* 0x0af0 */
.byte 33,128,192, 2, 1, 0, 16, 38, 6, 0, 0, 22, 0, 1, 25, 60 /* 0x0b00 */
.byte 43,192,121, 0, 39, 0, 0, 19, 35,192,101, 1, 23, 0, 0, 16 /* 0x0b10 */
.byte 0, 0, 0, 0, 43,104,144, 2, 22, 0,160, 21, 2, 0, 82, 38 /* 0x0b20 */
.byte 35,200,144, 2, 33,200, 25, 1,255,255, 82, 38, 0, 0, 53,147 /* 0x0b30 */
.byte 33,192, 20, 1, 0, 0, 21,163, 1, 0,148, 38, 4, 0, 64, 18 /* 0x0b40 */
.byte 1, 0, 57, 39, 43,112,137, 2,248,255,192, 21,255,255, 82, 38 /* 0x0b50 */
.byte 43,104,137, 2, 97,253,160, 21, 64,121, 30, 0, 0, 1, 25, 60 /* 0x0b60 */
.byte 43,192,121, 0, 15, 0, 0, 19, 35,192,101, 1, 12, 0,115, 21 /* 0x0b70 */
.byte 1, 0,107, 37, 0, 0,176,143, 4, 0,177,143, 8, 0,178,143 /* 0x0b80 */
.byte 12, 0,179,143, 16, 0,180,143, 20, 0,181,143, 24, 0,182,143 /* 0x0b90 */
.byte 28, 0,190,143, 1, 0, 2, 52, 8, 0,224, 3,104, 0,189, 39 /* 0x0ba0 */
.byte 35,192,101, 1, 0, 0,248,172, 0, 0, 84,173, 0, 0,176,143 /* 0x0bb0 */
.byte 4, 0,177,143, 8, 0,178,143, 12, 0,179,143, 16, 0,180,143 /* 0x0bc0 */
.byte 20, 0,181,143, 24, 0,182,143, 28, 0,190,143, 33, 16, 0, 0 /* 0x0bd0 */
.byte 8, 0,224, 3,104, 0,189, 39 /* 0x0be0 */
@@ -0,0 +1,166 @@
.byte 184,255,189, 39, 60, 0,167,175, 0, 0,176,175, 33,128, 0, 1 /* 0x0000 */
.byte 64, 0,169,175, 33, 88, 0, 0, 33,192,192, 0, 33, 48, 0, 0 /* 0x0010 */
.byte 68, 0,170,175, 33, 96, 64, 1, 33, 80, 0, 0, 1, 0, 14, 52 /* 0x0020 */
.byte 33, 24,128, 0, 33, 32,192, 1, 24, 0,182,175, 33,176,160, 0 /* 0x0030 */
.byte 4, 0,177,175, 20, 0,181,175, 28, 0,190,175, 16, 0,180,175 /* 0x0040 */
.byte 12, 0,179,175, 8, 0,178,175, 2, 0, 98,144, 4, 0,101, 36 /* 0x0050 */
.byte 4, 16, 78, 0,255,255, 77, 36, 1, 0, 98,144, 0, 0,116,144 /* 0x0060 */
.byte 0, 0,224,172, 0, 0,128,173, 1, 0, 99,144, 44, 0,173,175 /* 0x0070 */
.byte 33, 24,131, 2, 4, 16, 78, 0,255,255, 77, 36, 0, 3, 2, 52 /* 0x0080 */
.byte 4, 24, 98, 0, 54, 7, 98, 36, 33, 24, 0, 0, 33,168,128, 0 /* 0x0090 */
.byte 48, 0,173,175, 5, 0, 1, 4, 33,136,128, 0, 33,200,185, 0 /* 0x00a0 */
.byte 0, 4, 15, 52, 0, 0, 47,167, 1, 0, 99, 36, 43,200, 98, 0 /* 0x00b0 */
.byte 250,255, 32, 23, 64,200, 3, 0, 33,200,192, 2, 33, 16, 0, 0 /* 0x00c0 */
.byte 255,255, 3, 36, 33, 72,216, 2, 33,192, 0, 0, 76, 2, 41, 19 /* 0x00d0 */
.byte 1, 0, 24, 39, 0, 0, 47,147, 0, 18, 2, 0, 37, 16, 79, 0 /* 0x00e0 */
.byte 5, 0, 15, 43,249,255,224, 21, 1, 0, 57, 39, 57, 2, 1, 4 /* 0x00f0 */
.byte 0, 0, 0, 0, 44, 0,173,143, 33,192,184, 0, 36,144,109, 1 /* 0x0100 */
.byte 64,120, 18, 0, 33,152, 15, 3, 0, 1, 24, 60, 43,192,120, 0 /* 0x0110 */
.byte 7, 0, 0, 19, 33,120, 96, 2, 57, 2, 41, 19, 0, 26, 3, 0 /* 0x0120 */
.byte 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0 /* 0x0130 */
.byte 0, 0,231,149,194,194, 3, 0, 24, 0, 7, 3, 18,192, 0, 0 /* 0x0140 */
.byte 43, 64, 88, 0,116, 0, 0, 17, 35, 24,120, 0, 33, 24, 0, 3 /* 0x0150 */
.byte 48, 0,173,143, 0, 8, 24, 52, 35,192, 7, 3, 67,193, 24, 0 /* 0x0160 */
.byte 33, 56,248, 0, 36,192,109, 1, 4,192,152, 2, 0, 0,231,165 /* 0x0170 */
.byte 8, 0, 15, 52, 35,120,244, 1, 7,120,230, 1, 33,192, 15, 3 /* 0x0180 */
.byte 0, 6, 15, 52, 24, 0, 15, 3, 18,192, 0, 0, 33,192,184, 0 /* 0x0190 */
.byte 108, 14, 15, 39, 7, 0, 88, 41, 79, 0, 0, 23, 1, 0, 8, 52 /* 0x01a0 */
.byte 35,192,110, 1, 33,192, 24, 2, 0, 0, 6,147, 0, 0, 0, 0 /* 0x01b0 */
.byte 64, 48, 6, 0, 0, 1,210, 48, 33,192, 72, 2, 64,192, 24, 0 /* 0x01c0 */
.byte 33,192,248, 1, 0, 2, 19, 39, 0, 1, 24, 60, 43,192,120, 0 /* 0x01d0 */
.byte 7, 0, 0, 19, 0, 0, 0, 0, 9, 2, 41, 19, 0, 26, 3, 0 /* 0x01e0 */
.byte 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0 /* 0x01f0 */
.byte 0, 0,103,150,194,194, 3, 0, 24, 0, 7, 3, 18,192, 0, 0 /* 0x0200 */
.byte 43,240, 88, 0, 10, 0,192, 19, 64, 64, 8, 0, 33, 24, 0, 3 /* 0x0210 */
.byte 0, 8, 24, 52, 35,192, 7, 3, 67,193, 24, 0, 33, 56,248, 0 /* 0x0220 */
.byte 10, 0, 64, 18, 0, 0,103,166, 43, 0, 1, 4, 0, 0, 0, 0 /* 0x0230 */
.byte 1, 0, 8, 37, 35, 24,120, 0, 35, 16, 88, 0, 67,193, 7, 0 /* 0x0240 */
.byte 35, 56,248, 0, 36, 0, 64, 18, 0, 0,103,166, 0, 1, 24, 41 /* 0x0250 */
.byte 215,255, 0, 23, 0, 0, 0, 0, 31, 0, 1, 4, 0, 0, 0, 0 /* 0x0260 */
.byte 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19, 33, 48,242, 1 /* 0x0270 */
.byte 227, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147 /* 0x0280 */
.byte 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,199,148,194,194, 3, 0 /* 0x0290 */
.byte 24, 0, 7, 3, 18,192, 0, 0, 43,152, 88, 0, 8, 0, 96, 18 /* 0x02a0 */
.byte 64, 64, 8, 0, 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 7, 3 /* 0x02b0 */
.byte 67,193, 24, 0, 33, 56,248, 0, 7, 0, 1, 4, 0, 0,199,164 /* 0x02c0 */
.byte 35, 24,120, 0, 35, 16, 88, 0, 67,193, 7, 0, 35, 56,248, 0 /* 0x02d0 */
.byte 0, 0,199,164, 1, 0, 72, 38, 0, 1, 24, 41,224,255, 0, 23 /* 0x02e0 */
.byte 64,144, 8, 0, 33,192, 11, 2,255, 0, 6, 49, 0, 0, 6,163 /* 0x02f0 */
.byte 4, 0, 88, 41, 3, 0, 0, 19, 1, 0,107, 37,181, 1, 1, 4 /* 0x0300 */
.byte 33, 80, 0, 0, 10, 0, 88, 41,178, 1, 0, 23,253,255, 74, 37 /* 0x0310 */
.byte 176, 1, 1, 4,253,255, 74, 37, 35, 16, 88, 0, 67,193, 7, 0 /* 0x0320 */
.byte 35, 56,248, 0, 0, 0,231,165, 64,192, 10, 0, 33, 56,184, 0 /* 0x0330 */
.byte 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19,128, 1,239, 36 /* 0x0340 */
.byte 175, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147 /* 0x0350 */
.byte 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,232,149,194,194, 3, 0 /* 0x0360 */
.byte 24, 0, 8, 3, 18,192, 0, 0, 43, 48, 88, 0, 17, 0,192, 16 /* 0x0370 */
.byte 35, 24,120, 0, 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 8, 3 /* 0x0380 */
.byte 67,193, 24, 0, 33, 64, 24, 1, 3, 0, 24, 52, 33,168, 32, 2 /* 0x0390 */
.byte 33,136,128, 0, 0, 0,232,165, 7, 0, 79, 41, 2, 0,224, 17 /* 0x03a0 */
.byte 33, 32,192, 1, 33,192, 0, 0, 33, 80, 0, 3,141, 0, 1, 4 /* 0x03b0 */
.byte 100, 6, 24, 52, 35, 16, 88, 0, 67,193, 8, 0, 35, 64, 24, 1 /* 0x03c0 */
.byte 0, 0,232,165, 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19 /* 0x03d0 */
.byte 152, 1,239, 36,138, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39 /* 0x03e0 */
.byte 255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,232,149 /* 0x03f0 */
.byte 194,194, 3, 0, 24, 0, 8, 3, 18,192, 0, 0, 43, 48, 88, 0 /* 0x0400 */
.byte 47, 0,192, 16, 35, 24,120, 0, 33, 24, 0, 3, 0, 8, 24, 52 /* 0x0410 */
.byte 35,192, 8, 3, 67,193, 24, 0, 33, 64, 24, 1, 0, 0,232,165 /* 0x0420 */
.byte 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19,224, 1,111, 38 /* 0x0430 */
.byte 115, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147 /* 0x0440 */
.byte 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,232,149,194,194, 3, 0 /* 0x0450 */
.byte 24, 0, 8, 3, 18,192, 0, 0, 43, 56, 88, 0, 20, 0,224, 16 /* 0x0460 */
.byte 35, 24,120, 0, 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 8, 3 /* 0x0470 */
.byte 67,193, 24, 0, 33, 64, 24, 1, 97, 1, 96, 17, 0, 0,232,165 /* 0x0480 */
.byte 7, 0, 79, 41, 2, 0,224, 17, 11, 0, 24, 52, 9, 0, 24, 52 /* 0x0490 */
.byte 33, 80, 0, 3, 35,192,110, 1, 33,192, 24, 2, 0, 0, 6,147 /* 0x04a0 */
.byte 33,192, 11, 2, 0, 0, 6,163, 74, 1, 1, 4, 1, 0,107, 37 /* 0x04b0 */
.byte 35, 16, 88, 0, 67,193, 8, 0, 67, 0, 1, 4, 35, 64, 24, 1 /* 0x04c0 */
.byte 35, 16, 88, 0, 67,193, 8, 0, 35, 64, 24, 1, 0, 0,232,165 /* 0x04d0 */
.byte 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19,176, 1,239, 36 /* 0x04e0 */
.byte 71, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147 /* 0x04f0 */
.byte 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,232,149,194,194, 3, 0 /* 0x0500 */
.byte 24, 0, 8, 3, 18,192, 0, 0, 43, 48, 88, 0, 9, 0,192, 16 /* 0x0510 */
.byte 35, 24,120, 0, 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 8, 3 /* 0x0520 */
.byte 67,193, 24, 0, 33, 64, 24, 1, 33,192,128, 0, 35, 0, 1, 4 /* 0x0530 */
.byte 255,255, 8, 49, 35, 16, 88, 0, 67,193, 8, 0, 35, 64, 24, 1 /* 0x0540 */
.byte 0, 0,232,165, 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19 /* 0x0550 */
.byte 200, 1,239, 36, 42, 1, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39 /* 0x0560 */
.byte 255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0, 0, 0,232,149 /* 0x0570 */
.byte 194,194, 3, 0, 24, 0, 8, 3, 18,192, 0, 0, 43, 56, 88, 0 /* 0x0580 */
.byte 8, 0,224, 16, 35, 24,120, 0, 33, 24, 0, 3, 0, 8, 24, 52 /* 0x0590 */
.byte 35,192, 8, 3, 67,193, 24, 0, 33, 64, 24, 1, 6, 0, 1, 4 /* 0x05a0 */
.byte 33,192, 32, 2, 35, 16, 88, 0, 67,193, 8, 0, 35, 64, 24, 1 /* 0x05b0 */
.byte 33,192,160, 2, 33,168, 32, 2, 33,136,128, 0,255,255, 8, 49 /* 0x05c0 */
.byte 33, 32,192, 1, 33,112, 0, 3, 0, 0,232,165, 7, 0, 79, 41 /* 0x05d0 */
.byte 2, 0,224, 17, 11, 0, 24, 52, 8, 0, 24, 52, 33, 80, 0, 3 /* 0x05e0 */
.byte 104, 10, 24, 52, 33,120,184, 0, 0, 1, 24, 60, 43,192,120, 0 /* 0x05f0 */
.byte 7, 0, 0, 19, 33, 56,224, 1, 1, 1, 41, 19, 0, 26, 3, 0 /* 0x0600 */
.byte 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0 /* 0x0610 */
.byte 0, 0,232,148,194,194, 3, 0, 24, 0, 8, 3, 18,192, 0, 0 /* 0x0620 */
.byte 43, 48, 88, 0, 13, 0,192, 16, 35, 24,120, 0, 33, 24, 0, 3 /* 0x0630 */
.byte 0, 8, 24, 52, 35,192, 8, 3, 67,193, 24, 0, 33, 64, 24, 1 /* 0x0640 */
.byte 0, 0,232,164, 0,193, 18, 0, 33,192,248, 1, 4, 0, 7, 39 /* 0x0650 */
.byte 33,144, 0, 0, 40, 0, 1, 4, 3, 0, 6, 52, 35, 16, 88, 0 /* 0x0660 */
.byte 67,193, 8, 0, 35, 64, 24, 1, 0, 0,232,164, 0, 1, 24, 60 /* 0x0670 */
.byte 43,192,120, 0, 7, 0, 0, 19, 2, 0,231, 37,224, 0, 41, 19 /* 0x0680 */
.byte 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0 /* 0x0690 */
.byte 37, 16, 88, 0, 0, 0,232,148,194,194, 3, 0, 24, 0, 8, 3 /* 0x06a0 */
.byte 18,192, 0, 0, 43, 48, 88, 0, 12, 0,192, 16, 35, 24,120, 0 /* 0x06b0 */
.byte 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 8, 3, 67,193, 24, 0 /* 0x06c0 */
.byte 33, 64, 24, 1, 0,193, 18, 0, 8, 0, 18, 52, 0, 0,232,164 /* 0x06d0 */
.byte 33,192,248, 1,223,255, 1, 4, 4, 1, 7, 39, 35, 16, 88, 0 /* 0x06e0 */
.byte 67,193, 8, 0, 35, 64, 24, 1, 0, 0,232,164, 4, 2,231, 37 /* 0x06f0 */
.byte 16, 0, 18, 52, 8, 0, 6, 52, 33,152,192, 0, 1, 0, 8, 52 /* 0x0700 */
.byte 64,104, 8, 0, 33,240,237, 0, 0, 1, 24, 60, 43,192,120, 0 /* 0x0710 */
.byte 7, 0, 0, 19, 36, 0,173,175,185, 0, 41, 19, 0, 26, 3, 0 /* 0x0720 */
.byte 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0 /* 0x0730 */
.byte 0, 0,207,151,194,194, 3, 0, 24, 0, 15, 3, 18,192, 0, 0 /* 0x0740 */
.byte 43,104, 88, 0, 7, 0,160, 17, 64, 64, 8, 0, 33, 24, 0, 3 /* 0x0750 */
.byte 0, 8, 24, 52, 35,192, 15, 3, 67,193, 24, 0, 7, 0, 1, 4 /* 0x0760 */
.byte 33,120,248, 1, 35, 24,120, 0, 35, 16, 88, 0, 67,193, 15, 0 /* 0x0770 */
.byte 36, 0,172,143, 35,120,248, 1, 1, 0,136, 37,255,255,115, 38 /* 0x0780 */
.byte 223,255, 96, 22, 0, 0,207,167, 1, 0, 24, 52, 4,192,216, 0 /* 0x0790 */
.byte 35, 64, 24, 1, 4, 0, 88, 41,126, 0, 0, 19, 33, 64, 18, 1 /* 0x07a0 */
.byte 3, 0, 24, 52, 4, 0, 15, 41, 2, 0,224, 17, 7, 0, 74, 37 /* 0x07b0 */
.byte 33,192, 0, 1,192,193, 24, 0, 33,192,184, 0, 96, 3, 15, 39 /* 0x07c0 */
.byte 6, 0, 6, 52, 1, 0, 7, 52, 64,152, 7, 0, 0, 1, 24, 60 /* 0x07d0 */
.byte 43,192,120, 0, 7, 0, 0, 19, 33,144,243, 1,136, 0, 41, 19 /* 0x07e0 */
.byte 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0 /* 0x07f0 */
.byte 37, 16, 88, 0, 0, 0, 78,150,194,194, 3, 0, 24, 0, 14, 3 /* 0x0800 */
.byte 18,192, 0, 0, 43,240, 88, 0, 7, 0,192, 19, 64, 56, 7, 0 /* 0x0810 */
.byte 33, 24, 0, 3, 0, 8, 24, 52, 35,192, 14, 3, 67,193, 24, 0 /* 0x0820 */
.byte 6, 0, 1, 4, 33,112,216, 1, 35, 24,120, 0, 35, 16, 88, 0 /* 0x0830 */
.byte 67,193, 14, 0, 35,112,216, 1, 1, 0,103, 38,255,255,198, 36 /* 0x0840 */
.byte 225,255,192, 20, 0, 0, 78,166,192,255,231, 36, 4, 0,248, 40 /* 0x0850 */
.byte 77, 0, 0, 23, 67,192, 7, 0, 1, 0,239, 48, 2, 0,238, 53 /* 0x0860 */
.byte 14, 0,239, 40, 9, 0,224, 17,255,255, 6, 39, 4,112,206, 0 /* 0x0870 */
.byte 64,192, 14, 0, 33,192,184, 0, 96, 5, 24, 39, 64,120, 7, 0 /* 0x0880 */
.byte 35,192, 15, 3, 24, 0, 1, 4,254,255, 15, 39,251,255, 6, 39 /* 0x0890 */
.byte 0, 1, 24, 60, 43,192,120, 0, 7, 0, 0, 19, 0, 0, 0, 0 /* 0x08a0 */
.byte 87, 0, 41, 19, 0, 26, 3, 0, 1, 0, 57, 39,255,255, 56,147 /* 0x08b0 */
.byte 0, 18, 2, 0, 37, 16, 88, 0, 66, 24, 3, 0, 43,192, 67, 0 /* 0x08c0 */
.byte 3, 0, 0, 23, 64,112, 14, 0, 35, 16, 67, 0, 1, 0,206, 53 /* 0x08d0 */
.byte 255,255,198, 36,239,255,192, 20, 0, 1, 24, 60, 68, 6,175, 36 /* 0x08e0 */
.byte 0,113, 14, 0, 4, 0, 6, 52, 1, 0, 18, 52, 33,152, 64, 2 /* 0x08f0 */
.byte 64,104, 19, 0, 33,240,237, 1, 0, 1, 24, 60, 43,192,120, 0 /* 0x0900 */
.byte 7, 0, 0, 19, 40, 0,173,175, 61, 0, 41, 19, 0, 26, 3, 0 /* 0x0910 */
.byte 1, 0, 57, 39,255,255, 56,147, 0, 18, 2, 0, 37, 16, 88, 0 /* 0x0920 */
.byte 0, 0,199,151,194,194, 3, 0, 24, 0, 7, 3, 18,192, 0, 0 /* 0x0930 */
.byte 43,104, 88, 0, 7, 0,160, 17, 64,152, 19, 0, 33, 24, 0, 3 /* 0x0940 */
.byte 0, 8, 24, 52, 35,192, 7, 3, 67,193, 24, 0, 8, 0, 1, 4 /* 0x0950 */
.byte 33, 56,248, 0, 35, 24,120, 0, 35, 16, 88, 0, 67,193, 7, 0 /* 0x0960 */
.byte 40, 0,172,143, 35, 56,248, 0, 1, 0,147, 37, 37,112,210, 1 /* 0x0970 */
.byte 64,144, 18, 0,255,255,198, 36,221,255,192, 20, 0, 0,199,167 /* 0x0980 */
.byte 3, 0, 1, 4, 1, 0,206, 37, 33,112,224, 0, 1, 0,206, 37 /* 0x0990 */
.byte 21, 0,192, 17, 43,192,110, 1, 25, 0, 0, 23, 2, 0, 8, 37 /* 0x09a0 */
.byte 35,192,110, 1, 33,192, 24, 2, 0, 0, 6,147, 33,192, 11, 2 /* 0x09b0 */
.byte 0, 0, 6,163,255,255, 8, 37, 6, 0, 0, 17, 1, 0,107, 37 /* 0x09c0 */
.byte 64, 0,173,143, 0, 0, 0, 0, 43,192,109, 1,245,255, 0, 23 /* 0x09d0 */
.byte 35,192,110, 1, 64, 0,173,143, 0, 0, 0, 0, 43,192,109, 1 /* 0x09e0 */
.byte 196,253, 0, 23, 64,193, 10, 0, 0, 1, 2, 60, 43, 24, 98, 0 /* 0x09f0 */
.byte 5, 0, 96, 16, 0, 0, 0, 0, 3, 0, 41, 23, 1, 0, 57, 39 /* 0x0a00 */
.byte 7, 0, 1, 4, 1, 0, 2, 52, 60, 0,172,143, 35, 24, 54, 3 /* 0x0a10 */
.byte 0, 0,131,173, 68, 0,172,143, 33, 16, 0, 0, 0, 0,139,173 /* 0x0a20 */
.byte 0, 0,176,143, 4, 0,177,143, 8, 0,178,143, 12, 0,179,143 /* 0x0a30 */
.byte 16, 0,180,143, 20, 0,181,143, 24, 0,182,143, 28, 0,190,143 /* 0x0a40 */
.byte 8, 0,224, 3, 72, 0,189, 39 /* 0x0a50 */
+18 -2
View File
@@ -29,6 +29,7 @@
.macro section name .macro section name
.section \name .section \name
.align 0
.endm .endm
#define zero $0 #define zero $0
@@ -48,7 +49,22 @@
#define t6 $14 #define t6 $14
#define t7 $15 #define t7 $15
#define s0 $16 #define s0 $16
#define s1 $17
#define s2 $18
#define s3 $19
#define s4 $20
#define s5 $21
#define s6 $22
#define s7 $23
#define t8 $24
#define t9 $25
#define jp $25
#define k0 $26
#define k1 $27
#define gp $28
#define sp $29 #define sp $29
#define fp $30
#define s8 $30
#define ra $31 #define ra $31
#define IF .if #define IF .if
@@ -59,7 +75,7 @@
#define DB .byte #define DB .byte
.macro subiu reg, p1, p2 .macro subiu reg, p1, p2
.ifnb p2 .ifnb p2
addiu \reg, p1, -p2 addiu \reg, p1, -p2
.else .else
@@ -69,7 +85,7 @@
.endm .endm
#ifndef DEBUG #ifndef DEBUG
# define PRINT(str) # define PRINT(str)
#else #else
# define PRINT(str) .print str # define PRINT(str) .print str
#endif #endif
+135 -116
View File
@@ -1,5 +1,5 @@
/* /*
; l_ps1.asm -- ps1/exe program entry & decompressor ; mipsel.r3000-ps1.asm -- ps1/exe program entry & decompressor
; ;
; This file is part of the UPX executable compressor. ; This file is part of the UPX executable compressor.
; ;
@@ -46,8 +46,52 @@
============= =============
*/ */
.macro SysFlushCache .if (PS1)
SZ_REG = 4
.else
SZ_REG = 8
.endif
.macro mCDBOOT s
.if (\s == 1)
REG_SZ = (5*SZ_REG)
CDBOOT = 1
.else
REG_SZ = (6*SZ_REG)
CDBOOT = 0
.endif
.endm
.macro regs _w, ok
\_w pc,SZ_REG*0(sp)
\_w src,SZ_REG*1(sp)
\_w cnt,SZ_REG*2(sp)
\_w a3,SZ_REG*3(sp)
\_w ra,SZ_REG*4(sp)
REG_SZ = (5*SZ_REG)
.if (\ok == 1)
\_w tmp,SZ_REG*5(sp)
REG_SZ = (6*SZ_REG)
.endif
.endm
.macro push ok = 0
.if (PS1)
regs sw,\ok
.else
regs sd,\ok
.endif
.endm
.macro pop ok = 0
.if (PS1)
regs lw,\ok
.else
regs ld,\ok
.endif
.endm
.macro SysFlushCache
.if (PS1) .if (PS1)
PRINT ("SYSCALL PS1") PRINT ("SYSCALL PS1")
li t2,160 li t2,160
@@ -55,92 +99,71 @@
li t1,68 li t1,68
.else .else
PRINT ("SYSCALL PS2") PRINT ("SYSCALL PS2")
move a0, zero move a0, zero
li v1, 100 li v1, 100
syscall syscall
.endif .endif
.endm .endm
.macro regs _w, marker
.if (PS1) #define CLzmaDecoderState a0 /* CLzmaDecoderState */
SZ_REG = 4 #define inStream a1
.else #define inSize a2
SZ_REG = 8 #define pinSizeprocessed a3 /* inSizeprocessed */
.endif
.if (CDBOOT == 1) #define outStream t0
REG_SZ = (4*SZ_REG) #define outSize t1
.else #define poutSizeProcessed t2
REG_SZ = (5*SZ_REG)
.endif
\_w src,SZ_REG*0(sp) #define dst_save 0*SZ_REG
\_w dst,SZ_REG*1(sp) #define outSizeProcessed 1*SZ_REG
\_w pc,SZ_REG*2(sp) #define inSizeProcessed 2*SZ_REG
\_w ra,SZ_REG*3(sp)
.if (CDBOOT == 0)
\_w tmp,SZ_REG*4(sp)
.endif
.if (\marker != 0)
DW \marker
.if (CDBOOT == 0)
addu sp,tmp
.else
addiu sp,REG_SZ
.endif
.endif
.endm
.macro push jmp
.if (PS1)
regs sw,\jmp
.else
regs sd,\jmp
.endif
.endm
.macro pop jmp
.if (PS1)
regs lw,\jmp
.else
regs ld,\jmp
.endif
.endm
lzma_args_sz = 4*SZ_REG
/* /*
============= =============
============= ENTRY POINT cd-boot ============= ENTRY POINT cd-boot
============= =============
*/ */
CDBOOT = 1 mCDBOOT 1
section ps1.cdb.start section cdb.start
la t0,PSVR // prepare to compute value la t0,PSVR // prepare to compute value
subu t0,s0,t0 // get stored header offset in mem subu t0,s0,t0 // get stored header offset in mem
jr t0 jr t0
subiu sp,REG_SZ // prep to adjust stack subiu sp,REG_SZ // prep to adjust stack
section ps1.cdb.entry section cdb.entry
push 0 // push used regs push // push used regs
la src,CPDO // load compressed data offset la src,CPDO // load compressed data offset
section ps1.cdb.nrv.ptr section cdb.start.lzma
la dst,DECO // load decompressed data offset la t0,PSVR // prepare to compute value
subu t0,s0,t0 // get stored header offset in mem
li tmp,%lo(LS+REG_SZ) // size of decomp. routine
jr t0
subu sp,tmp // adjust the stack with this size
section ps1.cdb.nrv.ptr.hi section cdb.entry.lzma
push 1 // push used regs
addiu src,t0,lzma_cpr // load compressed data offset
addiu dst,sp,REG_SZ
section cdb.lzma.cpr
la src,CPDO // load compressed data offset
section cdb.dec.ptr
la dst,DECO // load decompress data offset
section cdb.dec.ptr.hi
lui dst,%hi(DECO) lui dst,%hi(DECO)
section ps1.cdb.exit section cdb.exit
SysFlushCache SysFlushCache
pop JPEP // pop used regs with marker for entry pop // pop used regs with marker for entry
j entry
addiu sp,REG_SZ
/* /*
@@ -149,66 +172,62 @@ section ps1.cdb.exit
============= =============
*/ */
CDBOOT = 0 mCDBOOT 0
section ps1.con.start section con.start
li tmp,%lo(LS) // size of decomp. routine li tmp,%lo(LS+REG_SZ) // size of decomp. routine
subu sp,tmp // adjust the stack with this size subu sp,tmp // adjust the stack with this size
push 0 // push used regs push 1 // push used regs
subiu cnt,tmp,REG_SZ // cnt = counter copyloop subiu cnt,tmp,REG_SZ // cnt = counter copyloop
addiu pc,sp,REG_SZ // get offset for decomp. routine addiu pc,sp,REG_SZ // get offset for decomp. routine
move dst,pc move dst,pc
la src,DCRT // load decompression routine's offset la src,DCRT // load decompression routine's offset
1:
lw tmp,0(src) // memcpy *a0 -> tmp -> *a1 section con.mcpy
1: lw var,0(src) // memcpy
subiu cnt,4 subiu cnt,4
sw tmp,0(dst) sw var,0(dst)
addiu src,4 addiu src,4
bnez cnt,1b bnez cnt,1b
addiu dst,4 addiu dst,4
section ps1.con.padcd section lzma.prep
addiu src,PC // a0 = pointer compressed data addiu pc,dst,%lo(lzma_init_off)
section ps1.con.nrv.ptr section con.padcd
lui dst,%hi(DECO) // load DECOMPDATA HI offset addiu src,%lo(PAD) // pointer compressed data
section dec.ptr
lui dst,%hi(DECO) // load decompress data offset
jr pc jr pc
addiu dst,%lo(DECO) // load DECOMPDATA LO offset addiu dst,%lo(DECO)
section ps1.con.nrv.ptr.hi section dec.ptr.hi
jr pc jr pc
lui dst,%hi(DECO) // same for HI only !(offset&0xffff) lui dst,%hi(DECO)
section ps1.con.entry section con.entry
section ps1.con.exit section con.exit
SysFlushCache SysFlushCache
pop JPEP // pop used regs with marker for entry pop 1 // pop used regs with marker for entry
j entry
section ps1.con.regs addu sp,tmp
DW REG_SZ
// ============= // =============
section ps1.mset.short section memset.short
li cnt,%lo(SC) // amount of removed zero's at eof li cnt,%lo(SC) // amount of removed zero's at eof
1: sw zero,0(dst)
section ps1.mset.long
li cnt,%lo(SC) // amount of removed zero's at eof
sll cnt,3 // (cd mode 2 data sector alignment)
section ps1.mset.aligned
1:
sw zero,0(dst)
subiu cnt,1 subiu cnt,1
bnez cnt,1b bnez cnt,1b
addiu dst,4 addiu dst,4
section ps1.mset.unaligned section memset.long
1: li cnt,%lo(SC) // amount of removed zero's at eof
swl zero,3(dst) sll cnt,3 // (cd mode 2 data sector alignment)
swr zero,0(dst) 1: sw zero,0(dst)
subiu cnt,1 subiu cnt,1
bnez cnt,1b bnez cnt,1b
addiu dst,4 addiu dst,4
@@ -227,43 +246,43 @@ section ps1.mset.unaligned
// ========== cd-boot // ========== cd-boot
UCL_init 8,0,1 UCL_init 8,0,1
section ps1.cdb.nrv2b.8bit section nrv2b.8bit
build full, nrv2b build full, nrv2b
section ps1.cdb.nrv2d.8bit section nrv2d.8bit
build full, nrv2d build full, nrv2d
section ps1.cdb.nrv2e.8bit section nrv2e.8bit
build full, nrv2e build full, nrv2e
UCL_init 32,0,1 UCL_init 32,0,1
section ps1.cdb.nrv2b.32bit section nrv2b.32bit
build full, nrv2b build full, nrv2b
section ps1.cdb.nrv2d.32bit section nrv2d.32bit
build full, nrv2d build full, nrv2d
section ps1.cdb.nrv2e.32bit section nrv2e.32bit
build full, nrv2e build full, nrv2e
// ========== console-run // ========== console-run
UCL_init 8,1,0 UCL_init 8,1,0
section ps1.getbit.8bit.sub section gb.8bit.sub
build sub_only build sub_only
section ps1.getbit.8bit.size
DW sub_size
UCL_init 32,1,0 UCL_init 32,1,0
section ps1.getbit.32bit.sub section gb.32bit.sub
build sub_only build sub_only
section ps1.getbit.32bit.size
DW sub_size
section ps1.small.nrv2b section nrv2b.small
build without_sub, nrv2b build without_sub, nrv2b
section ps1.small.nrv2d section nrv2d.small
build without_sub, nrv2d build without_sub, nrv2d
section ps1.small.nrv2e section nrv2e.small
build without_sub, nrv2e build without_sub, nrv2e
section nrv.small.done
decomp_done:
#include "arch/mips/mipsel.r3000/lzma_d.S"
#include "include/header2.ash" #include "include/header2.ash"