From 5ac2eed3d96d7abfcd25bc428e33868b2e8fa67f Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 9 Nov 2002 21:07:58 +0000 Subject: [PATCH] ::unpackExtent() honors per-block filter if newer 12-byte b_info committer: jreiser 1036876078 +0000 --- src/p_lx_elf.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index b4361236..96683b73 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -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; }