GP-0: fix for opinion failures in dbgeng

This commit is contained in:
d-millar 2024-06-06 21:33:03 +00:00 committed by ghidra1
parent b1a67cce48
commit 1e4882d82d
2 changed files with 12 additions and 6 deletions

View File

@ -39,6 +39,7 @@ else:
def main():
# Delay these imports until sys.path is patched
from ghidradbg import commands as cmd
from ghidradbg.hooks import on_stop
from ghidradbg.util import dbg
# So that the user can re-enter by typing repl()
@ -51,15 +52,17 @@ def main():
args = ' ' + args
cmd.ghidra_trace_create(
os.getenv('OPT_TARGET_IMG') + args, start_trace=False)
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG'))
cmd.ghidra_trace_sync_enable()
# TODO: HACK
try:
dbg.wait()
except KeyboardInterrupt as ki:
dbg.interrupt()
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG'))
cmd.ghidra_trace_sync_enable()
on_stop()
cmd.repl()

View File

@ -20,7 +20,8 @@ from . import util
language_map = {
'ARM': ['AARCH64:BE:64:v8A', 'AARCH64:LE:64:AppleSilicon', 'AARCH64:LE:64:v8A', 'ARM:BE:64:v8', 'ARM:LE:64:v8'],
'AARCH64': ['AARCH64:LE:64:AppleSilicon'],
'ARM': ['ARM:LE:32:v8'],
'Itanium': [],
'x86': ['x86:LE:32:default'],
'x86_64': ['x86:LE:64:default'],
@ -37,7 +38,7 @@ x86_compiler_map = {
}
arm_compiler_map = {
'windows': 'windows',
'windows': 'default',
}
compiler_map = {
@ -57,12 +58,14 @@ def get_arch():
try:
type = util.dbg.get_actual_processor_type()
except Exception:
#print("Error getting actual processor type.")
print("Error getting actual processor type.")
return "Unknown"
if type is None:
return "x86_64"
if type == 0x8664:
return "x86_64"
if type == 0xAA64:
return "AARCH64"
if type == 0x014c:
return "x86"
if type == 0x01c0: