diff --git a/src/binwalk/modules/heuristics.py b/src/binwalk/modules/heuristics.py index eb7a6c9..23bfdaf 100644 --- a/src/binwalk/modules/heuristics.py +++ b/src/binwalk/modules/heuristics.py @@ -101,7 +101,7 @@ class HeuristicCompressionAnalyzer(Module): long='trigger', kwargs={'trigger_level' : 0}, type=float, - description='Set the entropy trigger level (0.0 - 1.0)'), + description='Set the entropy trigger level (0.0 - 1.0, default: %.2f)' % ENTROPY_TRIGGER), ] KWARGS = [ @@ -114,6 +114,12 @@ class HeuristicCompressionAnalyzer(Module): self.HEADER[-1] = "HEURISTIC ENTROPY ANALYSIS" + # Trigger level sanity check + if self.trigger_level > 1.0: + self.trigger_level = 1.0 + elif self.trigger_level < 0.0: + self.trigger_level = 0.0 + if self.config.block: self.block_size = self.config.block else: