Stalker.follow
中的events
的属性含义
对于:
Interceptor.attach(funcRealStartAddr, {
onEnter: function(args) {
...
Stalker.follow(curTid, {
events: {
call: false, // CALL instructions: yes please
ret: true, // RET instructions
exec: false, // all instructions: not recommended as it's
block: false, // block executed: coarse execution trace
compile: false // block compiled: useful for coverage
},
// onReceive: Called with `events` containing a binary blob comprised of one or more GumEvent structs. See `gumevent.h` for details about the format. Use `Stalker.parse()` to examine the data.
onReceive(events) {
var parsedEvents = Stalker.parse(events)
// var parsedEventsStr = JSON.stringify(parsedEventsStr)
// console.log(">>> into onReceive: parsedEvents=" + parsedEvents + ", parsedEventsStr=" + parsedEventsStr);
console.log(">>> into onReceive: parsedEvents=" + parsedEvents);
},
// transform: (iterator: StalkerArm64Iterator) => {
transform: function (iterator) {
...
中:
Stalker.follow
中的events
的属性含义- 概述
Stalker.follow
中的events
中某个属性是true
,含义是:当出现对应指令,则触发对应event事件
- 详解
- 属性
- 对应的属性的含义是
call
:call指令Intel
=X86
的:call
指令ARM
的:BL
类的指令- 普通的=
arm64
的:BL
、BLR
等 arm64e
的,带PAC
的:BLRAA
、BLRAAZ
、BLRAB
、BLRABZ
等
- 普通的=
ret
:ret指令exec
:所有指令block
:(单个)block的(所有)指令compile
:特殊,(单个)block被编译时,仅用于测试代码覆盖率?
- 除去特殊的
compile
参数,其他几个参数,按照范围大小去划分,更容易理解:exec
:所有代码的级别block
:单个代码块的级别- 某些特殊指令的级别
call
:单独的call指令ret
:单独的ret指令
- 某些特殊指令的级别
- 对应的属性的含义是
- event事件
- 会触发
onReceive(events)
函数- 其中可以
events
是二进制(的blob
),需要去用Stalker.parse()
解析后才能看懂
- 其中可以
- 会触发
- 属性
- ->
events
和onReceive
的作用- 暂时不完全懂,只是知道,可以设置参数,决定
call
、ret
等指令的触发时去打印,其他用途暂时不清楚
- 暂时不完全懂,只是知道,可以设置参数,决定
- 概述