This commit is contained in:
John Reiser 2007-02-16 08:06:37 -08:00
commit c346f8f17d
23 changed files with 8862 additions and 8290 deletions

View File

@ -553,23 +553,28 @@ static int do_option(int optc, const char *arg)
// method
case 702:
opt->method_nrv2b_seen = true;
if (!set_method(M_NRV2B_LE32, -1))
e_method(M_NRV2B_LE32, opt->level);
break;
case 704:
opt->method_nrv2d_seen = true;
if (!set_method(M_NRV2D_LE32, -1))
e_method(M_NRV2D_LE32, opt->level);
break;
case 705:
opt->method_nrv2e_seen = true;
if (!set_method(M_NRV2E_LE32, -1))
e_method(M_NRV2E_LE32, opt->level);
break;
case 721:
opt->method_lzma_seen = true;
opt->all_methods_use_lzma = true;
if (!set_method(M_LZMA, -1))
e_method(M_LZMA, opt->level);
break;
case 722:
opt->method_lzma_seen = false;
opt->all_methods_use_lzma = false;
if (M_IS_LZMA(opt->method))
opt->method = -1;

View File

@ -47,6 +47,10 @@ struct options_t {
// compression options
int method;
bool method_lzma_seen;
bool method_nrv2b_seen;
bool method_nrv2d_seen;
bool method_nrv2e_seen;
int level; // compression level 1..10
int filter; // preferred filter from Packer::getFilters()
bool ultra_brute;

View File

@ -53,11 +53,16 @@ PackExe::PackExe(InputFile *f) :
bele = &N_BELE_RTP::le_policy;
COMPILE_TIME_ASSERT(sizeof(exe_header_t) == 32);
ih_exesize = ih_imagesize = ih_overlay = 0;
// disable lzma for "--brute" unless explicitly given "--lzma"
if (opt->all_methods_use_lzma && !opt->method_lzma_seen)
opt->all_methods_use_lzma = false;
}
const int *PackExe::getCompressionMethods(int method, int level) const
{
#if 0
static const int m_all[] = { M_NRV2B_8, M_NRV2D_8, M_NRV2E_8, M_END };
static const int m_nrv2b[] = { M_NRV2B_8, M_END };
static const int m_nrv2d[] = { M_NRV2D_8, M_END };
@ -68,11 +73,15 @@ const int *PackExe::getCompressionMethods(int method, int level) const
if (M_IS_NRV2B(method)) return m_nrv2b;
if (M_IS_NRV2D(method)) return m_nrv2d;
if (M_IS_NRV2E(method)) return m_nrv2e;
if (M_IS_LZMA(method)) return m_lzma;
if (M_IS_LZMA(method)) return m_lzma;
bool small = ih_imagesize <= 256*1024;
if (level == 1 || small)
return m_nrv2b;
return m_nrv2e;
#else
bool small = ih_imagesize <= 256*1024;
return Packer::getDefaultCompressionMethods_8(method, level, small);
#endif
}
@ -96,7 +105,9 @@ int PackExe::fillExeHeader(struct exe_header_t *eh) const
oh.ident = 'M' + 'Z' * 256;
oh.headsize16 = 2;
unsigned minsp = M_IS_LZMA(ph.method) ? getDecompressorWrkmemSize() + 0x1100 : 0x200;
unsigned minsp = 0x200;
if (M_IS_LZMA(ph.method))
minsp = getDecompressorWrkmemSize() + 0x1500; // FIXME ???
assert(minsp < 0xff00);
oh.sp = ih.sp > minsp ? (unsigned) ih.sp : minsp;
@ -170,7 +181,7 @@ void PackExe::buildLoader(const Filter *)
"NRV2EEX9",
NULL
);
else if (ph.method == M_LZMA)
else if M_IS_LZMA(ph.method)
addLoader("LZMA_DEC00,LZMA_DEC10,LZMA_DEC99,LZMA_DEC30",
ph.u_len > 0xffff ? "LZMA_DEC31" : "",
NULL
@ -439,9 +450,12 @@ void PackExe::pack(OutputFile *fo)
// compress (max_match = 8192)
upx_compress_config_t cconf; cconf.reset();
cconf.conf_ucl.max_match = MAXMATCH;
cconf.conf_lzma.max_num_probs = 1846 + (768 << 4); // ushort: ~28KB stack
compressWithFilters(&ft, 32, &cconf);
if (ph.max_run_found + ph.max_match_found > 0x8000)
throwCantPack("decompressor limit exceeded, send a bugreport");
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
if (ph.max_run_found + ph.max_match_found > 0x8000)
throwCantPack("decompressor limit exceeded, send a bugreport");
#ifdef TESTING
if (opt->debug.debug_level)

View File

@ -35,7 +35,7 @@
#ifdef WANT_MACH_HEADER_ENUM /*{*/
#undef WANT_MACH_HEADER_ENUM
enum { // magic
enum { // magic
MH_MAGIC = 0xfeedface
};
enum { // cputype

View File

@ -211,6 +211,7 @@ endef
# some common arch settings
tc.arch-i086.gcc = i386-linux-gcc-3.4.6 -m32 -march=i386 -nostdinc -MMD -MT $@
tc.arch-i086.wdis = $(WATCOM)/binl/wdis
tc.arch-i386.gcc = i386-linux-gcc-3.4.6 -m32 -march=i386 -nostdinc -MMD -MT $@
tc.arch-i386.djasm = djasm

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#
# highly experimental support for i086 using Open Watcom 1.6
# highly experimental support for i086 using Digital Mars C/C++
#
MAKEFLAGS += -rR
@ -32,69 +32,87 @@ include $(top_srcdir)/src/stub/Makefile
# // method-lzma
# ************************************************************************/
lzma_d_c% : tc_list = method-lzma default
lzma_d_c% : tc_list = method-lzma arch-i086 default
lzma_d_c% : tc_bfdname =
# Open Watcom C/C++ 1.6
c := tc.method-lzma.wcc
$c = $(WATCOM)/binl/wcc -zq -bt=dos
$c += -mc -ecc
$c += -zm -zc
$c += -os -s -0 -d0
$c += -w5 -we -fr=/dev/null
$c += -D__INT_MAX__=32767
# gcc
c := tc.arch-i086.gcc
$c += -MF /dev/null
$c += -Wall -W
$c += -I$(UPX_LZMADIR)
$c += -I$(top_srcdir)/src
tc.method-lzma.dmpobj = $(WATCOM)/binl/dmpobj
tc.method-lzma.wdis = $(WATCOM)/binl/wdis
tc.method-lzma.wdump = $(WATCOM)/binl/wdump
# Digital Mars C/C++ 8.49
# http://www.digitalmars.com/download/freecompiler.html
ifneq ($(wildcard $(DM849DIR)/bin/.),)
c := tc.method-lzma.dmc
$c = @$(WINEENV) CFLAGS='$(DMC)' wine cmd.exe /c tmp/dmc.bat
$c += -ms -R
$c += -NS
$c += -w- -w7 -r
DMC := -o -0
DMC += -D__INT_MAX__=32767
DMC += -I$(shell winepath -s z:$(realpath $(UPX_LZMADIR)))
DMC += -I$(shell winepath -s z:$(realpath $(top_srcdir)/src))
endif
TMP_DEPS = tmp/.tmp-stamp tmp/bcc.bat tmp/cl.bat tmp/dmc.bat
lzma_d_c%.S : lzma_d_c%.i cleanasm.py $(MAKEFILE_LIST)
python cleanasm.py --label-prefix=$(LABEL_PREFIX) $< $@
ifneq ($(wildcard $(UPX_LZMADIR)/C/7zip/.),)
ifneq ($(wildcard $(DM849DIR)/bin/.),)
ifneq ($(wildcard $(WATCOM)/binl/.),)
ifneq ($(wildcard $(VCLINK.exe)),)
ifneq ($(wildcard /usr/bin/wine),)
lzma_d_c%.i : lzma_d_c.c tmp/.tmp-stamp $(MAKEFILE_LIST)
lzma_d_c%.i : tmp/lzma_d_c%.i
cp $< $@
tmp/lzma_d_c%.i : lzma_d_c.c wdis2gas.py $(MAKEFILE_LIST) $(TMP_DEPS)
rm -f tmp/$T.a tmp/$T.o tmp/$T.obj
# compile
$(call tc,wcc) $(PP_FLAGS) -fo=tmp/$T.obj $<
## $(call tc,bcc) $(PP_FLAGS) -c -otmp/$T.obj $<
## $(call tc,dmc) $(PP_FLAGS) -c -otmp/$T.obj $<
## $(call tc,cl) $(PP_FLAGS) -c -Fotmp/$T.obj $<
$(call tc,wdis) tmp/$T.obj | $(RTRIM) > tmp/$T.obj.disasm
# convert OMF to COFF because objdump does not support OMF
# TODO: should write a Python script wdis2gas.py and use that instead
cp -p tmp/$T.obj tmp/$T.o
cd tmp && $(WINEENV) wine $(VCLINK.exe) -lib -nologo -out:$T.a $T.o
cd tmp && $(call tc,m-ar) x $T.a
# dump
$(call tc,objdump) -b coff-i386 -m i8086 -M intel -Dr --no-show -w tmp/$T.o | $(RTRIM) > $@
$(call tc,dmc) $(PP_FLAGS) -c -otmp/$T_dm.obj $<
$(call tc,wdis) tmp/$T_dm.obj | $(RTRIM) > tmp/$T_dm.obj.disasm
## $(call tc,wcl) $(PP_FLAGS) -c -fo=tmp/$T_wc.obj $<
## $(call tc,wdis) tmp/$T_wc.obj | $(RTRIM) > tmp/$T.obj.disasm
## $(call tc,bcc) $(PP_FLAGS) -c -otmp/$T_bc.obj $<
## $(call tc,wdis) tmp/$T_bc.obj | $(RTRIM) > tmp/$T_bc.obj.disasm
## $(call tc,cl) $(PP_FLAGS) -c -Fotmp/$T_vc.obj $<
## $(call tc,wdis) tmp/$T_vc.obj | $(RTRIM) > tmp/$T_vc.obj.disasm
# convert
python wdis2gas.py tmp/$T_dm.obj.disasm tmp/$T.S
$(call tc,gcc) -c -o tmp/$T.o tmp/$T.S
$(call tc,f-objstrip,tmp/$T.o)
$(call tc,objdump) -b elf32-i386 -m i8086 -M intel -dr -j .text.LzmaDecode --no-show -w tmp/$T.o | $(RTRIM) | perl -pe 's/DWORD/dword/g; s/WORD/word/g; s/BYTE/byte/g; s/PTR/ptr/g;' > $@
.PRECIOUS: lzma_d_cf.i lzma_d_cs.i
endif
endif
endif
.PRECIOUS: tmp/lzma_d_cf.i tmp/lzma_d_cs.i
lzma_d_cf.% : PP_FLAGS = -DFAST
lzma_d_cs.% : PP_FLAGS = -DSMALL
lzma_d_cf.% : LABEL_PREFIX = .Lf
lzma_d_cs.% : LABEL_PREFIX = .Ls
endif
endif
endif
endif
# /***********************************************************************
# // cc_test
# ************************************************************************/
CC_TEST_DEPS = $(MAKEFILE_LIST) $(TMP_DEPS)
WINEENV = env
WINEENV = env -i DISPLAY='$(DISPLAY)' HOME='$(HOME)' PATH='$(PATH)' USER='$(USER)'
# work around limitations of wine's cmd.exe
define mkbat
echo -E '@set PATH=$3;%PATH%' > $1
echo -E '@set INCLUDE=$4' >> $1
echo -E '@set LIB=$5' >> $1
echo -E '@set a=%1 %2 %3 %4 %5 %6 %7 %8 %9' >> $1
echo -e '@shift\n@shift\n@shift\n@shift\n@shift' >> $1
echo -e '@shift\n@shift\n@shift\n@shift' >> $1
@ -105,11 +123,32 @@ define mkbat
unix2dos -q $1
endef
tmp/bcc.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,bcc.exe,$(BC502WINDIR)\bin,,)
tmp/cl.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,cl.exe,$(VC152WINDIR)\bin,$(VC152WINDIR)\include,$(VC152WINDIR)\lib)
tmp/dmc.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,dmc.exe,$(shell winepath -w $(DM849DIR)/bin),,)
# Open Watcom C/C++ 1.6
# http://openwatcom.com/
ifneq ($(wildcard $(WATCOM)/binl/.),)
c := tc.method-lzma.wcl
$c = PATH='$(WATCOM)/binl:$(PATH)' $(WATCOM)/binl/wcl -zq -bt=dos
$c += -ms -ecc
$c += -zm -zc
$c += -os -s -0 -d0
$c += -w5 -we -fr=/dev/null
$c += -D__INT_MAX__=32767
$c += -I$(UPX_LZMADIR)
$c += -I$(top_srcdir)/src
endif
# Borland C/C++ 5.02
ifneq ($(wildcard $(BC502DIR)/bin/.),)
c := tc.method-lzma.bcc
$c = @$(WINEENV) CL='$(CL)' wine cmd.exe /c tmp/bcc.bat
$c += -mc
$c = @$(WINEENV) wine cmd.exe /c tmp/bcc.bat
$c += -ms
$c += -O1 -1
$c += -w
$c += -D__INT_MAX__=32767
@ -118,26 +157,13 @@ $c += -I$(subst \,/,$(shell winepath -s z:$(realpath $(UPX_LZMADIR)/C/7zip/Compr
$c += -I$(top_srcdir)/src
endif
# Digital Mars C/C++ 8.47
ifneq ($(wildcard $(DM847DIR)/bin/.),)
c := tc.method-lzma.dmc
$c = @$(WINEENV) CFLAGS='$(DMC)' wine cmd.exe /c tmp/dmc.bat
$c += -mc
$c += -NS
$c += -w-
DMC := -o -0
DMC += -D__INT_MAX__=32767
DMC += -I$(shell winepath -s z:$(realpath $(UPX_LZMADIR)))
DMC += -I$(shell winepath -s z:$(realpath $(top_srcdir)/src))
endif
# Visual C/C++ 1.52 (8.00c)
ifneq ($(wildcard $(VC152DIR)/bin/.),)
c := tc.method-lzma.cl
$c = @$(WINEENV) CL='$(CL)' wine cmd.exe /c tmp/cl.bat
$c += -AC
$c += -AS -Gd
$c += -Gy
$c += -O1 -Gf -Gs -G0
$c += -O2 -Gf -Gs -G0
$c += -W4
CL := -nologo
CL += -D__INT_MAX__=32767
@ -147,40 +173,74 @@ endif
ifneq ($(wildcard $(WATCOM)/binl/.),)
cc_test_wc : tc_list = method-lzma default
cc_test_wc: cc_test.c
$(call tc,wcc) $(PP_FLAGS) -fo=tmp/$T.obj $<
cc_test_wc : tc_list = method-lzma arch-i086 default
cc_test_wc: cc_test.c $(CC_TEST_DEPS)
$(call tc,wcl) $(PP_FLAGS) -c -fo=tmp/$T.obj $<
$(call tc,wdis) tmp/$T.obj | $(RTRIM) > tmp/$T.obj.disasm
## cat tmp/$T.obj.disasm
endif
ifneq ($(wildcard $(BC502DIR)/bin/.),)
tmp/bcc.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,bcc.exe,$(BC502WINDIR)\\bin)
cc_test_bc : tc_list = method-lzma default
cc_test_bc: cc_test.c tmp/bcc.bat
cc_test_bc : tc_list = method-lzma arch-i086 default
cc_test_bc: cc_test.c $(CC_TEST_DEPS)
$(call tc,bcc) $(PP_FLAGS) -c -otmp/$T.obj $<
$(call tc,wdis) tmp/$T.obj | $(RTRIM) > tmp/$T.obj.disasm
## cat tmp/$T.obj.disasm
endif
ifneq ($(wildcard $(DM847DIR)/bin/.),)
tmp/dmc.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,dmc.exe,$(DM847WINDIR)\\bin)
cc_test_dm : tc_list = method-lzma default
cc_test_dm: cc_test.c tmp/dmc.bat
ifneq ($(wildcard $(DM849DIR)/bin/.),)
cc_test_dm : tc_list = method-lzma arch-i086 default
cc_test_dm: cc_test.c $(CC_TEST_DEPS)
$(call tc,dmc) $(PP_FLAGS) -c -otmp/$T.obj $<
$(call tc,wdis) tmp/$T.obj | $(RTRIM) > tmp/$T.obj.disasm
## cat tmp/$T.obj.disasm
endif
ifneq ($(wildcard $(VC152DIR)/bin/.),)
tmp/cl.bat: tmp/.tmp-stamp $(MAKEFILE_LIST)
@$(call mkbat,$@,cl.exe,$(VC152WINDIR)\\bin)
cc_test_vc : tc_list = method-lzma default
cc_test_vc: cc_test.c tmp/cl.bat
cc_test_vc : tc_list = method-lzma arch-i086 default
cc_test_vc: cc_test.c $(CC_TEST_DEPS)
$(call tc,cl) $(PP_FLAGS) -c -Fotmp/$T.obj $<
$(call tc,wdis) tmp/$T.obj | $(RTRIM) > tmp/$T.obj.disasm
## cat tmp/$T.obj.disasm
endif
# /***********************************************************************
# // l_test
# ************************************************************************/
L_TEST_DEPS = lzma_d_c.c $(MAKEFILE_LIST) $(TMP_DEPS)
DOSBOX = /usr/bin/time -v dosbox -exit
DOSBOX = dosbox
tmp/l_t_gcc_i386.% : tc_list = arch-i086 default
tmp/l_t_gcc_i386.out: l_test.c $(L_TEST_DEPS)
$(call tc,gcc) -O0 -g -o $@ $<
./$@
tmp/l_t_bc.% : tc_list = method-lzma arch-i086 default
tmp/l_t_bc.exe: l_test.c $(L_TEST_DEPS)
$(call tc,bcc) -o$(subst /,\\,$@) $<
@rm -f l_test.o l_test.obj
$(DOSBOX) $@
tmp/l_t_dm.% : tc_list = method-lzma arch-i086 default
tmp/l_t_dm.exe: l_test.c $(L_TEST_DEPS)
$(call tc,dmc) -ml -o$(subst /,\\,$@) $<
@rm -f l_test.o l_test.obj
$(DOSBOX) $@
tmp/l_t_wc.% : tc_list = method-lzma arch-i086 default
tmp/l_t_wc.exe: l_test.c $(L_TEST_DEPS)
$(call tc,wcl) -fe=$@ $<
@rm -f l_test.o l_test.obj
$(DOSBOX) $@
tmp/l_t_vc.% : tc_list = method-lzma arch-i086 default
tmp/l_t_vc.exe: l_test.c $(L_TEST_DEPS)
$(call tc,cl) -Fe$(subst /,\\,$@) $<
@rm -f l_test.o l_test.obj
$(DOSBOX) $@
.PHONY: tmp/l_t_gcc_i386.out tmp/l_t_bc.exe tmp/l_t_dm.exe tmp/l_t_wc.exe tmp/l_t_vc.exe

View File

@ -58,9 +58,11 @@ typedef unsigned short hsize_t;
// pia - pointer add
hptr __cdecl pia(hptr a, hsize_t d) { return a + d; }
hptr __cdecl pia1(hptr a) { return a + 1; }
// pis - pointer subtract
hptr __cdecl pis(hptr a, hsize_t d) { return a - d; }
hptr __cdecl pis1(hptr a) { return a - 1; }
// pts - pointer diff
hptrdiff_t __cdecl pts(hptr a, hptr b) { return a - b; }
@ -75,9 +77,11 @@ int __cdecl ptc_ge(hptr a, hptr b) { return a >= b; }
// u4m - unsigned multiplication
uint32_t __cdecl u4m(uint32_t a, uint32_t b) { return a * b; }
uint32_t __pascal u4m_p(uint32_t a, uint32_t b) { return b * a; }
// i4m - signed multiplication
int32_t __cdecl i4m(int32_t a, int32_t b) { return a * b; }
int32_t __pascal i4m_p(int32_t a, int32_t b) { return b * a; }
// just for testing
uint16_t __cdecl u2m(uint16_t a, uint16_t b) { return a * b; }
@ -85,10 +89,25 @@ int16_t __cdecl i2m(int16_t a, int16_t b) { return a * b; }
uint32_t __cdecl u2m4(uint16_t a, uint16_t b) { return a * b; }
int32_t __cdecl i2m4(int16_t a, int16_t b) { return a * b; }
uint16_t __cdecl u2shl8 (uint16_t a) { return a << 8; }
uint32_t __cdecl u4shl8 (uint32_t a) { return a << 8; }
uint16_t __cdecl u2shl12(uint16_t a) { return a << 12; }
uint32_t __cdecl u4shl14(uint32_t a) { return a << 12; }
uint32_t __cdecl u4shl12(uint32_t a) { return a << 12; }
uint32_t __cdecl u4shl16(uint32_t a) { return a << 16; }
uint32_t __cdecl u4shl24(uint32_t a) { return a << 24; }
uint16_t __cdecl u2shlv(uint16_t a, unsigned v) { return a << v; }
uint32_t __cdecl u4shlv(uint32_t a, unsigned v) { return a << v; }
void __pascal p4nshlv_v(unsigned char v, uint32_t __near *a) { *a <<= v; }
void __pascal p4fshlv_v(unsigned char v, uint32_t __far *a) { *a <<= v; }
uint32_t __pascal p4nshlv(unsigned char v, uint32_t __near *a) { return *a <<= v; }
uint32_t __pascal p4fshlv(unsigned char v, uint32_t __far *a) { return *a <<= v; }
uint32_t __cdecl shlv_2(uint16_t h, uint16_t l, unsigned v)
{ uint16_t x = l >> (16 - v); l <<= v; h <<= v; h |= x; return h * 65536ul + l; }
hptrdiff_t __cdecl hptr2int(hptr a) { return (hptrdiff_t) a; }
hptr __cdecl int2hptr(hptrdiff_t a) { return (hptr) a; }
/* vim:set ts=4 et: */

View File

@ -37,14 +37,12 @@ class opts:
# optimizer flags
auto_inline = 1
call_rewrite = 1
loop_rewrite = 1
inline_map = {
## "__PIA": "WCC_PIA",
"__PTS": "WCC_PTS",
## "__U4M_V01": "WCC_U4M_V01",
"__PIA_V02": "WCC_PIA_V02",
"__PIA_V01": "WCC_PIA_V01",
"__aNNalshl": "M_aNNalshl",
"__aNahdiff": "M_aNahdiff",
}
@ -75,14 +73,20 @@ def main(argv):
#
labels = {}
def parse_label(inst, args):
m = re.search("^([0-9a-z]+)\s+<", args)
if m:
k = v = None
m = re.search(r"^(.*?)\b(2|R_386_PC16)\s+(__\w+)$", args)
if m and k is None:
# external 2-byte label
k, v = m.group(3).strip(), [1, 2, None, 0]
m = re.search("^0x([0-9a-z]+)$", args)
if m and k is None:
# local label
k, v = m.group(1).strip(), [0, 0, None, 0]
m = re.search(r"^(.*?)\b2\s+(__\w+)$", args)
if m:
# external 2-byte label
k, v = m.group(2).strip(), [1, 2, None, 0]
m = re.search("^([0-9a-z]+)\s+<", args)
if m and k is None:
# local label
k, v = m.group(1).strip(), [0, 0, None, 0]
assert k and v, (inst, args)
v[2] = k # new name
if labels.has_key(k):
assert labels[k][:2] == v[:2]
@ -101,33 +105,38 @@ def main(argv):
dpos = []
while i < len(m):
if pos < 0 or pos >= len(olines):
return False
return []
dpos.append(pos)
o = olines[pos][1:3]
assert len(m[i]) == 2, (i, m)
if o[0].lower() != m[i][0].lower():
return False
return []
if o[1].lower() != m[i][1].lower():
return []
pos += 1
i += 1
return dpos
def orewrite(i, k, v, dpos):
def orewrite_inst(i, inst, args, dpos):
for pos in dpos:
olines[pos][1] = "*DEL*"
olines[i][1] = inst
olines[i][2] = args
olines[i][3] = None
def orewrite_call(i, k, v, dpos):
for pos in dpos:
olines[pos][1] = "*DEL*"
v[2] = k
olines[i][2] = None
olines[i][3] = add_label(k, v)
#
# pass 1
func = None
for i in range(len(lines)):
l = lines[i]
m = re.search(r"^0000000000000000\s*<(\w+)>:", l)
m = re.search(r"^0{8,16}\s*<(\.text\.)?(\w+)>:", l)
if m:
func = re.sub(r"^_+|_+$", "", m.group(1))
func = re.sub(r"^_+|_+$", "", m.group(2))
if not func in ["LzmaDecode"]:
continue
m = re.search(r"^(\s*[0-9a-z]+):\s+(\w+)(.*)", l)
@ -139,12 +148,12 @@ def main(argv):
if m.group(3): args = m.group(3).strip()
#
if inst in ["movl",] and re.search(r"\b[de]s\b", args):
# correct objdump bug
# fix bug in objdump
inst = "movw"
m = re.search(r"^(.+?)\b0x0\s+(\w+):\s+[12]\s+(__\w+)$", args)
m = re.search(r"^(.+?)\b0x0\s+(\w+):\s+(1|2|R_386_16|R_386_PC16)\s+(__\w+)$", args)
if m:
# 1 or 2 byte reloc
args = m.group(1) + m.group(3)
args = m.group(1) + m.group(4)
olines.append([label, inst, args, None])
#
# pass 2
@ -157,81 +166,63 @@ def main(argv):
if opts.call_rewrite and inst in ["call"]:
k, v = parse_label(inst, args)
if v[:2] == [1, 2]: # external 2-byte
if k == "__PIA":
inst1 = [
["mov", "bx,WORD PTR [bp-94]"],
["or", "bx,ax"],
["mov", "WORD PTR [bp-8],bx"],
["mov", "WORD PTR [bp-4],dx"],
["mov", "ax,WORD PTR [bp-12]"],
["movw", "dx,ds"],
["mov", "bx,0x1"],
if k == "__LMUL":
s = [
["xor", "cx,cx"],
]
inst2 = [
["mov", "WORD PTR [bp-12],ax"],
["movw", "ds,dx"],
]
dpos1 = omatch(i - 8, inst1[-8:])
dpos2 = omatch(i + 1, inst2)
if dpos1 and dpos2:
orewrite(i, "__PIA_V04", v, dpos1 + dpos2)
continue
dpos1 = omatch(i - 4, inst1[-4:])
dpos2 = omatch(i + 1, inst2)
if dpos1 and dpos2:
orewrite(i, "__PIA_V03", v, dpos1 + dpos2)
continue
dpos = omatch(i - 3, inst1[-3:])
dpos = omatch(i - 1, s[-1:])
if dpos:
orewrite(i, "__PIA_V02", v, dpos)
orewrite_inst(i, "M_LMUL_dxax_00bx", "", dpos)
continue
dpos = omatch(i - 2, inst1[-2:])
if dpos:
orewrite(i, "__PIA_V01", v, dpos)
continue
if k == "__PTC":
inst1 = [
["mov", "ax,WORD PTR [bp-12]"],
["movw", "dx,ds"],
["mov", "bx,WORD PTR [bp-26]"],
["mov", "cx,WORD PTR [bp-24]"],
if k == "__aNahdiff":
s = [
["push", "word ptr [bp+8]"],
["push", "word ptr [bp+6]"],
["push", "word ptr [bp-66]"],
["push", "word ptr [bp-68]"],
]
dpos = omatch(i - 4, inst1[-4:])
dpos = omatch(i - 4, s[-4:])
if dpos:
orewrite(i, "__PTC_V01", v, dpos)
continue
if k == "__U4M":
inst1 = [
["mov", "bx,WORD PTR es:[bx]"],
["mov", "ax,WORD PTR [bp-102]"],
["mov", "dx,WORD PTR [bp-100]"],
["xor", "cx,cx"],
]
inst2 = [
["mov", "WORD PTR [bp-10],ax"],
["mov", "WORD PTR [bp-6],dx"],
]
dpos1 = omatch(i - 4, inst1[-4:])
dpos2 = omatch(i + 1, inst2)
if dpos1 and dpos2:
orewrite(i, "__U4M_V02", v, dpos1 + dpos2)
continue
dpos = omatch(i - 1, inst1[-1:])
if dpos:
orewrite(i, "__U4M_V01", v, dpos)
orewrite_inst(i, "*DEL*", "", dpos)
continue
if opts.loop_rewrite and inst in ["loop"]:
s = [
["mov", "cx,0xb"],
["shr", "dx,1"],
["rcr", "ax,1"],
]
dpos = omatch(i - 3, s[-3:])
if dpos:
orewrite_inst(i, "M_shrd_11", "", dpos)
continue
s = [
["mov", "cl,0x8"],
["shl", "ax,1"],
["rcl", "dx,1"],
]
dpos = omatch(i - 3, s[-3:])
if dpos:
orewrite_inst(i, "M_shld_8", "", dpos)
continue
s = [
["mov", "cx,0x8"],
["shl", "ax,1"],
["rcl", "dx,1"],
]
dpos = omatch(i - 3, s[-3:])
if dpos:
orewrite_inst(i, "M_shld_8", "", dpos)
continue
#
if inst in [
"call", "ja", "jae", "jb", "jbe", "jcxz",
"je", "jge", "jl", "jmp", "jne", "loop",
"call", "ja", "jae", "jb", "jbe", "jcxz", "je",
"jg", "jge", "jl", "jle", "jmp", "jne", "loop",
]:
k, v = parse_label(inst, args)
olines[i][2] = None
olines[i][3] = add_label(k, v)
#
# rewrite local labels
# pass 3
digits, i = 1, len(labels)
while i >= 10:
digits += 1
@ -258,7 +249,7 @@ def main(argv):
olines[i][2] = "/* inlined */"
olines[i][2] = ""
olines[i][3] = None
#
# write ofile
ofp = open(ofile, "wb")
for label, inst, args, args_label in olines:

View File

@ -0,0 +1,127 @@
/* l_test.c --
This file is part of the UPX executable compressor.
Copyright (C) 2007-2007 Markus Franz Xaver Johannes Oberhumer
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
<mfx@users.sourceforge.net>
*/
#include "stub/src/c/lzma_d_c.c"
#if (ACC_ARCH_I086)
#define bytep unsigned char __huge *
typedef unsigned long uint32_t;
#else
#define bytep unsigned char *
typedef unsigned int uint32_t;
#endif
#if (ACC_OS_DOS16)
# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
int __cdecl printf(const char *, ...);
void * __cdecl malloc(unsigned);
void __far * __cdecl farmalloc(unsigned long);
# define acc_halloc(x) ((void __huge *) farmalloc(x))
# elif (ACC_CC_DMC || ACC_CC_MSC)
# include <stdio.h>
# include <malloc.h>
# define acc_halloc(x) _halloc(x,1)
# elif (ACC_CC_WATCOMC)
int __watcall printf(const char *, ...);
void * __watcall malloc(unsigned);
void __huge * __watcall halloc(long, unsigned);
# define acc_halloc(x) halloc(x,1)
# else
# endif
#else
# define printf __builtin_printf
# define malloc(x) __builtin_malloc(x)
# define acc_halloc(x) malloc(x)
#endif
/*************************************************************************
//
**************************************************************************/
/*
>>> import pylzma; d="\1" + "\0"*131070 + "\2"; print len(d)
>>> c=pylzma.compress(d, eos=0)[5:]; print len(c), map(ord, c)
*/
static const unsigned char c_data[92] = {
0, 0, 128, 65, 72, 1, 140, 46, 188, 80, 161, 51, 135, 75, 212, 2, 20, 181, 241, 145, 230, 34, 107, 72, 201, 86, 118, 176, 70, 120, 214, 184, 247, 212, 250, 132, 59, 160, 44, 112, 185, 177, 245, 126, 103, 190, 14, 145, 73, 36, 148, 246, 166, 58, 41, 192, 68, 167, 144, 98, 122, 42, 61, 195, 135, 248, 98, 136, 254, 191, 96, 21, 192, 75, 86, 63, 228, 231, 15, 70, 52, 239, 169, 194, 249, 109, 126, 11, 123, 48, 0, 0
};
int main()
{
uint32_t i;
int r;
uint32_t src_len = sizeof(c_data);
uint32_t dst_len = 131072ul;
uint32_t src_out = 0;
uint32_t dst_out = 0;
const bytep src;
bytep dst;
CLzmaDecoderState *s;
printf("Decompress %lu %lu\n", (long)src_len, (long)dst_len);
s = (CLzmaDecoderState *) malloc(32768u);
src = c_data;
dst = (bytep) acc_halloc(dst_len);
if (!s || !dst) {
printf("ERROR: Out of memory!\n");
return 1;
}
for (i = 0; i != dst_len; ++i)
dst[i] = 255;
s->Properties.lc = 3; s->Properties.lp = 0; s->Properties.pb = 2;
r = LzmaDecode(s, src, src_len, &src_out, dst, dst_len, &dst_out);
if (r != 0 || src_out != src_len || dst_out != dst_len)
{
printf("ERROR: Decompression error %d %lu %lu\n", r, (long)src_out, (long)dst_out);
return 1;
}
i = 0;
if (dst[i] != 1)
goto data_error;
while (++i != dst_len - 1)
if (dst[i] != 0)
goto data_error;
if (dst[i] != 2)
goto data_error;
printf("Decompression test passed. All done.\n");
return 0;
data_error:
printf("ERROR: Decompression data error at offset %lu.\n", (long)i);
return 1;
}
/* vim:set ts=4 et: */

View File

@ -30,153 +30,196 @@
; ------------- DECOMPRESSION -------------
; Input:
; si - source
; di - dest
; ds:si - source
; es:di - dest
; cld
; Output:
*/
/*************************************************************************
// support macros
**************************************************************************/
// huge pointer diff: dx:ax = dx:ax - cx:bx
// !!! this version does nothing !!!
.macro M_aNahdiff
add sp, 8
.endm
// umul32: dx:ax = dx:ax * 00:bx
.macro M_LMUL_dxax_00bx
// mult high-word
mov cx, ax // cx: save ax
mov ax, dx
mul bx
xchg ax, cx // save high-word result, get orig ax
// mult low-word
mul bx // dx:ax := ax * bx
// add high-word
add dx, cx // add high-word result
.endm
// umul32: dx:ax = ax:cx * 00:bx
.macro M_LMUL_axcx_00bx
// mult high-word
mul bx
xchg ax, cx // save high-word result, get low
// mult low-word
mul bx
// add high-word
add dx, cx // add high-word result
.endm
// shld: dx:ax <<= 8
.macro M_shld_8
mov dh, dl
mov dl, ah
mov ah, al
xor al, al
//xor cx, cx // FIXME - do we need this ?
.endm
// shld: dx:ax >>= 11
.macro M_shrd_11
#if 1
mov al, ah
mov ah, dl
mov dl, dh
xor dh, dh
shr dx
rcr ax
shr dx
rcr ax
shr dx
rcr ax
#else
mov bx, dx
mov cl, 11
shr dx, cl
shr ax, cl
mov cl, 5
shl bx, cl
or ax, bx
#endif
//xor cx, cx // FIXME - do we need this ?
.endm
#if 0
// shld: dx:ax <<= cl; trashes register "r1" (bx, di, si or bp)
// REQUIRED: 0 <= cl < 32
// FIXME - this does not work yet
.macro M_shld r1
local L1
mov r1, ax // save ax
shl dx, cl
shl ax, cl
neg cl
and cl, 15 // the 8086 uses all eight bits of the shift count
shr r1, cl
or dx, r1
.endm
#endif
/*************************************************************************
// support code (see cleanasm.py)
**************************************************************************/
section LZMA_DEC99
__PIA_V04:
mov bx,WORD PTR [bp-94]
or bx,ax
mov WORD PTR [bp-8],bx
mov WORD PTR [bp-4],dx
__PIA_V03:
mov ax,WORD PTR [bp-12]
// FIXME: need optimized version here
movw dx,ds
mov bx,0x1
xor cx,cx
M_WCC_PIA
mov WORD PTR [bp-12],ax
movw ds,dx
ret
#if 1
.macro lzma_WCC_PIA_V02
// FIXME: need optimized version here
movw dx,ds
mov bx,0x1
xor cx,cx
M_WCC_PIA
.endm
#define WCC_PIA_V02 lzma_WCC_PIA_V02
#endif
__PIA:
M_WCC_PIA
ret
__PTC_V01:
mov ax,WORD PTR [bp-12]
movw dx,ds
mov bx,WORD PTR [bp-26]
mov cx,WORD PTR [bp-24]
__PTC:
M_WCC_PTC
ret
#if 1
// FIXME: do we actually need the PTS result ??
#define WCC_PTS M_WCC_PTS
#else
#define WCC_PTS xor ax,ax; xor dx,dx
#endif
__U4M_V02:
mov bx,WORD PTR es:[bx]
mov ax,WORD PTR [bp-102]
mov dx,WORD PTR [bp-100]
// FIXME: need optimized version here (cx = 0)
xor cx,cx
M_WCC_U4M
mov WORD PTR [bp-10],ax
mov WORD PTR [bp-6],dx
ret
__U4M_V01:
// FIXME: need optimized version here (cx = 0)
xor cx,cx
M_WCC_U4M
ret
/*************************************************************************
//
**************************************************************************/
// init
section LZMA_DEC00
// .byte 0xcc
mov bp, sp
lea bx, [bp + lzma_stack_adjust]
xor ax, ax
.clearstack:
push ax
cmp sp, bx
jnz .clearstack
//.byte 0xcc
inc si
inc si
push ss // outSizeProcessed
push bx
mov ax, offset lzma_u_len_hi
push ax
mov ax, offset lzma_u_len
push ax // outSize
push es
push di // out
add bx, 4
push ss // inSizeProcessed
push bx
mov ax, offset lzma_c_len_hi
push ax
mov ax, offset lzma_c_len
push ax // inSize
push ds
push si // in
mov bp, sp
#if 1
// DEBUG - check for enough stack
lea bx, [bp + lzma_stack_adjust - 256]
cmp bp, bx
1: jcs 1b
#endif
lea bx, [bp + lzma_stack_adjust]
#if 0
// clear stack
xor ax, ax
1: push ax
cmp sp, bx
jnz 1b
#else
mov sp, bx
#endif
inc si
inc si
push bx // &outSizeProcessed __near [bp + 24]
mov ax, offset lzma_u_len_hi // outSize
push ax // [bp + 22]
mov ax, offset lzma_u_len
push ax // [bp + 20]
push es // out [bp + 18]
push di // [bp + 16]
add bx, 4
push ss
push bx
mov ax, offset lzma_properties_hi
mov ss:[bx + 2], ax
mov ax, offset lzma_properties
mov ss:[bx], ax
call LZMA_DEC10
// .byte 0xcc
push bx // &inSizeProcessed __near [bp + 14]
mov ax, offset lzma_c_len_hi // inSize
push ax // [bp + 12]
mov ax, offset lzma_c_len
push ax // [bp + 10]
push ds // in [bp + 8]
push si // [bp + 6]
mov sp, bp
// enter small model
push ss
pop ds
add bx, 4
push bx // &state __near [bp + 4]
mov ax, offset lzma_properties_hi
mov [bx + 2], ax
mov ax, offset lzma_properties
mov [bx], ax
call LZMA_DEC10
jmp LZMA_DEC30
section LZMA_DEC10
.arch i8086, nojumps
#include "lzma_d_cs.S"
section LZMA_DEC20
.arch i8086, nojumps
#include "lzma_d_cf.S"
.arch i8086, jumps
// cleanup
section LZMA_DEC30
#if 0
// clear dirty stack
lea bx, [bp + lzma_stack_adjust - 256]
mov sp, bp
xor ax, ax
1: push ax
cmp sp, bx
jnz 1b
#endif
mov sp, bp
pop ds
mov di, offset lzma_u_len
section LZMA_DEC31
@ -186,8 +229,5 @@ section LZMA_DEC31
mov es, ax
#undef WCC_PIA_V02
#undef WCC_PTS
// vi:ts=8:et
// vi:ts=4:et

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -120,6 +120,7 @@
.byte 0x7f, \target - . - 1
.endm
#define jaes jncs
#define jbes jnas
#define jbs jcs
#define jes jzs
@ -129,7 +130,7 @@
/*
; =============
; ============= WATCOM C/C++ HUGE POINTER SUPPORT
; ============= HUGE POINTER SUPPORT
; =============
*/
@ -138,6 +139,7 @@
#define __AHINCR (1 << __AHSHIFT) /* 4096 */
#if 0
// huge pointer add: dx:ax = dx:ax + cx:bx
.macro M_WCC_PIA
add ax, bx
@ -147,8 +149,10 @@
shl bx, cl
add dx, bx
.endm
#endif
#if 0
// huge pointer sub: dx:ax = dx:ax - cx:bx
.macro M_WCC_PIS
sub ax, bx
@ -158,8 +162,10 @@
shl bx, cl
sub dx, bx
.endm
#endif
#if 0
// huge pointer diff: dx:ax = dx:ax - cx:bx
.macro M_WCC_PTS
// normalize
@ -168,6 +174,7 @@
sub ax, bx
sbb dx, cx
.endm
#endif
#if 0
@ -180,19 +187,17 @@
cmp ax, bx
L1:
.endm
#endif
#if 0
// umul32: dx:ax = dx:ax * cx:bx
.macro M_WCC_U4M
// FIXME
// compute high-word
// add low-word
.endm
#else
# include "tainted.h"
#endif
/*
; =============
; ============= 16-BIT CALLTRICK & JUMPTRICK

View File

@ -105,6 +105,5 @@ decomp_done_n2b:
cjt16 decomp_ret_n2b
/*
; vi:ts=8:et
*/
/* vim:set ts=4 et: */

View File

@ -152,5 +152,5 @@ f2_n2b:
ret
decomp_done_n2b:
/* vi:ts=8:et */
/* vim:set ts=4 et: */

View File

@ -162,5 +162,5 @@ f2_n2d:
ret
decomp_done_n2d:
/* vi:ts=8:et */
/* vim:set ts=4 et: */

View File

@ -168,4 +168,5 @@ f2_n2e:
ret
decomp_done_n2e:
/* vi:ts=8:et */
/* vim:set ts=4 et: */

View File

@ -0,0 +1,146 @@
#! /usr/bin/env python
## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*-
#
# wdis2gas.py --
#
# This file is part of the UPX executable compressor.
#
# Copyright (C) 1996-2007 Markus Franz Xaver Johannes Oberhumer
# 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>
#
import getopt, os, re, string, sys
class opts:
arch = "i086"
label_prefix = ".L"
verbose = 0
# /***********************************************************************
# // main
# ************************************************************************/
def main(argv):
shortopts, longopts = "qv", [
"arch", "label-prefix=", "quiet", "verbose"
]
xopts, args = getopt.gnu_getopt(argv[1:], shortopts, longopts)
for opt, optarg in xopts:
if 0: pass
elif opt in ["-q", "--quiet"]: opts.verbose = opts.verbose - 1
elif opt in ["-v", "--verbose"]: opts.verbose = opts.verbose + 1
elif opt in ["--arch"]: opts.arch = optarg
elif opt in ["--label-prefix"]: opts.label_prefix = optarg
else: assert 0, ("getopt problem:", opt, optarg, xopts, args)
#
assert len(args) == 2
ifile = args[0]
ofile = args[1]
# read ifile
lines = open(ifile, "rb").readlines()
lines = map(string.rstrip, lines)
#
section = None
func = None
olines = []
for i in range(len(lines)):
l = lines[i]
if not l: continue
m = re.search(r"^No disassembly errors", l)
if m: continue
m = re.search(r"^Module:", l)
if m: continue
m = re.search(r"^GROUP:", l)
if m: continue
m = re.search(r"^(BSS|Routine) Size:", l)
if m: continue
m = re.search(r"Segment:\s+(.+)\s+([0-9a-fA-F]+)\s+bytes$", l)
if m:
s = re.split(r"\s+", m.group(1))
assert len(s) == 3, (i, l, s, m.groups())
section = s
func = None
continue
m = re.search(r"Comdat:\s+(.+)\s+SEGMENT NONE '(\w+)'\s+([0-9a-fA-F]+)\s+bytes$", l)
if m:
section = [m.group(2)]
assert section[0].endswith("_TEXT"), (i, l, section)
func = re.sub(r"^[_@]+|[_@]+$", "", m.group(1))
olines.append(".section .text." + func)
continue
assert section, (i, l)
m = re.search(r"^0000\s+(\w+):$", l)
if m:
assert section[0].endswith("_TEXT"), (i, l, section)
func = re.sub(r"^[_@]+|[_@]+$", "", m.group(1))
olines.append(".section .text." + func)
continue
assert func, (i, l, section)
m = re.search(r"^[0-9a-fA-F]{4}\s+L\$(\d+):$", l)
if m:
olines.append(opts.label_prefix + m.group(1) + ":")
continue
m = re.search(r"^[0-9a-fA-F]{4} (([0-9a-fA-F]{2} )+)\s+(.+)$", l)
assert m, (i, l)
if m.group(3).startswith("call"):
s = re.split(r"\s+", m.group(3))
assert len(s) == 2, (i, l, s, m.groups())
f = re.sub(r"^[@]+|[@]+$", "", s[1])
olines.append(" call " + f)
elif 1:
s = m.group(3).strip()
s = re.sub("L\$(\d+)", opts.label_prefix + "\g<1>", s)
olines.append(" " + s)
else:
s = re.split(r"\s+", m.group(1).strip())
assert 1 <= len(s) <= 5, (i, l, s, m.groups())
s = ["0x" + x for x in s]
olines.append(" .byte " + ",".join(s))
# write ofile
ofp = open(ofile, "wb")
ofp.write(".code16\n")
ofp.write(".intel_syntax noprefix\n")
if opts.arch in ["i086", "8086", "i8086"]:
ofp.write(".arch i8086, jumps\n")
elif opts.arch in ["i286"]:
ofp.write(".arch i286, jumps\n")
else:
assert 0, ("invalid arch", opts.arch)
if 0:
for sym in ["__AHSHIFT", "__AHINCR", "__LMUL", "__aNahdiff"]:
ofp.write(".extern %s\n" % (sym))
ofp.write(".type %s,@function\n" % (sym))
ofp.write(".size %s,2\n" % (sym))
for l in olines:
ofp.write(l.rstrip() + "\n")
ofp.close()
##print olines
if __name__ == "__main__":
sys.exit(main(sys.argv))

View File

@ -83,11 +83,6 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(CLzmaDecoderState) == 32768u)
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(SizeT) >= 4)
#if (ACC_ARCH_I086)
# if (ACC_MM_HUGE)
typedef unsigned short __far MyCProb;
# undef CProb
# define CProb MyCProb
# endif
# define char char __huge
#elif (ACC_CC_WATCOMC)
#else
@ -98,6 +93,8 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(SizeT) >= 4)
#else
#include "C/7zip/Compress/LZMA_C/LzmaDecode.c"
#endif
#undef char
#undef CLzmaDecoderState
#endif

View File

@ -44,27 +44,27 @@ Idx Name Size VMA LMA File off Algn Flags
39 NRV2EEX3 00000015 00000000 00000000 0000027b 2**0 CONTENTS, RELOC, READONLY
40 N2E64K02 0000000b 00000000 00000000 00000290 2**0 CONTENTS, READONLY
41 NRV2EEX9 00000004 00000000 00000000 0000029b 2**0 CONTENTS, READONLY
42 LZMA_DEC99 000000ae 00000000 00000000 0000029f 2**0 CONTENTS, READONLY
43 LZMA_DEC00 00000044 00000000 00000000 0000034d 2**0 CONTENTS, RELOC, READONLY
44 LZMA_DEC10 00000ea2 00000000 00000000 00000391 2**0 CONTENTS, RELOC, READONLY
45 LZMA_DEC20 00000ea2 00000000 00000000 00001233 2**0 CONTENTS, RELOC, READONLY
46 LZMA_DEC30 00000003 00000000 00000000 000020d5 2**0 CONTENTS, RELOC, READONLY
47 LZMA_DEC31 00000007 00000000 00000000 000020d8 2**0 CONTENTS, RELOC, READONLY
48 EXEMAIN5 00000001 00000000 00000000 000020df 2**0 CONTENTS, READONLY
49 EXEADJUS 00000007 00000000 00000000 000020e0 2**0 CONTENTS, READONLY
50 EXENOADJ 00000002 00000000 00000000 000020e7 2**0 CONTENTS, READONLY
51 EXERELO1 0000001e 00000000 00000000 000020e9 2**0 CONTENTS, RELOC, READONLY
52 EXEREL9A 00000012 00000000 00000000 00002107 2**0 CONTENTS, RELOC, READONLY
53 EXERELO2 00000004 00000000 00000000 00002119 2**0 CONTENTS, READONLY
54 EXEREBIG 00000002 00000000 00000000 0000211d 2**0 CONTENTS, RELOC, READONLY
55 EXERELO3 00000002 00000000 00000000 0000211f 2**0 CONTENTS, RELOC, READONLY
56 EXEMAIN8 00000003 00000000 00000000 00002121 2**0 CONTENTS, READONLY
57 DEVICEEND 00000013 00000000 00000000 00002124 2**0 CONTENTS, READONLY
58 EXESTACK 00000006 00000000 00000000 00002137 2**0 CONTENTS, RELOC, READONLY
59 EXESTASP 00000003 00000000 00000000 0000213d 2**0 CONTENTS, RELOC, READONLY
60 EXEJUMPF 00000005 00000000 00000000 00002140 2**0 CONTENTS, RELOC, READONLY
61 EXERCSPO 00000004 00000000 00000000 00002145 2**0 CONTENTS, RELOC, READONLY
62 EXERETIP 00000006 00000000 00000000 00002149 2**0 CONTENTS, RELOC, READONLY
42 LZMA_DEC99 00000000 00000000 00000000 0000029f 2**0 CONTENTS, READONLY
43 LZMA_DEC00 00000043 00000000 00000000 0000029f 2**0 CONTENTS, RELOC, READONLY
44 LZMA_DEC10 00001203 00000000 00000000 000002e2 2**0 CONTENTS, READONLY
45 LZMA_DEC20 00001203 00000000 00000000 000014e5 2**0 CONTENTS, READONLY
46 LZMA_DEC30 00000006 00000000 00000000 000026e8 2**0 CONTENTS, RELOC, READONLY
47 LZMA_DEC31 00000007 00000000 00000000 000026ee 2**0 CONTENTS, RELOC, READONLY
48 EXEMAIN5 00000001 00000000 00000000 000026f5 2**0 CONTENTS, READONLY
49 EXEADJUS 00000007 00000000 00000000 000026f6 2**0 CONTENTS, READONLY
50 EXENOADJ 00000002 00000000 00000000 000026fd 2**0 CONTENTS, READONLY
51 EXERELO1 0000001e 00000000 00000000 000026ff 2**0 CONTENTS, RELOC, READONLY
52 EXEREL9A 00000012 00000000 00000000 0000271d 2**0 CONTENTS, RELOC, READONLY
53 EXERELO2 00000004 00000000 00000000 0000272f 2**0 CONTENTS, READONLY
54 EXEREBIG 00000002 00000000 00000000 00002733 2**0 CONTENTS, RELOC, READONLY
55 EXERELO3 00000002 00000000 00000000 00002735 2**0 CONTENTS, RELOC, READONLY
56 EXEMAIN8 00000003 00000000 00000000 00002737 2**0 CONTENTS, READONLY
57 DEVICEEND 00000013 00000000 00000000 0000273a 2**0 CONTENTS, READONLY
58 EXESTACK 00000006 00000000 00000000 0000274d 2**0 CONTENTS, RELOC, READONLY
59 EXESTASP 00000003 00000000 00000000 00002753 2**0 CONTENTS, RELOC, READONLY
60 EXEJUMPF 00000005 00000000 00000000 00002756 2**0 CONTENTS, RELOC, READONLY
61 EXERCSPO 00000004 00000000 00000000 0000275b 2**0 CONTENTS, RELOC, READONLY
62 EXERETIP 00000006 00000000 00000000 0000275f 2**0 CONTENTS, RELOC, READONLY
SYMBOL TABLE:
00000000 l d DEVICEENTRY 00000000 DEVICEENTRY
00000000 l d EXEENTRY 00000000 EXEENTRY
@ -80,7 +80,6 @@ SYMBOL TABLE:
00000000 l d NRV2EEX2 00000000 NRV2EEX2
00000000 l d NRV2EEX3 00000000 NRV2EEX3
00000000 l d NRV2EEX9 00000000 NRV2EEX9
00000000 l d LZMA_DEC99 00000000 LZMA_DEC99
00000000 l d LZMA_DEC10 00000000 LZMA_DEC10
00000000 l d LZMA_DEC30 00000000 LZMA_DEC30
00000000 l d EXERELO1 00000000 EXERELO1
@ -113,6 +112,7 @@ SYMBOL TABLE:
00000000 l d N2EX8602 00000000 N2EX8602
00000000 l d N2E28602 00000000 N2E28602
00000000 l d N2E64K02 00000000 N2E64K02
00000000 l d LZMA_DEC99 00000000 LZMA_DEC99
00000000 l d LZMA_DEC00 00000000 LZMA_DEC00
00000000 l d LZMA_DEC20 00000000 LZMA_DEC20
00000000 l d LZMA_DEC31 00000000 LZMA_DEC31
@ -254,127 +254,20 @@ OFFSET TYPE VALUE
RELOCATION RECORDS FOR [LZMA_DEC00]:
OFFSET TYPE VALUE
00000004 R_386_16 lzma_stack_adjust
00000012 R_386_16 lzma_u_len_hi
00000016 R_386_16 lzma_u_len
00000021 R_386_16 lzma_c_len_hi
00000025 R_386_16 lzma_c_len
00000030 R_386_16 lzma_properties_hi
00000037 R_386_16 lzma_properties
0000003d R_386_PC16 LZMA_DEC10
00000042 R_386_PC16 LZMA_DEC30
RELOCATION RECORDS FOR [LZMA_DEC10]:
OFFSET TYPE VALUE
000000e5 R_386_PC16 LZMA_DEC99
0000011b R_386_PC16 LZMA_DEC99
00000127 R_386_PC16 LZMA_DEC99
00000170 R_386_PC16 LZMA_DEC99
00000199 R_386_PC16 LZMA_DEC99
000001b0 R_386_PC16 LZMA_DEC99
00000213 R_386_PC16 LZMA_DEC99
00000247 R_386_PC16 LZMA_DEC99
00000283 R_386_PC16 LZMA_DEC99
000002af R_386_PC16 LZMA_DEC99
000002c6 R_386_PC16 LZMA_DEC99
0000034c R_386_PC16 LZMA_DEC99
00000378 R_386_PC16 LZMA_DEC99
0000038f R_386_PC16 LZMA_DEC99
000003ff R_386_PC16 LZMA_DEC99
00000467 R_386_PC16 LZMA_DEC99
00000493 R_386_PC16 LZMA_DEC99
000004aa R_386_PC16 LZMA_DEC99
0000054e R_386_PC16 LZMA_DEC99
0000057a R_386_PC16 LZMA_DEC99
00000591 R_386_PC16 LZMA_DEC99
000005ff R_386_PC16 LZMA_DEC99
00000657 R_386_PC16 LZMA_DEC99
000006b0 R_386_PC16 LZMA_DEC99
000006d1 R_386_PC16 LZMA_DEC99
0000073a R_386_PC16 LZMA_DEC99
0000078e R_386_PC16 LZMA_DEC99
000007f8 R_386_PC16 LZMA_DEC99
00000824 R_386_PC16 LZMA_DEC99
0000083b R_386_PC16 LZMA_DEC99
000008ea R_386_PC16 LZMA_DEC99
00000916 R_386_PC16 LZMA_DEC99
00000930 R_386_PC16 LZMA_DEC99
000009ad R_386_PC16 LZMA_DEC99
000009d9 R_386_PC16 LZMA_DEC99
000009f3 R_386_PC16 LZMA_DEC99
00000a93 R_386_PC16 LZMA_DEC99
00000abf R_386_PC16 LZMA_DEC99
00000ad6 R_386_PC16 LZMA_DEC99
00000b8f R_386_PC16 LZMA_DEC99
00000bbb R_386_PC16 LZMA_DEC99
00000bd2 R_386_PC16 LZMA_DEC99
00000c90 R_386_PC16 LZMA_DEC99
00000cbc R_386_PC16 LZMA_DEC99
00000d27 R_386_PC16 LZMA_DEC99
00000d53 R_386_PC16 LZMA_DEC99
00000d6a R_386_PC16 LZMA_DEC99
00000e17 R_386_PC16 LZMA_DEC99
00000e3b R_386_PC16 LZMA_DEC99
00000e6b R_386_PC16 LZMA_DEC99
00000e73 R_386_PC16 LZMA_DEC99
RELOCATION RECORDS FOR [LZMA_DEC20]:
OFFSET TYPE VALUE
000000e5 R_386_PC16 LZMA_DEC99
0000011b R_386_PC16 LZMA_DEC99
00000127 R_386_PC16 LZMA_DEC99
00000170 R_386_PC16 LZMA_DEC99
00000199 R_386_PC16 LZMA_DEC99
000001b0 R_386_PC16 LZMA_DEC99
00000213 R_386_PC16 LZMA_DEC99
00000247 R_386_PC16 LZMA_DEC99
00000283 R_386_PC16 LZMA_DEC99
000002af R_386_PC16 LZMA_DEC99
000002c6 R_386_PC16 LZMA_DEC99
0000034c R_386_PC16 LZMA_DEC99
00000378 R_386_PC16 LZMA_DEC99
0000038f R_386_PC16 LZMA_DEC99
000003ff R_386_PC16 LZMA_DEC99
00000467 R_386_PC16 LZMA_DEC99
00000493 R_386_PC16 LZMA_DEC99
000004aa R_386_PC16 LZMA_DEC99
0000054e R_386_PC16 LZMA_DEC99
0000057a R_386_PC16 LZMA_DEC99
00000591 R_386_PC16 LZMA_DEC99
000005ff R_386_PC16 LZMA_DEC99
00000657 R_386_PC16 LZMA_DEC99
000006b0 R_386_PC16 LZMA_DEC99
000006d1 R_386_PC16 LZMA_DEC99
0000073a R_386_PC16 LZMA_DEC99
0000078e R_386_PC16 LZMA_DEC99
000007f8 R_386_PC16 LZMA_DEC99
00000824 R_386_PC16 LZMA_DEC99
0000083b R_386_PC16 LZMA_DEC99
000008ea R_386_PC16 LZMA_DEC99
00000916 R_386_PC16 LZMA_DEC99
00000930 R_386_PC16 LZMA_DEC99
000009ad R_386_PC16 LZMA_DEC99
000009d9 R_386_PC16 LZMA_DEC99
000009f3 R_386_PC16 LZMA_DEC99
00000a93 R_386_PC16 LZMA_DEC99
00000abf R_386_PC16 LZMA_DEC99
00000ad6 R_386_PC16 LZMA_DEC99
00000b8f R_386_PC16 LZMA_DEC99
00000bbb R_386_PC16 LZMA_DEC99
00000bd2 R_386_PC16 LZMA_DEC99
00000c90 R_386_PC16 LZMA_DEC99
00000cbc R_386_PC16 LZMA_DEC99
00000d27 R_386_PC16 LZMA_DEC99
00000d53 R_386_PC16 LZMA_DEC99
00000d6a R_386_PC16 LZMA_DEC99
00000e17 R_386_PC16 LZMA_DEC99
00000e3b R_386_PC16 LZMA_DEC99
00000e6b R_386_PC16 LZMA_DEC99
00000e73 R_386_PC16 LZMA_DEC99
00000005 R_386_16 lzma_stack_adjust
0000000d R_386_16 lzma_stack_adjust
00000015 R_386_16 lzma_u_len_hi
00000019 R_386_16 lzma_u_len
00000023 R_386_16 lzma_c_len_hi
00000027 R_386_16 lzma_c_len
00000033 R_386_16 lzma_properties_hi
00000039 R_386_16 lzma_properties
0000003e R_386_PC16 LZMA_DEC10
00000041 R_386_PC16 LZMA_DEC30
RELOCATION RECORDS FOR [LZMA_DEC30]:
OFFSET TYPE VALUE
00000001 R_386_16 lzma_u_len
00000004 R_386_16 lzma_u_len
RELOCATION RECORDS FOR [LZMA_DEC31]:
OFFSET TYPE VALUE