Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmacete committed Oct 10, 2024
1 parent eeeda5b commit e8487d8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/gumjs/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -8137,6 +8137,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)
Expand Down

0 comments on commit e8487d8

Please sign in to comment.