ida信息获取函数
idc. http://www.cnblogs.com/fply/p/8503929.html
获取ida可执行文件路径
GetIdaDirectory() print GetIdaDirectory()
/Applications/tool/IDA Pro 7.0/ida64.app/Contents/MacOS
获取被反编译文件名
GetInputFile()
获取被反编译文件全路径
GetInputFilePath()
SetInputFilePath(path):
Set input file name
This function updates the file name that is stored in the database
It is used by the debugger and other parts of IDA
Use it when the database is moved to another location or when you
use remote debugging.
@param path: new input file path
获取idb文件全路径
GetIdbPath()
获取输入文件md5值
GetInputMD5()
从程序idb文件中获取数据
IdbByte(ea)
获取多个字节
GetManyBytes(ea, size, use_dbg = False)
获取程序ea处字节
Byte(ea)
获取多个数据,调试状态
__DbgValue(ea, len)
获取调试内存数据
DbgByte(ea)
DbgWord
DbgDword
DbgQword
读取数据,调试状态,成功返回获取数据的字符串,失败抛出异常
DbgRead(ea,size)
写数据,data为字符串形式,返回写入长度,失败返回-1
DbgWrite(ea, data)
获取原始数据,
GetOriginalByte(ea)
通过名称获取地址
LocByName(name)
print LocByName("start")#获取起始位置
从指定位置通过名称获取地址
LocByNameEx(fromaddr, name)
获取段地址
SegByBase(base)
"""
Get segment by segment base @param base: segment base paragraph or selector @return: linear address of the start of the segment or BADADDR
if no such segment
获取光标地址
ScreenEA()
here()
获取当标处汇编代码
GetCurrentLine()
print GetCurrentLine()
__text:0000000100005318 FD 03 00 91 MOV x29,sp
获取选择区域的起始位置
SelStart()
SelEnd()
获取寄存器值
GetReg(ea, reg)
print GetReg(ea,"eax")#错误返回-1
NextAddr(ea)
PrevAddr(ea)
获取下条指令或者数据位置
NextHead(ea)
PrevHead(ea)#前一条
#尾部不显示
NextNotTail(ea)
获取指令或数据起始位置
ItemHead(ea)
获取指令长度
ItemSize(ea)
NameEx(fromaddr, ea)
GetTrueNameEx(fromaddr, ea)
Demangle(name, disable_mask)
获取汇编代码
GetDisasmEx(ea, flags)
GetDisasm(ea)
print GetDisasm(ea)
MOV X19, X1
获取指令助记符
print GetMnem(ea)#MOV
获取操作码
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 ""
print GetOpnd(ea,1)
获取操作码类型
GetOpType(ea, n)
"""
Get type of instruction operand @param ea: linear address of instruction
@param n: number of operand:
0 - the first operand
1 - the second operand @return: any of o_* constants or -1 on error o_void = idaapi.o_void # No Operand ----------
o_reg = idaapi.o_reg # General Register (al,ax,es,ds...) reg
o_mem = idaapi.o_mem # Direct Memory Reference (DATA) addr
o_phrase = idaapi.o_phrase # Memory Ref [Base Reg + Index Reg] phrase
o_displ = idaapi.o_displ # Memory Reg [Base Reg + Index Reg + Displacement] phrase+addr
o_imm = idaapi.o_imm # Immediate Value value
o_far = idaapi.o_far # Immediate Far Address (CODE) addr
o_near = idaapi.o_near # Immediate Near Address (CODE) addr
o_idpspec0 = idaapi.o_idpspec0 # Processor specific type
o_idpspec1 = idaapi.o_idpspec1 # Processor specific type
o_idpspec2 = idaapi.o_idpspec2 # Processor specific type
o_idpspec3 = idaapi.o_idpspec3 # Processor specific type
o_idpspec4 = idaapi.o_idpspec4 # Processor specific type
o_idpspec5 = idaapi.o_idpspec5 # Processor specific type
# There can be more processor specific types # x86
o_trreg = idaapi.o_idpspec0 # trace register
o_dbreg = idaapi.o_idpspec1 # debug register
o_crreg = idaapi.o_idpspec2 # control register
o_fpreg = idaapi.o_idpspec3 # floating point register
o_mmxreg = idaapi.o_idpspec4 # mmx register
o_xmmreg = idaapi.o_idpspec5 # xmm register # arm
o_reglist = idaapi.o_idpspec1 # Register list (for LDM/STM)
o_creglist = idaapi.o_idpspec2 # Coprocessor register list (for CDP)
o_creg = idaapi.o_idpspec3 # Coprocessor register (for LDC/STC)
o_fpreg_arm = idaapi.o_idpspec4 # Floating point register
o_fpreglist = idaapi.o_idpspec5 # Floating point register list
o_text = (idaapi.o_idpspec5+1) # Arbitrary text stored in the operand # ppc
o_spr = idaapi.o_idpspec0 # Special purpose register
o_twofpr = idaapi.o_idpspec1 # Two FPRs
o_shmbme = idaapi.o_idpspec2 # SH & MB & ME
o_crf = idaapi.o_idpspec3 # crfield x.reg
o_crb = idaapi.o_idpspec4 # crbit x.reg
o_dcr = idaapi.o_idpspec5 # Device control register
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
LineA(ea, num)
LineB(ea, num)
获取注释
GetCommentEx(ea, repeatable)
@param repeatable: 1 to get the repeatable comment, 0 to get the normal comment
同上
CommentEx(ea, repeatable)
获取手动修改的指令参数
AltOp(ea, n)
print AltOp(ea,0)
获取指定地址字符串
GetString(ea, length = -1, strtype = ASCSTR_C)
FindVoid (ea, flag)FindCode (ea, flag)#找到下一个代码位置FindData (ea, flag)FindUnexplored (ea, flag)FindExplored (ea, flag)FindImmediate (ea, flag, value) SEARCH_UP = idaapi.SEARCH_UP # search backward
SEARCH_DOWN = idaapi.SEARCH_DOWN # search forward
SEARCH_NEXT = idaapi.SEARCH_NEXT # start the search at the next/prev item
# useful only for FindText() and FindBinary()
SEARCH_CASE = idaapi.SEARCH_CASE # search case-sensitive
# (only for bin&txt search)
SEARCH_REGEX = idaapi.SEARCH_REGEX # enable regular expressions (only for text)
SEARCH_NOBRK = idaapi.SEARCH_NOBRK # don't test ctrl-break
SEARCH_NOSHOW = idaapi.SEARCH_NOSHOW # don't display the search progress
#查找字符串
FindText(ea, flag, y, x, searchstr)
"""
@param ea: start address
@param flag: combination of SEARCH_* flags
@param y: number of text line at ea to start from (0..MAX_ITEM_LINES)
@param x: coordinate in this line
@param searchstr: search string @return: ea of result or BADADDR if not found
FindBinary(ea, flag, searchstr, radix=16)
@param ea: start address
@param flag: combination of SEARCH_* flags
@param searchstr: a string as a user enters it for Search Text in Core
@param radix: radix of the numbers (default=16)
@return: ea of result or BADADDR if not found
@note: Example: "41 42" - find 2 bytes 41h,42h (radix is 16)
ida信息获取函数的更多相关文章
- Delphi 版本信息获取函数 GetFileVersionInfo、GetFileVersionInfoSize、VerFindFile、VerInstallFile和VerQueryValue
一.版本信息获取函数简介和作用 获取文件版本信息的作用: 1. 避免在新版本的组件上安装旧版本的相同组件: 2. 在多语言系统环境中,操作系统根据文件版本信息里提供的语言信息在启动程序时决定使用的正确 ...
- PHP文件信息获取函数
知识点: basename():获取文件名,传入第二个参数则只显示文件名,不显示后缀 dirname():获取文件路径 pathinfo():将文件信息存入一个数组,通过索引basename,dirn ...
- 【转】windows c++获取文件信息——_stat函数的使用
_stat函数的功能 _stat函数用来获取指定路径的文件或者文件夹的信息. 函数声明 int _stat( const char *path, struct _stat *buffer ); 参数: ...
- python装饰器内获取函数有用信息方法
装饰器内获取函数有用信息方法 .__doc__用于得到函数注释信息 .__name_用于得到函数名 在函数引用装饰器的时候,函数名会变为装饰器内部执行该函数的名字,所有在直接执行函数名加.__doc_ ...
- PE文件信息获取工具-PEINFO
能实现基本的信息获取 区段信息 数据目录信息 导入表函数分析 导出表函数分析,能同时解析只序号导出和以函数名序号同时导出的函数 FLC计算 需要源码的可以留邮箱.
- C++ crash 堆栈信息获取(三篇文章)
最近在做程序异常时堆栈信息获取相关工作,上一篇文章成功的在程序creash时写下了dump文件,而有些情况写dump文件是 不可以的,比如在jni开发时,C++只做底层处理,而整个项目是android ...
- C++ crash 堆栈信息获取
最近在做程序异常时堆栈信息获取相关工作,上一篇文章成功的在程序creash时写下了dump文件,而有些情况写dump文件是 不可以的,比如在jni开发时,C++只做底层处理,而整个项目是android ...
- Java获取函数参数名称
原理 编译之后的class文件默认是不带有参数名称信息的,使用 IDE 时,反编译jar包得到的源代码函数参数名称是 arg0,arg1......这种形式,这是因为编译 jar 包的时候没有把符号表 ...
- windows主机网络信息获取程序设计
掌握windows系统获取网络信息的各种API函数的功能与调用方法,掌握设计程序显示获取到相关网络信息的方法,掌握网络字节数据与主机字节数据之间的转换.掌握这些API函数调用的错误处理方法. 利用本地 ...
随机推荐
- 一块移动硬盘怎样兼容Mac和Windows系统,并且可以在time machine上使用
Mac的内存通常不是很大,加上使用Mac的time machine备份的话,是需要外置U盘或硬盘的.U盘存储空间较小,大家也不会去分区,直接拿来用在Mac上或者Windows上就可以了.所以这里只说硬 ...
- update-alternatives符号连接的层数过多
ls -l /opt/jdk/bin/java时,显示/opt/jdk/bin/java -> /usr/bin/java ls -l /usr/bin/ava时,显示/usr/bin/java ...
- [No0000168]Excle只允许用户输入纯文本,禁止用户修改单元格样式、格式等
背景:自己的模板给别人,让他填完信息上传到系统里,但别人经常不按模板的格式来填写,导致无法程序自动化.能不能在模板上把格式锁住,只允许输入纯文本,但不能改格式? 方法: 步骤一,创建你要的模板 其中, ...
- Vue 数据响应式原理
Vue 数据响应式原理 Vue.js 的核心包括一套“响应式系统”.“响应式”,是指当数据改变后,Vue 会通知到使用该数据的代码.例如,视图渲染中使用了数据,数据改变后,视图也会自动更新. 举个简单 ...
- 【紫书】uva489 Hangman Judge 做了很久Orz
题目链接:https://vjudge.net/problem/UVA-489 题意:给出两行字符串,第一行是标准答案,第二行是玩家猜的串.玩家每次猜一个,猜对一个,标准答案中所有该字符都算被猜到.猜 ...
- 网关 整理 fastcgi wsgi
https://www.cnblogs.com/hzhtracy/p/4365938.html 网关协议学习:CGI.FastCGI.WSGI.uWSGI 一直对这四者的概念和区别很模糊,现在就特 ...
- ionic中执行pop返回上一个页面,还需要执行操作
<ion-navbar> </ion-navbar> 从A页面push到B页面拿到数据以后,从B页面pop到A页面,在A页面展示刚刚拿到的数据,用 ionViewDidEnte ...
- 【软件测试】Junit入门
写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文! 本博客全网唯一合法URL:ht ...
- 解决pathForResource返回nil, 无法读取plist文件问题
有很多人在设置plist文件的时候, 会发现读取不了plist文件里面的内容, 返回值为nil, 下面我们来解决一下这个问题. 首先我们打开工程并且按照下面的步骤来设置: 设置好后, 我们来写一段代码 ...
- [skill][vim] 常用技巧与配置
一: 光标行列高亮 可以使用 :help highlight 查看相信帮助可颜色配置. set cursorline set cursorcolumn highlight Cursorline ct ...