From 5d71e69941f445f43cab72fa231fa170c50146c1 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 21 Nov 2006 18:01:16 +0100 Subject: [PATCH] Added two checks for throwCantPackExact. --- src/p_exe.cpp | 3 +++ src/packer.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/p_exe.cpp b/src/p_exe.cpp index c9129b11..85e9ec83 100644 --- a/src/p_exe.cpp +++ b/src/p_exe.cpp @@ -248,6 +248,9 @@ unsigned optimize_relocs(upx_byte *b, const unsigned size, const upx_byte *relocs, const unsigned nrelocs, upx_byte *crel, bool *has_9a) { + if (opt->exact) + throwCantPackExact(); + upx_byte * const crel_save = crel; unsigned i; unsigned seg_high = 0; diff --git a/src/packer.cpp b/src/packer.cpp index f773c671..eee80337 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -871,6 +871,9 @@ upx_byte *Packer::optimizeReloc32(upx_byte *in, unsigned relocnum, upx_byte *out, upx_byte *image, int bswap, int *big) { + if (opt->exact) + throwCantPackExact(); + *big = 0; if (relocnum == 0) return out;