From e2d7de060efd18aecc9524b8fde5e80004f8bc1f Mon Sep 17 00:00:00 2001 From: Ramok <63268168+ramok0@users.noreply.github.com> Date: Fri, 12 Apr 2024 01:34:53 +0200 Subject: [PATCH] feat(FindStringRef): impl find_first --- memcury.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/memcury.h b/memcury.h index d4b3d54..b4ac41e 100644 --- a/memcury.h +++ b/memcury.h @@ -748,7 +748,7 @@ namespace Memcury // Supports wide and normal strings both std and pointers template - static auto FindStringRef(T string) -> Scanner + static auto FindStringRef(T string, bool find_first = false) -> Scanner { PE::Address add { nullptr }; @@ -788,6 +788,8 @@ namespace Memcury if (leaT == string) { add = PE::Address(&scanBytes[i]); + if(find_first) + break; } } else @@ -799,6 +801,8 @@ namespace Memcury if (wcscmp(string, lea) == 0) { add = PE::Address(&scanBytes[i]); + if(find_first) + break; } } else @@ -806,6 +810,8 @@ namespace Memcury if (strcmp(string, lea) == 0) { add = PE::Address(&scanBytes[i]); + if(find_first) + break; } } }