generated from clearbluejar/ghidra-python-vscode-devcontainer-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd3b09b
commit 2ac0669
Showing
7 changed files
with
95 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .decompile import decompile | ||
from .utility import get_parser | ||
from .parser import get_parser | ||
|
||
|
||
def main(): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import argparse | ||
import multiprocessing | ||
|
||
from ghidrecomp import __version__ | ||
|
||
from .callgraph import add_cg_args_to_parser | ||
from .bsim import add_bsim_args_to_parser | ||
|
||
THREAD_COUNT = multiprocessing.cpu_count() | ||
|
||
def get_parser() -> argparse.ArgumentParser: | ||
|
||
parser = argparse.ArgumentParser(description='ghidrecomp - A Command Line Ghidra Decompiler', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('bin', help='Path to binary used for analysis') | ||
parser.add_argument('--cppexport', action='store_true', help='Use Ghidras CppExporter to decompile to single file') | ||
parser.add_argument('--filter', dest='filters', action='append', help='Regex match for function name') | ||
parser.add_argument('--project-path', help='Path to base ghidra projects ', default='ghidra_projects') | ||
parser.add_argument('--gdt', help='Additional GDT to apply', nargs='?', action='append') | ||
parser.add_argument('-o', '--output-path', help='Location for all decompilations', default='ghidrecomps') | ||
parser.add_argument("-v", "--version", action="version", version=__version__) | ||
parser.add_argument("--skip-cache", action='store_true', | ||
help='Skip cached and genearate new decomp and callgraphs.') | ||
|
||
group = parser.add_mutually_exclusive_group() | ||
group.add_argument('--sym-file-path', help='Specify single pdb symbol file for bin') | ||
group.add_argument('-s', '--symbols-path', help='Path for local symbols directory', default='symbols') | ||
group.add_argument('--skip-symbols', help='Do not apply symbols', action='store_true') | ||
|
||
parser.add_argument('-t', '--thread-count', type=int, | ||
help='Threads to use for processing. Defaults to cpu count', default=THREAD_COUNT) | ||
parser.add_argument('--va', help='Enable verbose analysis', action='store_true') | ||
parser.add_argument('--fa', help='Force new analysis (even if already analyzed)', action='store_true') | ||
|
||
group = parser.add_argument_group('JVM Options') | ||
group.add_argument('--max-ram-percent', help='Set JVM Max Ram %% of host RAM', default=50.0) | ||
group.add_argument('--print-flags', help='Print JVM flags at start', action='store_true') | ||
|
||
add_cg_args_to_parser(parser) | ||
|
||
add_bsim_args_to_parser(parser) | ||
|
||
|
||
return parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters