mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
Merge remote-tracking branch 'origin/Ghidra_12.0'
This commit is contained in:
commit
96506554e7
2 changed files with 6 additions and 5 deletions
|
@ -658,6 +658,7 @@ class _PyGhidraStdOut:
|
|||
|
||||
def __init__(self, stream):
|
||||
self._stream = stream
|
||||
self.is_error = stream == sys.stderr
|
||||
|
||||
def _get_current_script(self) -> "PyGhidraScript":
|
||||
for entry in inspect.stack():
|
||||
|
@ -668,7 +669,7 @@ class _PyGhidraStdOut:
|
|||
def flush(self):
|
||||
script = self._get_current_script()
|
||||
if script is not None:
|
||||
writer = script._script.writer
|
||||
writer = script._script.errorWriter if self.is_error else script._script.writer
|
||||
if writer is not None:
|
||||
writer.flush()
|
||||
return
|
||||
|
@ -678,7 +679,7 @@ class _PyGhidraStdOut:
|
|||
def write(self, s: str) -> int:
|
||||
script = self._get_current_script()
|
||||
if script is not None:
|
||||
writer = script._script.writer
|
||||
writer = script._script.errorWriter if self.is_error else script._script.writer
|
||||
if writer is not None:
|
||||
writer.write(s)
|
||||
return len(s)
|
||||
|
|
|
@ -279,11 +279,11 @@ def main() -> None:
|
|||
|
||||
# Launch PyGhidra
|
||||
save_python_cmd(install_dir, python_cmd, args.dev)
|
||||
py_args: List[str] = python_cmd + ['-m', 'pyghidra.ghidra_launch', '--install-dir', str(install_dir)]
|
||||
py_args: List[str] = python_cmd + ['-m']
|
||||
if args.headless:
|
||||
py_args += ['ghidra.app.util.headless.AnalyzeHeadless']
|
||||
py_args += ['pyghidra.ghidra_launch', '--install-dir', str(install_dir), 'ghidra.app.util.headless.AnalyzeHeadless']
|
||||
else:
|
||||
py_args += ['-g', 'ghidra.GhidraRun']
|
||||
py_args += ['pyghidra', '-g', '--install-dir', str(install_dir)]
|
||||
if args.console:
|
||||
subprocess.call(py_args + remaining)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue