From 193e085cf0b388b4d072bbb97bbf6f04e1340db1 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 28 Jun 2006 22:30:05 -0700 Subject: [PATCH] limit stack to ~28KB for decompressing kernel --- src/p_vmlinx.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/p_vmlinx.cpp b/src/p_vmlinx.cpp index 8f2d40de..19d2562c 100644 --- a/src/p_vmlinx.cpp +++ b/src/p_vmlinx.cpp @@ -220,7 +220,12 @@ void PackVmlinuxI386::pack(OutputFile *fo) ft.buf_len = ph.u_len; ft.addvalue = 0; // we are independent of actual runtime address; see ckt32 - compressWithFilters(&ft, 1 << 20); + upx_compress_config_t cconf; cconf.reset(); +#if 1 //{ + // limit stack size needed for runtime decompression + cconf.conf_lzma.max_num_probs = 1846 + (768 << 4); // ushort: ~28KB stack +#endif //} + compressWithFilters(&ft, 512, 0, NULL, &cconf); const unsigned lsize = getLoaderSize(); MemBuffer loader(lsize);