Method

GumStalkerset_trust_threshold

Declaration [src]

void
gum_stalker_set_trust_threshold (
  GumStalker* self,
  gint trust_threshold
)

Description [src]

Controls how Stalker copes with self-modifying code. Each recompiled block is cached alongside a snapshot of the original bytes; when the block is reached again Stalker compares the current code against that snapshot and recompiles only if it actually changed. The trust threshold is how many times a block must be found unchanged before Stalker stops doing that comparison and trusts the cached copy outright.

Higher values keep re-validating for longer, paying for the comparison (plus the prolog/epilog needed to enter Stalker) on each execution. 0 trusts a block immediately, never re-checking it. -1 never trusts the cache, so the snapshot is always compared — but even then a block is only recompiled when the code has genuinely changed, not on every execution. The default is 1.

Parameters

trust_threshold

Type: gint

Number of times a block must be seen unchanged before it is trusted.