From a25c20ee0b4c0f287ed8d15f22968efe8994e184 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Thu, 20 Mar 2025 09:48:00 -0700 Subject: [PATCH] M_LZMA with hi parameter bytes confused --ultra-brute https://github.com/upx/upx/issues/900 modified: packhead.cpp modified: p_lx_elf.cpp --- src/p_lx_elf.cpp | 12 ++++++------ src/packhead.cpp | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index dc002b6b..d7f435aa 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -1534,7 +1534,7 @@ PackLinuxElf32::buildLinuxLoader( // SO_MAIN C-language supervision based on PT_LOADs char sec[120]; memset(sec, 0, sizeof(sec)); // debug convenience int len = 0; - unsigned m_decompr = methods_used | (1u << ph_forced_method(ph.method)); + unsigned m_decompr = methods_used | (1u << (0xFF & ph_forced_method(ph.method))); len += snprintf(sec, sizeof(sec), "%s", "SO_HEAD,ptr_NEXT,EXP_HEAD"); // Start of dasiy-chain fall-through. @@ -1586,7 +1586,7 @@ PackLinuxElf32::buildLinuxLoader( initLoader(fold, szfold); char sec[120]; memset(sec, 0, sizeof(sec)); // debug convenience int len = 0; - unsigned m_decompr = methods_used | (1u << ph_forced_method(ph.method)); + unsigned m_decompr = methods_used | (1u << (0xFF & ph_forced_method(ph.method))); len += snprintf(sec, sizeof(sec), "%s", ".text,EXP_HEAD"); if (((1u<