mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-2567 IDA Python 3 plugins
Updated IDA Pro plugins to be compatable with both python 2 and 3. Installation instructions are the same, however idaxml can alternatively be placed in the IDA python, IDA python/3, or IDA python/2 directories.
This commit is contained in:
parent
ff503596ac
commit
e6a86e91ca
4 changed files with 70 additions and 30 deletions
|
@ -22,6 +22,7 @@ This file must be placed in the IDA plugins directory.
|
|||
The file idaxml.py must be placed in the IDA python directory.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
import ida_auto
|
||||
import ida_idaapi
|
||||
import ida_kernwin
|
||||
|
@ -29,6 +30,10 @@ import idaxml
|
|||
import idc
|
||||
import sys
|
||||
|
||||
if sys.version_info.major >= 3:
|
||||
from idaxml import _exc_info
|
||||
sys.exc_value = lambda: _exc_info()[1]
|
||||
sys.exc_type = lambda: _exc_info()[0]
|
||||
|
||||
class XmlExporterPlugin(ida_idaapi.plugin_t):
|
||||
"""
|
||||
|
@ -72,12 +77,12 @@ class XmlExporterPlugin(ida_idaapi.plugin_t):
|
|||
except idaxml.Cancelled:
|
||||
ida_kernwin.hide_wait_box()
|
||||
msg = "XML Export cancelled!"
|
||||
print "\n" + msg
|
||||
print("\n" + msg)
|
||||
idc.warning(msg)
|
||||
except:
|
||||
ida_kernwin.hide_wait_box()
|
||||
msg = "***** Exception occurred: XML Exporter failed! *****"
|
||||
print "\n" + msg + "\n", sys.exc_type, sys.exc_value
|
||||
print("\n" + msg + "\n", sys.exc_type, sys.exc_value)
|
||||
idc.warning(msg)
|
||||
finally:
|
||||
xml.cleanup()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue