mirror of https://github.com/geohot/qira
analyzer hack
This commit is contained in:
parent
d93d7a0586
commit
3437833068
|
@ -624,6 +624,13 @@ class Trace:
|
|||
maxclnum = self.db.get_maxclnum()
|
||||
self.flow = qira_analysis.get_instruction_flow(self, self.program, minclnum, maxclnum)
|
||||
self.dmap = qira_analysis.get_hacked_depth_map(self.flow, self.program)
|
||||
|
||||
# hacky pin offset problem fix
|
||||
hpo = len(self.dmap)-(maxclnum-minclnum)
|
||||
print hpo
|
||||
if hpo == 2:
|
||||
self.dmap = self.dmap[1:]
|
||||
|
||||
self.maxd = max(self.dmap)
|
||||
self.picture = qira_analysis.get_vtimeline_picture(self, minclnum, maxclnum)
|
||||
self.minclnum = minclnum
|
||||
|
|
|
@ -199,36 +199,47 @@ def graph_dot():
|
|||
|
||||
def init_radare(path):
|
||||
core = RCore()
|
||||
"""
|
||||
desc = core.io.open(path, 0, 0)
|
||||
if desc == None:
|
||||
print "*** RBIN LOAD FAILED"
|
||||
return False
|
||||
core.bin.load(path, 0, 0, 0, desc.fd, False)
|
||||
print "*** radare bin loaded @",ghex(core.bin.get_baddr())
|
||||
"""
|
||||
|
||||
"""
|
||||
for e in core.bin.get_entries():
|
||||
print e
|
||||
"""
|
||||
|
||||
"""
|
||||
for s in core.bin.get_symbols():
|
||||
print s.name
|
||||
print ghex(s.vaddr), s.name
|
||||
"""
|
||||
|
||||
"""
|
||||
# why do i need to do this?
|
||||
info = core.bin.get_info()
|
||||
core.config.set("asm.arch", info.arch);
|
||||
core.config.set("asm.bits", str(info.bits));
|
||||
#core.file_open(path, 0, 0)
|
||||
|
||||
# find functions
|
||||
core.search_preludes()
|
||||
"""
|
||||
#core.config.set ("asm.arch", "x86");
|
||||
#core.config.set ("asm.bits", "32");
|
||||
|
||||
f = core.file_open(path, False, 0)
|
||||
core.bin_load("", 0)
|
||||
core.anal_all()
|
||||
|
||||
print core.cmd_str("ap")
|
||||
import collections
|
||||
tags = collections.defaultdict(dict)
|
||||
|
||||
for f in core.anal.get_fcns():
|
||||
print f.name, f.addr
|
||||
|
||||
#print dir(core)
|
||||
|
||||
#print (core.cmd_str ("pd 12 @ _start"))
|
||||
print f.name, ghex(f.addr), f.size
|
||||
"""
|
||||
for b in f.get_bbs():
|
||||
print " ", ghex(b.addr), ghex(b.size)
|
||||
"""
|
||||
#for i in
|
||||
|
||||
|
||||
def init_static(lprogram):
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue