mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-0: fix for opinion failures in dbgeng
This commit is contained in:
parent
b1a67cce48
commit
1e4882d82d
2 changed files with 12 additions and 6 deletions
|
@ -39,6 +39,7 @@ else:
|
||||||
def main():
|
def main():
|
||||||
# Delay these imports until sys.path is patched
|
# Delay these imports until sys.path is patched
|
||||||
from ghidradbg import commands as cmd
|
from ghidradbg import commands as cmd
|
||||||
|
from ghidradbg.hooks import on_stop
|
||||||
from ghidradbg.util import dbg
|
from ghidradbg.util import dbg
|
||||||
|
|
||||||
# So that the user can re-enter by typing repl()
|
# So that the user can re-enter by typing repl()
|
||||||
|
@ -51,15 +52,17 @@ def main():
|
||||||
args = ' ' + args
|
args = ' ' + args
|
||||||
cmd.ghidra_trace_create(
|
cmd.ghidra_trace_create(
|
||||||
os.getenv('OPT_TARGET_IMG') + args, start_trace=False)
|
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
|
# TODO: HACK
|
||||||
try:
|
try:
|
||||||
dbg.wait()
|
dbg.wait()
|
||||||
except KeyboardInterrupt as ki:
|
except KeyboardInterrupt as ki:
|
||||||
dbg.interrupt()
|
dbg.interrupt()
|
||||||
|
|
||||||
|
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG'))
|
||||||
|
cmd.ghidra_trace_sync_enable()
|
||||||
|
|
||||||
|
on_stop()
|
||||||
cmd.repl()
|
cmd.repl()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@ from . import util
|
||||||
|
|
||||||
|
|
||||||
language_map = {
|
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': [],
|
'Itanium': [],
|
||||||
'x86': ['x86:LE:32:default'],
|
'x86': ['x86:LE:32:default'],
|
||||||
'x86_64': ['x86:LE:64:default'],
|
'x86_64': ['x86:LE:64:default'],
|
||||||
|
@ -37,7 +38,7 @@ x86_compiler_map = {
|
||||||
}
|
}
|
||||||
|
|
||||||
arm_compiler_map = {
|
arm_compiler_map = {
|
||||||
'windows': 'windows',
|
'windows': 'default',
|
||||||
}
|
}
|
||||||
|
|
||||||
compiler_map = {
|
compiler_map = {
|
||||||
|
@ -57,12 +58,14 @@ def get_arch():
|
||||||
try:
|
try:
|
||||||
type = util.dbg.get_actual_processor_type()
|
type = util.dbg.get_actual_processor_type()
|
||||||
except Exception:
|
except Exception:
|
||||||
#print("Error getting actual processor type.")
|
print("Error getting actual processor type.")
|
||||||
return "Unknown"
|
return "Unknown"
|
||||||
if type is None:
|
if type is None:
|
||||||
return "x86_64"
|
return "x86_64"
|
||||||
if type == 0x8664:
|
if type == 0x8664:
|
||||||
return "x86_64"
|
return "x86_64"
|
||||||
|
if type == 0xAA64:
|
||||||
|
return "AARCH64"
|
||||||
if type == 0x014c:
|
if type == 0x014c:
|
||||||
return "x86"
|
return "x86"
|
||||||
if type == 0x01c0:
|
if type == 0x01c0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue