1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Changed the parameter list of Packer::patchFilter32(), for consisitency

with the other patch and filter methods.

committer: mfx <mfx> 976879665 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-12-15 11:27:45 +00:00
parent 0b93d6c1f5
commit cb7b0e93cf
7 changed files with 14 additions and 14 deletions

View File

@ -329,7 +329,7 @@ void PackDjgpp2::pack(OutputFile *fo)
// patch loader
patchPackHeader(loader,lsize);
patch_le32(loader,lsize,"ENTR",coff_hdr.a_entry);
patchFilter32(ft, loader, lsize);
patchFilter32(loader, lsize, &ft);
patch_le32(loader,lsize,"BSSL",overlapoh/4);
assert(bss->vaddr == ((size + 0x1ff) &~ 0x1ff) + (text->vaddr &~ 0x1ff));
patch_le32(loader,lsize,"OUTP",text->vaddr &~ 0x1ff);

View File

@ -223,7 +223,7 @@ void PackTmt::pack(OutputFile *fo)
// patch loader
patch_le32(loader,lsize,"JMPO",ih.entry-(ph.u_len+overlapoh+d_len));
patchFilter32(ft, loader, lsize);
patchFilter32(loader, lsize, &ft);
patchPackHeader(loader,e_len);
const unsigned jmp_pos = find_le32(loader,e_len,get_le32("JMPD"));

View File

@ -217,7 +217,7 @@ void PackVmlinuzI386::pack(OutputFile *fo)
memcpy(loader, getLoader(), lsize);
patchPackHeader(loader, lsize);
patchFilter32(ft, loader, lsize);
patchFilter32(loader, lsize, &ft);
patch_le32(loader, lsize, "ESI1", zimage_offset + lsize);
patch_le32(loader, lsize, "KEIP", kernel_entry);
patch_le32(loader, lsize, "STAK", stack_during_uncompression);
@ -298,7 +298,7 @@ void PackBvmlinuzI386::pack(OutputFile *fo)
MemBuffer loader(lsize);
memcpy(loader, getLoader(), lsize);
patchFilter32(ft, loader, lsize);
patchFilter32(loader, lsize, &ft);
patchPackHeader(loader, lsize);
const int e_len = getLoaderSectionStart("LZCUTPOI");

View File

@ -1721,7 +1721,7 @@ void PackW32Pe::pack(OutputFile *fo)
patch_le32(loader,codesize,"BIMP",cimports);
}
if (patchFilter32(ft, loader, lsize))
if (patchFilter32(loader, lsize, &ft))
{
const unsigned texv = ih.codebase - rvamin;
if (texv)

View File

@ -513,7 +513,7 @@ void PackWcle::pack(OutputFile *fo)
upx_byte *p = oimage+soimage-d_len;
patch_le32(p,d_len,"JMPO",ih.init_eip_offset+text_vaddr-(ic+d_len));
patch_le32(p,d_len,"ESP0",ih.init_esp_offset+IOT(ih.init_ss_object-1,my_base_address));
if (patchFilter32(ft, p, d_len) && text_vaddr)
if (patchFilter32(p, d_len, &ft) && text_vaddr)
patch_le32(p, d_len, "TEXV", text_vaddr);
patch_le32(p,d_len,"RELO",mps*pages);

View File

@ -1301,15 +1301,15 @@ void Packer::scanFilters(Filter *ft, const upx_byte *buf, unsigned buf_len,
}
bool Packer::patchFilter32(const Filter &ft, void *loader, unsigned lsize)
bool Packer::patchFilter32(void *loader, int lsize, const Filter *ft)
{
if (ft.id == 0)
if (ft->id == 0)
return false;
assert(ft.calls > 0);
if (ft.id > 0x20)
patch_le16(loader, lsize, "??", '?' + (ft.cto << 8));
patch_le32(loader, lsize, "TEXL", (ft.id & 0xf) % 3 == 0 ? ft.calls :
ft.lastcall - ft.calls * 4);
assert(ft->calls > 0);
if (ft->id > 0x20)
patch_le16(loader, lsize, "??", '?' + (ft->cto << 8));
patch_le32(loader, lsize, "TEXL", (ft->id & 0xf) % 3 == 0 ? ft->calls :
ft->lastcall - ft->calls * 4);
return true;
}

View File

@ -192,7 +192,7 @@ protected:
unsigned addvalue=0) const;
virtual void optimizeFilter(Filter *, const upx_byte *, unsigned) const
{ }
virtual bool patchFilter32(const Filter &, void *, unsigned);
virtual bool patchFilter32(void *, int, const Filter *ft);
// loader util
virtual int buildLoader(const Filter *) { return getLoaderSize(); }