aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/src/stalker.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-11-15 17:14:04 +0000
committerYour Name <you@example.com>2021-11-15 17:14:04 +0000
commite1d3fe30dec150aa7111cb623a7362a8026963a8 (patch)
tree742fa445c7dcf1bf868bd025ee7680dd13b27604 /frida_mode/src/stalker.c
parentde90fd652e01797f129bfc23c24fa766b4c756a2 (diff)
downloadafl++-e1d3fe30dec150aa7111cb623a7362a8026963a8.tar.gz
Changes to allow configuration of stalker adjacent blocks
Diffstat (limited to 'frida_mode/src/stalker.c')
-rw-r--r--frida_mode/src/stalker.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/frida_mode/src/stalker.c b/frida_mode/src/stalker.c
index 35a9d856..65ed5d50 100644
--- a/frida_mode/src/stalker.c
+++ b/frida_mode/src/stalker.c
@@ -7,6 +7,7 @@
guint stalker_ic_entries = 0;
gboolean backpatch_enable = TRUE;
+guint stalker_adjacent_blocks = 0;
static GumStalker *stalker = NULL;
@@ -60,7 +61,9 @@ void stalker_config(void) {
backpatch_enable = (getenv("AFL_FRIDA_INST_NO_BACKPATCH") == NULL);
- stalker_ic_entries = util_read_num("AFL_FRIDA_STALKER_IC_ENTRIES");
+ stalker_ic_entries = util_read_num("AFL_FRIDA_STALKER_ADJACENT_BLOCKS");
+
+ stalker_adjacent_blocks = util_read_num("AFL_FRIDA_STALKER_IC_ENTRIES");
observer = g_object_new(GUM_TYPE_AFL_STALKER_OBSERVER, NULL);
@@ -92,6 +95,7 @@ void stalker_init(void) {
FOKF("Instrumentation - backpatch [%c]", backpatch_enable ? 'X' : ' ');
FOKF("Stalker - ic_entries [%u]", stalker_ic_entries);
+ FOKF("Stalker - adjacent_blocks [%u]", stalker_adjacent_blocks);
#if !(defined(__x86_64__) || defined(__i386__))
if (stalker_ic_entries != 0) {
@@ -100,13 +104,21 @@ void stalker_init(void) {
}
+ if (stalker_adjacent_blocks != 0) {
+
+ FFATAL("AFL_FRIDA_STALKER_ADJACENT_BLOCKS not supported");
+
+ }
+
#endif
if (stalker_ic_entries == 0) { stalker_ic_entries = 32; }
+ if (stalker_adjacent_blocks == 0) { stalker_adjacent_blocks = 32; }
+
#if defined(__x86_64__) || defined(__i386__)
- stalker =
- g_object_new(GUM_TYPE_STALKER, "ic-entries", stalker_ic_entries, NULL);
+ stalker = g_object_new(GUM_TYPE_STALKER, "ic-entries", stalker_ic_entries,
+ "adjacent-blocks", stalker_adjacent_blocks, NULL);
#else
stalker = gum_stalker_new();
#endif