diff --git a/gum/gummemory.c b/gum/gummemory.c index 26c800dd5..871c82181 100644 --- a/gum/gummemory.c +++ b/gum/gummemory.c @@ -576,8 +576,8 @@ gum_match_pattern_new_from_regex (const gchar * regex_str) GumMatchPattern * pattern; GRegex * regex; - regex = g_regex_new (regex_str, G_REGEX_OPTIMIZE, G_REGEX_MATCH_NOTEMPTY, - NULL); + regex = g_regex_new (regex_str, G_REGEX_OPTIMIZE | G_REGEX_RAW, + G_REGEX_MATCH_NOTEMPTY, NULL); if (regex == NULL) return NULL; diff --git a/releng b/releng index d1e77f19c..4622f5c4c 160000 --- a/releng +++ b/releng @@ -1 +1 @@ -Subproject commit d1e77f19c6d21e647f3f57b4701256f8306c670d +Subproject commit 4622f5c4c432d94c1c625e598b120425a68a8414 diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index 42afd58e9..ed040571d 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -8139,6 +8139,22 @@ TESTCASE (memory_can_be_scanned_with_match_pattern_object) EXPECT_SEND_MESSAGE_WITH ("\"onMatch offset=0 size=11\""); EXPECT_SEND_MESSAGE_WITH ("\"onMatch offset=13 size=11\""); EXPECT_SEND_MESSAGE_WITH ("\"onComplete\""); + + haystack2[7] = 0xd1; + + COMPILE_AND_LOAD_SCRIPT ( + "const pattern = new MatchPattern(/Hello/.toString());" + "Memory.scan(" GUM_PTR_CONST ", 33, pattern, {" + "onMatch(address, size) {" + " send('onMatch offset=' + address.sub(" GUM_PTR_CONST + ").toInt32() + ' size=' + size);" + "}," + "onComplete() {" + " send('onComplete');" + "}" + "});", haystack2, haystack2); + EXPECT_SEND_MESSAGE_WITH ("\"onMatch offset=0 size=5\""); + EXPECT_SEND_MESSAGE_WITH ("\"onComplete\""); } TESTCASE (memory_can_be_scanned_synchronously)