Use UPX_MAGIC_LE32 instead of PackHeader::magic.
committer: mfx <mfx> 977922670 +0000
This commit is contained in:
parent
0ffe40c621
commit
c3ec6b73e5
@ -348,9 +348,9 @@ void PackLinuxI386elf::pack(OutputFile *fo)
|
|||||||
ph.u_len = total_in;
|
ph.u_len = total_in;
|
||||||
ph.c_len = total_out;
|
ph.c_len = total_out;
|
||||||
|
|
||||||
// write header
|
// write packheader
|
||||||
const int hsize = ph.getPackHeaderSize();
|
const int hsize = ph.getPackHeaderSize();
|
||||||
set_le32(obuf, ph.magic); // note: always le32
|
set_le32(obuf, UPX_MAGIC_LE32); // note: always le32
|
||||||
patchPackHeader(obuf, hsize);
|
patchPackHeader(obuf, hsize);
|
||||||
fo->write(obuf, hsize);
|
fo->write(obuf, hsize);
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,7 @@ void PackUnix::pack(OutputFile *fo)
|
|||||||
|
|
||||||
// write packheader
|
// write packheader
|
||||||
const int hsize = ph.getPackHeaderSize();
|
const int hsize = ph.getPackHeaderSize();
|
||||||
set_le32(obuf, ph.magic); // note: always le32
|
set_le32(obuf, UPX_MAGIC_LE32); // note: always le32
|
||||||
patchPackHeader(obuf, hsize);
|
patchPackHeader(obuf, hsize);
|
||||||
fo->write(obuf, hsize);
|
fo->write(obuf, hsize);
|
||||||
|
|
||||||
|
|||||||
@ -584,7 +584,7 @@ int Packer::patchPackHeader(void *b, int blen)
|
|||||||
const int size = ph.getPackHeaderSize();
|
const int size = ph.getPackHeaderSize();
|
||||||
assert(isValidFilter(ph.filter));
|
assert(isValidFilter(ph.filter));
|
||||||
|
|
||||||
int boff = find_le32(b, blen, ph.magic);
|
int boff = find_le32(b, blen, UPX_MAGIC_LE32);
|
||||||
checkPatch(b, blen, boff, size);
|
checkPatch(b, blen, boff, size);
|
||||||
|
|
||||||
unsigned char *p = (unsigned char *)b + boff;
|
unsigned char *p = (unsigned char *)b + boff;
|
||||||
|
|||||||
@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// fields stored in compressed file
|
// fields stored in compressed file
|
||||||
enum { magic = UPX_MAGIC_LE32 };
|
//enum { magic = UPX_MAGIC_LE32 };
|
||||||
int version;
|
int version;
|
||||||
int format; // executable format
|
int format; // executable format
|
||||||
int method; // compresison method
|
int method; // compresison method
|
||||||
|
|||||||
@ -167,7 +167,7 @@ void PackHeader::putPackHeader(upx_bytep p)
|
|||||||
|
|
||||||
bool PackHeader::fillPackHeader(const upx_bytep buf, int blen)
|
bool PackHeader::fillPackHeader(const upx_bytep buf, int blen)
|
||||||
{
|
{
|
||||||
int boff = find_le32(buf, blen, magic);
|
int boff = find_le32(buf, blen, UPX_MAGIC_LE32);
|
||||||
if (boff < 0)
|
if (boff < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user