From 70ed2d0d03f56f8e0b03ef8bca08f74cb7fc475c Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 26 Jan 2019 07:49:57 -0800 Subject: [PATCH] Allow Load Configuration directory > 256, with info(). https://github.com/upx/upx/issues/245 modified: pefile.cpp --- src/pefile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pefile.cpp b/src/pefile.cpp index 03ea2fcc..8adfd2f4 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -1432,8 +1432,9 @@ void PeFile::processLoadConf(Interval *iv) // pass 1 soloadconf = get_le32(loadconf); if (soloadconf == 0) return; - if (soloadconf > 256) - throwCantPack("size of Load Configuration directory unexpected"); + static int const MAX_SOLOADCONF = 256; // XXX FIXME: Why? + if (soloadconf > MAX_SOLOADCONF) + info("Load Configuration directory %d > %d", soloadconf, MAX_SOLOADCONF); // if there were relocation entries referring to the load config table // then we need them for the copy of the table too