We now use bin2h.pl to build stubify.h

committer: mfx <mfx> 968866969 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-09-13 17:42:49 +00:00
parent 9da2c2d087
commit de0f0c92be
5 changed files with 18 additions and 5 deletions

View File

@ -30,9 +30,8 @@
#include "packer.h" #include "packer.h"
#include "p_djgpp2.h" #include "p_djgpp2.h"
static const unsigned char stubify_stub[] = { static const
#include "stub/stubify.h" #include "stub/stubify.h"
};
static const static const
#include "stub/l_djgpp2.h" #include "stub/l_djgpp2.h"

View File

@ -22,6 +22,7 @@ l_t_n2d.h
l_t_n2ds.h l_t_n2ds.h
l_w32pe.h l_w32pe.h
l_wcle.h l_wcle.h
stubify.exe
stubify.h stubify.h
upxb upxb
upxd upxd

View File

@ -94,7 +94,7 @@ all: stubs upxb upxd
stubs: $(STUBS) stubs: $(STUBS)
mostlyclean: mostlyclean:
-rm -f *~ *.bin *.bkp *.i *.lst *.map -rm -f *~ *.bin *.bkp *.i *.lst *.map stubify.exe
clean: mostlyclean clean: mostlyclean
-rm -f *.o *.asx *.asy -rm -f *.o *.asx *.asy
@ -125,7 +125,8 @@ strings: all
stubify.h: stub.asm stubify.h: stub.asm
djasm $< $@ djasm $< stubify.exe
$(BIN2H) stubify.exe stubify_stub $@ -q
l_com.h: l_com.asx l_com.h: l_com.asx
$(NASM) -f bin -o $T.bin $< $(NASM) -f bin -o $T.bin $<

View File

@ -34,6 +34,9 @@ $ifile = shift || die;
$ident = shift || die; $ident = shift || die;
$ofile = shift || die; $ofile = shift || die;
$opt_q = "";
$opt_q = shift if ($#ARGV >= 0);
open(INFILE,$ifile) || die "$ifile\n"; open(INFILE,$ifile) || die "$ifile\n";
binmode(INFILE); binmode(INFILE);
open(OUTFILE,">$ofile") || die "$ofile\n"; open(OUTFILE,">$ofile") || die "$ofile\n";
@ -50,6 +53,7 @@ select(OUTFILE);
$o = $ofile; $o = $ofile;
$o =~ s/.*[\/\\]//; $o =~ s/.*[\/\\]//;
if ($opt_q ne "-q") {
print <<"EOF"; print <<"EOF";
/* $o -- created from $ifile, $n bytes /* $o -- created from $ifile, $n bytes
@ -79,6 +83,7 @@ print <<"EOF";
EOF EOF
}
printf("unsigned char %s[%d] = {", $ident, $n); printf("unsigned char %s[%d] = {", $ident, $n);
for ($i = 0; $i < $n; $i++) { for ($i = 0; $i < $n; $i++) {
@ -89,6 +94,13 @@ for ($i = 0; $i < $n; $i++) {
printf("%3d", ord(substr($data, $i, 1))); printf("%3d", ord(substr($data, $i, 1)));
print "," if ($i != $n - 1); print "," if ($i != $n - 1);
} }
while (($i % 16) != 0) {
$i++;
print " ";
}
printf(" /* 0x%4x */", $i - 16);
print "\n};\n"; print "\n};\n";
close(OUTFILE) || die; close(OUTFILE) || die;

View File

@ -1,2 +1,2 @@
#define UPX_VERSION_STRING "1.09.3" #define UPX_VERSION_STRING "1.09.3"
#define UPX_VERSION_DATE "Sep 10th 2000" #define UPX_VERSION_DATE "Sep 13th 2000"