arm/pe & w32/pe: disable filters for files with broken headers
committer: ml1050 <ml1050> 1145356307 +0000
This commit is contained in:
@@ -1764,6 +1764,12 @@ void PackArmPe::pack(OutputFile *fo)
|
|||||||
ft.addvalue = ih.codebase - rvamin;
|
ft.addvalue = ih.codebase - rvamin;
|
||||||
// compress
|
// compress
|
||||||
int strategy = allow_filter ? 0 : -3;
|
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,
|
compressWithFilters(&ft, 2048, strategy,
|
||||||
NULL, 0, 0, ih.codebase, rvamin);
|
NULL, 0, 0, ih.codebase, rvamin);
|
||||||
// info: see buildLoader()
|
// info: see buildLoader()
|
||||||
|
|||||||
@@ -1853,6 +1853,14 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
ft.addvalue = ih.codebase - rvamin;
|
ft.addvalue = ih.codebase - rvamin;
|
||||||
// compress
|
// compress
|
||||||
int strategy = allow_filter ? 0 : -3;
|
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,
|
compressWithFilters(&ft, 2048, strategy,
|
||||||
NULL, 0, 0, ih.codebase, rvamin);
|
NULL, 0, 0, ih.codebase, rvamin);
|
||||||
// info: see buildLoader()
|
// info: see buildLoader()
|
||||||
|
|||||||
Reference in New Issue
Block a user