IDA Python安裝與使用

2022-01-24 08:01:10 字數 2500 閱讀 5640

ida python是ida6.8後自帶外掛程式,可以使用python做很多的輔助操作,非常方便的感覺。

從github上idapython專案獲取跟自己電腦ida、python對應的版本。

ida python手冊:

我的ida是6.8,python是2.7版本。

ida python安裝的說明:

1. install 2.6 or 2.7 from 

2. copy the whole "python" directory to %idadir%

3. copy the contents of the "plugins" directory to the %idadir%\plugins\

4. copy "python.cfg" to %idadir%\cfg

翻譯:

1、從安裝python 2.7版本。

2、複製安裝包內的python目錄到%idadir%(ida)目錄,%idadir%\python

3、複製安裝包內的plugins目錄到%idadir%(ida)目錄,%idadir%\plugins

4、複製安裝包內的"python.cfg" 到 %idadir%\cfg內

單行執行python (ctrl-f3)

檢視現有的ida指令碼檔案 (alt+f9)

網上找到的python**是拿printf做的測試,可是我這邊好像沒有能解析printf函式,所以我用了isprocessorfeaturepresent函式做示例。

單個函式測試:

#coding:utf-8

from idaapi import *

danger_funcs = ["isprocessorfeaturepresent"] # 需要尋找的函式名

for func in danger_funcs:

addr = locbyname( func )

if addr != badaddr:

#找到交叉引用的位址

cross_refs = coderefsto( addr, 0 )

print "cross references to %s" % func

print "-------------------------------"

for ref in cross_refs:

print "%08x" % ref

# 函式的顏色為紅色

setcolor( ref, cic_item, 0x0000ff)

多個函式需要識別的時候就可以把**寫得更加規範一些。

#

## another way to search all not safe functions

##coding:utf-8

from idaapi import *

# 設定顏色

def judgeaduit(addr):

'''not safe function handler

'''makecomm(addr,"### audit here ###")

setcolor(addr,cic_item,0x0000ff) #set backgroud to red

pass

# 函式標識

def flagcalls(danger_funcs):

'''not safe function finder

'''count = 0

for func in danger_funcs:

faddr = locbyname( func )

if faddr != badaddr:

# grab the cross-references to this address

cross_refs = coderefsto( faddr, 0 )

for addr in cross_refs:

count += 1

message("%s[%d] calls 0x%08x\n"%(func,count,addr))

judgeaduit(addr)

if __name__ == '__main__':

'''handle all not safe functions

'''print "-------------------------------"

# 列表儲存需要識別的函式

安裝/指令碼之收集函式的呼叫資訊/

IDApython使用RPC通訊批量處理模組資訊

idapython非常強大,但是每次執行一次idapython只能輸出乙個模組的資訊。如果想同時處理多個模組的資訊,python的rpc服務通訊機制可以作為乙個不錯的選擇。這裡主要講的是使用rpc通訊需要注意的一些問題,防止逆向人員像我一樣踩坑。rpc通訊具體實現 可以參考 python3的可以看這...

pythonpip安裝與使用 pip安裝與使用

簡介 檢驗pip是否安裝 python3.x版本命令 pip3 version python2.x版本命令 pip version 若尚未安裝,安裝方法 curl o get pip.py 執行安裝指令碼 sudo python get pip.py pip常用命令 顯示版本和路徑 pip vers...

Struts安裝與使用

struts可以執行在任何乙個支援jsp1.2和servlet2.3的web container中struts將所有的請求提交到同乙個中心控制器,org.apache.struts.action.actionservlet 類 web.xml配置 servlet name action servle...