From 8f2d56b77696b27c832d2e17a12e982936a81c8d Mon Sep 17 00:00:00 2001 From: Stephen Eckels Date: Mon, 19 Aug 2024 15:13:34 +0000 Subject: [PATCH] Simplify data_end calculation --- objfile/patterns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objfile/patterns.go b/objfile/patterns.go index 07ac11e..53aeb51 100644 --- a/objfile/patterns.go +++ b/objfile/patterns.go @@ -247,7 +247,7 @@ func FindRegex(data []byte, regexInfo *RegexAndNeedle) []int { for _, needleMatch := range needleMatches { // adjust the window to the pattern start and end data_start := needleMatch - regexInfo.needleOffset - data_end := needleMatch + regexInfo.len - regexInfo.needleOffset + data_end := data_start + regexInfo.len if data_start >= data_len { continue }