# a IDAPython script : give two instruction close to each other like move add , it find their binary representation
from idaapi import *
from idc import *
import os
import sys
class Inst_search:
def __init__(self , inst1 , inst2):
self.inst1 = inst1
self.inst2 = inst2
self.openfile()
def printself(self):
print self.inst1,self.inst2
def printAinstr(self,startea, Itemsize):
out = []
strr = '0000000'
for i in range(startea, Itemsize+startea):
strq = str(bin(GetOriginalByte(i)))[2:]
n = len(strq)
strq = strr[0:8 - n] + strq
out.append(strq)
return str(''.join(out))
def searchinfun(self,fun):
it = func_item_iterator_t(fun)
t = True
while t:
ea = it.current()
inst11 = ua_mnem(ea)
if(it.next_code()):
IDAPython 编程之 查找相邻指令
最新推荐文章于 2021-10-08 09:29:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)