arm/pe & w32/pe: disable filters for files with broken headers
committer: ml1050 <ml1050> 1145356307 +0000
This commit is contained in:
parent
fb1181ed26
commit
2eb6e3b0ea
@ -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()
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user