Stalker的transform中Instruction的属性
Frida的Stalker的transform中Instruction指令,有哪些属性,参考官网:
https://frida.re/docs/javascript-api/#instruction
得知有如下属性:
address
next
size
mnemonic
opStr
operands
regsAccessed
regsRead
regsWritten
groups
toString()
toJSON()
注:但是没有(其实希望也有的)bytes
=opcode
属性。
而这些属性的来源是:Capstone
- Capstone
举例
如之前示例代码:
___lldb_unnamed_symbol2575$$akd · Frida逆向实例和工具函数
中的,但是注释掉的代码:
(注:当时没加regsAccessed
和toJSON()
)
// console.log("instruction: address=" + instruction.address
// + ",next=" + instruction.next()
// + ",size=" + instruction.size
// + ",mnemonic=" + instruction.mnemonic
// + ",opStr=" + instruction.opStr
// + ",operands=" + JSON.stringify(instruction.operands)
// + ",regsAccessed=" + JSON.stringify(instruction.regsAccessed)
// + ",regsRead=" + JSON.stringify(instruction.regsRead)
// + ",regsWritten=" + JSON.stringify(instruction.regsWritten)
// + ",groups=" + JSON.stringify(instruction.groups)
// + ",toString()=" + instruction.toString()
// + ",toJSON()=" + instruction.toJSON()
// );
取消注释后,可以输出log:
instruction: address=0x10f4ecef4,next=0x4,size=4,mnemonic=ldr,opStr=x0, #0x10f4ecf78,operands=[{"type":"reg","value":"x0","access":"w"},{"type":"imm","value":"4551790456","access":"r"}],regsRead=[],regsWritten=[],groups=[],toString()=ldr x0, #0x10f4ecf78
[0x10f4ecef4] ldr x0, #0x10f4ecf78
instruction: address=0x10f4ecef8,next=0x4,size=4,mnemonic=bl,opStr=#0x1091a500c,operands=[{"type":"imm","value":"4447686668","access":"r"}],regsRead=[],regsWritten=["lr"],groups=["call","jump","branch_relative"],toString()=bl #0x1091a500c
[0x10f4ecef8] bl #0x1091a500c