If your head is clear, you get the clear ans.
def graphbuilder(t):
edge_list = []
for proc in t.findall('procedure'):
for frag in proc.findall('fragment'):
for op in frag.findall('op'):
operator = op.get('operator')
operand = op.get('operand')
if operator.startswith('call'):
if operand.startswith('dword'):
call_target = operand.rsplit(' ')[-1][:-1]
else:
call_target = operand
edge_list.append((proc.get('addr'), call_target))
return pydot.graph_from_edges(edge_list, directed=True)
0 件のコメント:
コメントを投稿