idapython api 记录,idapythonapi,GetOperand
idapython api 记录,idapythonapi,GetOperand
GetOperandValue
作用
参数1: ea 虚拟地址参数2: 操作数号返回指令的操作数的被解析过的值
文档
def GetOperandValue(ea, n): """ Get number used in the operand This function returns an immediate number used in the operand @param ea: linear address of instruction @param n: the operand number @return: value operand is an immediate value => immediate value operand has a displacement => displacement operand is a direct memory ref => memory address operand is a register => register number operand is a register phrase => phrase number otherwise => -1 """
实例
.text:080488C9 cmp eax, 1.text:080488CC jz short loc_80488D8.text:080488CE sub esp, 0Ch
其中 080488CC 处的指令的16进制表示为
74 0A
这一条指令有一个操作数,所以通过 GetOperandValue 可以获取获取通过 ida 解析的值。
Python>hex(GetOperandValue(0x080488CC,0))0x80488d8L
GetMnem
作用
参数1: ea 虚拟地址返回指令的操作码的助记符
文档
def GetMnem(ea): """ Get instruction mnemonics @param ea: linear address of instruction @return: "" - no instruction at the specified location
实例
.text:080488C9 cmp eax, 1.text:080488CC jz short loc_80488D8.text:080488CE sub esp, 0Ch
Python>GetMnem(0x80488CC)jz
GetOpnd
作用
参数1: ea 虚拟地址参数2: 操作数索引返回指令的操作数
文档
def GetOpnd(ea, n): """ Get operand of an instruction @param ea: linear address of instruction @param n: number of operand: 0 - the first operand 1 - the second operand @return: the current text representation of operand or "" """
实例
.text:080488C9 cmp eax, 1.text:080488CC jz short loc_80488D8.text:080488CE sub esp, 0Ch
Python>GetOpnd(0x80488CC,0)loc_80488D8
GetDisasm
作用
参数1: ea 虚拟地址得到指令的反汇编字符串
文档
def GetDisasm(ea): """ Get disassembly line @param ea: linear address of instruction @return: "" - could not decode instruction at the specified location @note: this function may not return exactly the same mnemonics as you see on the screen. """
实例
.text:080488C9 cmp eax, 1.text:080488CC jz short loc_80488D8.text:080488CE sub esp, 0Ch
Python>GetDisasm(0x80488CC)jz short loc_80488D8
PrevHead 和 NextHead
作用
参数1: ea 虚拟地址得到前一条或者后一条指令的地址
实例
.text:080488AF add esp, 10h.text:080488B2 mov [ebp+fd], eax.text:080488B5 sub esp, 4
Python>hex(PrevHead(0x080488B2))0x80488afLPython>hex(NextHead(0x080488B2))0x80488b5L
idapython api 记录
相关内容
- python接口自动化23-token参数关联登录(登录拉勾网),
- 怎么做到Python file重复写入之前的内容不被后写入的覆
- python 删除字典某个key(键)及对应值,pythonkey,删除字典元
- python3开发进阶-Django框架中form的校验方法is_valid()的源码
- Python 随笔之Redis,python随笔redis,Python学习记录
- python接口测试之401错误的分析和解决(十六),python
- Centos上安装python3.5以上版本,centospython3.5,h3 { color
- python padas 学习,pythonpadas,import mat
- python-字典练习,python-字典,备注:此次练习使用3
- python如何通过实例方法名字调用方法,python实例
评论关闭