diff --git a/src/p_djgpp2.cpp b/src/p_djgpp2.cpp index 580200fd..90d4decc 100644 --- a/src/p_djgpp2.cpp +++ b/src/p_djgpp2.cpp @@ -30,9 +30,8 @@ #include "packer.h" #include "p_djgpp2.h" -static const unsigned char stubify_stub[] = { +static const #include "stub/stubify.h" -}; static const #include "stub/l_djgpp2.h" diff --git a/src/stub/.cvsignore b/src/stub/.cvsignore index 84d4ad0a..a8789a72 100644 --- a/src/stub/.cvsignore +++ b/src/stub/.cvsignore @@ -22,6 +22,7 @@ l_t_n2d.h l_t_n2ds.h l_w32pe.h l_wcle.h +stubify.exe stubify.h upxb upxd diff --git a/src/stub/Makefile b/src/stub/Makefile index 1a8d0f22..5590c512 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -94,7 +94,7 @@ all: stubs upxb upxd stubs: $(STUBS) mostlyclean: - -rm -f *~ *.bin *.bkp *.i *.lst *.map + -rm -f *~ *.bin *.bkp *.i *.lst *.map stubify.exe clean: mostlyclean -rm -f *.o *.asx *.asy @@ -125,7 +125,8 @@ strings: all stubify.h: stub.asm - djasm $< $@ + djasm $< stubify.exe + $(BIN2H) stubify.exe stubify_stub $@ -q l_com.h: l_com.asx $(NASM) -f bin -o $T.bin $< diff --git a/src/stub/scripts/bin2h.pl b/src/stub/scripts/bin2h.pl index fd4356b2..8ba135ae 100644 --- a/src/stub/scripts/bin2h.pl +++ b/src/stub/scripts/bin2h.pl @@ -34,6 +34,9 @@ $ifile = shift || die; $ident = shift || die; $ofile = shift || die; +$opt_q = ""; +$opt_q = shift if ($#ARGV >= 0); + open(INFILE,$ifile) || die "$ifile\n"; binmode(INFILE); open(OUTFILE,">$ofile") || die "$ofile\n"; @@ -50,6 +53,7 @@ select(OUTFILE); $o = $ofile; $o =~ s/.*[\/\\]//; +if ($opt_q ne "-q") { print <<"EOF"; /* $o -- created from $ifile, $n bytes @@ -79,6 +83,7 @@ print <<"EOF"; EOF +} printf("unsigned char %s[%d] = {", $ident, $n); for ($i = 0; $i < $n; $i++) { @@ -89,6 +94,13 @@ for ($i = 0; $i < $n; $i++) { printf("%3d", ord(substr($data, $i, 1))); print "," if ($i != $n - 1); } + +while (($i % 16) != 0) { + $i++; + print " "; +} +printf(" /* 0x%4x */", $i - 16); + print "\n};\n"; close(OUTFILE) || die; diff --git a/src/version.h b/src/version.h index a82f2c83..9cc38914 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ #define UPX_VERSION_STRING "1.09.3" -#define UPX_VERSION_DATE "Sep 10th 2000" +#define UPX_VERSION_DATE "Sep 13th 2000"