diff --git a/BigBaseV2/src/memory/range.cpp b/BigBaseV2/src/memory/range.cpp index dfd7566d..1853b4f6 100644 --- a/BigBaseV2/src/memory/range.cpp +++ b/BigBaseV2/src/memory/range.cpp @@ -106,6 +106,24 @@ namespace memory return true; } + + handle range::bruteforce_scan(pattern const& sig) + { + auto data = sig.m_bytes.data(); + auto length = sig.m_bytes.size(); + + const auto scan_end = m_size - length; + for (std::uintptr_t i{}; i != scan_end; ++i) + { + if (pattern_matches(m_base.add(i).as(), data, length)) + { + return m_base.add(i); + } + } + + return nullptr; + } + std::vector range::scan_all(pattern const &sig) { std::vector result{}; diff --git a/BigBaseV2/src/memory/range.hpp b/BigBaseV2/src/memory/range.hpp index 0ba302c4..90b13254 100644 --- a/BigBaseV2/src/memory/range.hpp +++ b/BigBaseV2/src/memory/range.hpp @@ -17,6 +17,7 @@ namespace memory bool contains(handle h); handle scan(pattern const& sig); + handle bruteforce_scan(pattern const& sig); std::vector scan_all(pattern const& sig); protected: handle m_base; diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 9818a2ca..4a1e4eca 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -345,13 +345,13 @@ namespace big * Freemode thread restorer through VM patch */ - if (auto pat1 = mem_region.scan("3b 0a 0f 83 ? ? ? ? 48 ff c7")) + if (auto pat1 = mem_region.bruteforce_scan("3b 0a 0f 83 ? ? ? ? 48 ff c7")) { *pat1.add(2).as() = 0xc9310272; *pat1.add(6).as() = 0x9090; } - if (auto pat2 = mem_region.scan("3b 0a 0f 83 ? ? ? ? 49 03 fa")) + if (auto pat2 = mem_region.bruteforce_scan("3b 0a 0f 83 ? ? ? ? 49 03 fa")) { *pat2.add(2).as() = 0xc9310272; *pat2.add(6).as() = 0x9090;