1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

::unpackExtent() honors per-block filter if newer 12-byte b_info

committer: jreiser <jreiser> 1036876078 +0000
This commit is contained in:
John Reiser 2002-11-09 21:07:58 +00:00
parent 33ec757c41
commit 5ac2eed3d9

View File

@ -360,14 +360,24 @@ void PackLinuxI386elf::unpackExtent(unsigned wanted, OutputFile *fo,
if (sz_cpr < sz_unc)
{
decompress(ibuf+j, ibuf, false);
if (first_PF_X) { // Elf32_Ehdr is never filtered
first_PF_X = false; // but everything else might be
if (12==szb_info) { // modern per-block filter
if (hdr.b_ftid) {
Filter ft(ph.level); // FIXME: ph.level for b_info?
ft.init(hdr.b_ftid, 0);
ft.cto = hdr.b_cto8;
ft.unfilter(ibuf, sz_unc);
}
}
else if (ph.filter) {
Filter ft(ph.level);
ft.init(ph.filter, 0);
ft.cto = ph.filter_cto;
ft.unfilter(ibuf, sz_unc);
else { // ancient per-file filter
if (first_PF_X) { // Elf32_Ehdr is never filtered
first_PF_X = false; // but everything else might be
}
else if (ph.filter) {
Filter ft(ph.level);
ft.init(ph.filter, 0);
ft.cto = ph.filter_cto;
ft.unfilter(ibuf, sz_unc);
}
}
j = 0;
}