From 88cd02d750d5861453d259192f9bacc0f6ae0260 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Mon, 25 Nov 2024 10:45:54 -0800 Subject: [PATCH] get_te64_32() gets 4-bit value, then detects 32-bit overflow modified: packer.h --- src/packer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/packer.h b/src/packer.h index 10ac758a..aa1a39df 100644 --- a/src/packer.h +++ b/src/packer.h @@ -309,6 +309,13 @@ protected: bele->set64(p, v); } #endif + template > + inline upx_uint64_t get_te64_32(const T *p) const { + upx_uint64_t val = get_te64(p); + if (val >> 32) + throwCantPack("64-bit value too big %#llx", val); + return (unsigned)val; + } protected: const N_BELE_RTP::AbstractPolicy *bele = nullptr; // TE - Target Endianness