Cleanups.
committer: mfx <mfx> 1034942507 +0000
This commit is contained in:
parent
69cec874a1
commit
565360a3f2
@ -58,7 +58,7 @@ PackDjgpp2::PackDjgpp2(InputFile *f) :
|
|||||||
|
|
||||||
const int *PackDjgpp2::getCompressionMethods(int method, int level) const
|
const int *PackDjgpp2::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level);
|
return Packer::getDefaultCompressionMethods_le32(method, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ PackLinuxI386elf::buildLoader(const Filter *ft)
|
|||||||
{
|
{
|
||||||
unsigned char tmp[sizeof(linux_i386elf_fold)];
|
unsigned char tmp[sizeof(linux_i386elf_fold)];
|
||||||
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
|
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
|
||||||
checkPatch(0,0,0,0); // reset
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
if (opt->unix.ptinterp) {
|
if (opt->unix.ptinterp) {
|
||||||
unsigned j;
|
unsigned j;
|
||||||
for (j = 0; j < sizeof(linux_i386elf_fold)-1; ++j) {
|
for (j = 0; j < sizeof(linux_i386elf_fold)-1; ++j) {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ static const
|
|||||||
|
|
||||||
const int *PackLinuxI386::getCompressionMethods(int method, int level) const
|
const int *PackLinuxI386::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level);
|
return Packer::getDefaultCompressionMethods_le32(method, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int *PackLinuxI386::getFilters() const
|
const int *PackLinuxI386::getFilters() const
|
||||||
@ -289,7 +289,7 @@ PackLinuxI386::buildLinuxLoader(
|
|||||||
int sz_cto = getLoaderSize();
|
int sz_cto = getLoaderSize();
|
||||||
if (0x20==(ft->id & 0xF0) || 0x30==(ft->id & 0xF0)) { // push byte '?' ; cto8
|
if (0x20==(ft->id & 0xF0) || 0x30==(ft->id & 0xF0)) { // push byte '?' ; cto8
|
||||||
patch_le16(ptr_cto, sz_cto, "\x6a?", 0x6a + (ft->cto << 8));
|
patch_le16(ptr_cto, sz_cto, "\x6a?", 0x6a + (ft->cto << 8));
|
||||||
checkPatch(0,0,0,0); // reset
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
}
|
}
|
||||||
// PackHeader and overlay_offset at the end of the output file,
|
// PackHeader and overlay_offset at the end of the output file,
|
||||||
// after the compressed data.
|
// after the compressed data.
|
||||||
@ -307,7 +307,7 @@ PackLinuxI386::buildLoader(Filter const *ft)
|
|||||||
// patch loader
|
// patch loader
|
||||||
// note: we only can use /proc/<pid>/fd when exetype > 0.
|
// note: we only can use /proc/<pid>/fd when exetype > 0.
|
||||||
// also, we sleep much longer when compressing a script.
|
// also, we sleep much longer when compressing a script.
|
||||||
checkPatch(0,0,0,0); // reset
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
patch_le32(buf,sz_fold,"UPX4",exetype > 0 ? 3 : 15); // sleep time
|
patch_le32(buf,sz_fold,"UPX4",exetype > 0 ? 3 : 15); // sleep time
|
||||||
patch_le32(buf,sz_fold,"UPX3",progid);
|
patch_le32(buf,sz_fold,"UPX3",progid);
|
||||||
patch_le32(buf,sz_fold,"UPX2",exetype > 0 ? 0 : 0x7fffffff);
|
patch_le32(buf,sz_fold,"UPX2",exetype > 0 ? 0 : 0x7fffffff);
|
||||||
|
|||||||
@ -66,7 +66,7 @@ PackLinuxI386sh::buildLoader(Filter const *ft)
|
|||||||
MemBuffer buf(sz_fold);
|
MemBuffer buf(sz_fold);
|
||||||
memcpy(buf, linux_i386sh_fold, sz_fold);
|
memcpy(buf, linux_i386sh_fold, sz_fold);
|
||||||
|
|
||||||
checkPatch(0,0,0,0); // reset
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
patch_le32(buf,sz_fold,"UPX3",l_shname);
|
patch_le32(buf,sz_fold,"UPX3",l_shname);
|
||||||
patch_le32(buf,sz_fold,"UPX2",o_shname);
|
patch_le32(buf,sz_fold,"UPX2",o_shname);
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ PackTmt::PackTmt(InputFile *f) : super(f)
|
|||||||
|
|
||||||
const int *PackTmt::getCompressionMethods(int method, int level) const
|
const int *PackTmt::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level);
|
return Packer::getDefaultCompressionMethods_le32(method, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ PackVmlinuzI386::PackVmlinuzI386(InputFile *f) :
|
|||||||
|
|
||||||
const int *PackVmlinuzI386::getCompressionMethods(int method, int level) const
|
const int *PackVmlinuzI386::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level);
|
return Packer::getDefaultCompressionMethods_le32(method, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ PackW32Pe::~PackW32Pe()
|
|||||||
const int *PackW32Pe::getCompressionMethods(int method, int level) const
|
const int *PackW32Pe::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
bool small = ih.codesize + ih.datasize <= 256*1024;
|
bool small = ih.codesize + ih.datasize <= 256*1024;
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level, small);
|
return Packer::getDefaultCompressionMethods_le32(method, level, small);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ static const
|
|||||||
|
|
||||||
const int *PackWcle::getCompressionMethods(int method, int level) const
|
const int *PackWcle::getCompressionMethods(int method, int level) const
|
||||||
{
|
{
|
||||||
return Packer::getDefaultCompressionMethods_LE32(method, level);
|
return Packer::getDefaultCompressionMethods_le32(method, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -712,7 +712,7 @@ int Packer::patch_be16(void *b, int blen, unsigned old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 2);
|
checkPatch(b, blen, boff, 2);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_be16(p,new_);
|
set_be16(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ int Packer::patch_be16(void *b, int blen, const void *old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 2);
|
checkPatch(b, blen, boff, 2);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_be16(p,new_);
|
set_be16(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ int Packer::patch_be32(void *b, int blen, unsigned old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 4);
|
checkPatch(b, blen, boff, 4);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_be32(p,new_);
|
set_be32(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -748,7 +748,7 @@ int Packer::patch_be32(void *b, int blen, const void *old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 4);
|
checkPatch(b, blen, boff, 4);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_be32(p,new_);
|
set_be32(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -760,7 +760,7 @@ int Packer::patch_le16(void *b, int blen, unsigned old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 2);
|
checkPatch(b, blen, boff, 2);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_le16(p,new_);
|
set_le16(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -772,7 +772,7 @@ int Packer::patch_le16(void *b, int blen, const void *old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 2);
|
checkPatch(b, blen, boff, 2);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_le16(p,new_);
|
set_le16(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -784,7 +784,7 @@ int Packer::patch_le32(void *b, int blen, unsigned old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 4);
|
checkPatch(b, blen, boff, 4);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_le32(p,new_);
|
set_le32(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -796,7 +796,7 @@ int Packer::patch_le32(void *b, int blen, const void *old, unsigned new_)
|
|||||||
checkPatch(b, blen, boff, 4);
|
checkPatch(b, blen, boff, 4);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
set_le32(p,new_);
|
set_le32(p, new_);
|
||||||
|
|
||||||
return boff;
|
return boff;
|
||||||
}
|
}
|
||||||
@ -941,7 +941,7 @@ const int *Packer::getDefaultCompressionMethods_8(int method, int level, int sma
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int *Packer::getDefaultCompressionMethods_LE32(int method, int level, int small) const
|
const int *Packer::getDefaultCompressionMethods_le32(int method, int level, int small) const
|
||||||
{
|
{
|
||||||
static const int m_nrv2b[] = { M_NRV2B_LE32, M_NRV2D_LE32, M_NRV2E_LE32, -1 };
|
static const int m_nrv2b[] = { M_NRV2B_LE32, M_NRV2D_LE32, M_NRV2E_LE32, -1 };
|
||||||
static const int m_nrv2d[] = { M_NRV2D_LE32, M_NRV2B_LE32, M_NRV2E_LE32, -1 };
|
static const int m_nrv2d[] = { M_NRV2D_LE32, M_NRV2B_LE32, M_NRV2E_LE32, -1 };
|
||||||
|
|||||||
@ -241,7 +241,7 @@ protected:
|
|||||||
|
|
||||||
// compression method util
|
// compression method util
|
||||||
const int *getDefaultCompressionMethods_8(int method, int level, int small=-1) const;
|
const int *getDefaultCompressionMethods_8(int method, int level, int small=-1) const;
|
||||||
const int *getDefaultCompressionMethods_LE32(int method, int level, int small=-1) const;
|
const int *getDefaultCompressionMethods_le32(int method, int level, int small=-1) const;
|
||||||
public:
|
public:
|
||||||
static bool isValidCompressionMethod(int method);
|
static bool isValidCompressionMethod(int method);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user