Skip to content

Commit

Permalink
Updated idaxml to include the latest bug fixes from Ghidra
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Marcelli committed Feb 10, 2020
1 parent 97eef30 commit 87b1e61
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ghida_plugin/idaxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import idc
import datetime
import os
import sys
import time
from xml.etree import cElementTree

Expand Down Expand Up @@ -1178,9 +1179,9 @@ def export_memory_reference(self, addr, op):
elif idc.is_code(f) == True:
insn = ida_ua.insn_t()
ida_ua.decode_insn(insn, addr)
target = insn.ops[op].value - ri.tdelta + ri.base
target = (insn.ops[op].value - ri.tdelta + ri.base) & ((1 << 64) - 1)
elif idc.is_data(f) == True:
target = self.get_data_value(addr) - ri.tdelta + ri.base
target = (self.get_data_value(addr) - ri.tdelta + ri.base) & ((1 << 64) - 1)
else:
return
else:
Expand Down Expand Up @@ -1680,8 +1681,9 @@ def export_typeinfo_cmt(self, cmt):
cmt: String containing type info.
"""
# older versions of IDAPython returned a '\n' at end of cmt
while cmt[-1] == '\n':
cmt = cmt[:-1]
if(len(cmt) > 0):
while cmt[-1] == '\n':
cmt = cmt[:-1]
self.write_comment_element(TYPEINFO_CMT, cmt)

def export_user_memory_reference(self, addr):
Expand Down Expand Up @@ -3466,7 +3468,7 @@ def import_structure(self, structure):
if self.has_attribute(structure, NAMESPACE) == False:
return
namespace = self.get_attribute(structure, NAMESPACE)
name = namspace + '__' + name
name = namespace + '__' + name
name.replace('/', '_')
name.replace('.', '_')
dtyp = idc.get_struc_id(name)
Expand Down Expand Up @@ -3535,7 +3537,7 @@ def import_union(self, union):
if self.has_attribute(union, NAMESPACE) == False:
return
namespace = self.get_attribute(union, NAMESPACE)
name = namspace + '__' + name
name = namespace + '__' + name
name.replace('/', '_')
name.replace('.', '_')
dtyp = idc.get_struc_id(name)
Expand Down

0 comments on commit 87b1e61

Please sign in to comment.