arm/pe & w32/pe: disable filters for files with broken headers

committer: ml1050 <ml1050> 1145356307 +0000
This commit is contained in:
László Molnár 2006-04-18 10:31:47 +00:00
parent fb1181ed26
commit 2eb6e3b0ea
2 changed files with 14 additions and 0 deletions

View File

@ -1764,6 +1764,12 @@ void PackArmPe::pack(OutputFile *fo)
ft.addvalue = ih.codebase - rvamin;
// compress
int strategy = allow_filter ? 0 : -3;
// disable filters for files with broken headers
if (ih.codebase + ih.codesize > ph.u_len)
{
ft.buf_len = 1;
strategy = -3;
}
compressWithFilters(&ft, 2048, strategy,
NULL, 0, 0, ih.codebase, rvamin);
// info: see buildLoader()

View File

@ -1853,6 +1853,14 @@ void PackW32Pe::pack(OutputFile *fo)
ft.addvalue = ih.codebase - rvamin;
// compress
int strategy = allow_filter ? 0 : -3;
// disable filters for files with broken headers
if (ih.codebase + ih.codesize > ph.u_len)
{
ft.buf_len = 1;
strategy = -3;
}
compressWithFilters(&ft, 2048, strategy,
NULL, 0, 0, ih.codebase, rvamin);
// info: see buildLoader()