File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ uintptr_t Process::find_pattern(const char *pattern) {
7575 };
7676
7777 const auto pattern_bytes = pattern_to_bytes (pattern);
78- const auto pattern_size = pattern_bytes.size ();
7978
8079 uintptr_t cur_address = 0 ;
8180 // this is an osu-specific optimization
@@ -105,10 +104,10 @@ uintptr_t Process::find_pattern(const char *pattern) {
105104 auto buffer = std::vector<std::byte>(info.RegionSize );
106105 read_memory<std::byte>(cur_address, buffer.data (), buffer.size ());
107106
108- for (size_t j = 0 ; j < buffer.size (); j++) {
107+ for (size_t j = 0 ; j < buffer.size () - pattern_bytes. size () ; j++) {
109108 bool hit = true ;
110109
111- for (size_t k = 0 ; k < pattern_size ; k++) {
110+ for (size_t k = 0 ; k < pattern_bytes. size () ; k++) {
112111 if (pattern_bytes[k] == -1 ) {
113112 continue ;
114113 }
You can’t perform that action at this time.
0 commit comments