mirror of
https://github.com/DragonMinded/bemaniutils.git
synced 2026-09-29 02:18:05 +03:00
Beginning of an AFP ByteCode decompiler, starting with a massive code reorg and a control flow graph analyzer.
This commit is contained in:
@@ -101,6 +101,12 @@ def main() -> int:
|
||||
metavar="FILE",
|
||||
help="The file to print",
|
||||
)
|
||||
print_parser.add_argument(
|
||||
"-d",
|
||||
"--decompile-bytecode",
|
||||
action="store_true",
|
||||
help="Attempt to decompile and print bytecode instead of printing the raw representation.",
|
||||
)
|
||||
print_parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
@@ -119,6 +125,12 @@ def main() -> int:
|
||||
metavar="BSIFILE",
|
||||
help="The BSI file to parse",
|
||||
)
|
||||
parseafp_parser.add_argument(
|
||||
"-d",
|
||||
"--decompile-bytecode",
|
||||
action="store_true",
|
||||
help="Attempt to decompile and print bytecode instead of printing the raw representation.",
|
||||
)
|
||||
parseafp_parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
@@ -427,7 +439,7 @@ def main() -> int:
|
||||
afpfile = TXP2File(bfp.read(), verbose=args.verbose)
|
||||
|
||||
# Now, print it
|
||||
print(json.dumps(afpfile.as_dict(), sort_keys=True, indent=4))
|
||||
print(json.dumps(afpfile.as_dict(decompile_bytecode=args.decompile_bytecode), sort_keys=True, indent=4))
|
||||
|
||||
if args.action == "parseafp":
|
||||
# First, load the AFP and BSI files
|
||||
@@ -437,7 +449,7 @@ def main() -> int:
|
||||
|
||||
# Now, print it
|
||||
swf.parse(verbose=args.verbose)
|
||||
print(json.dumps(swf.as_dict(), sort_keys=True, indent=4))
|
||||
print(json.dumps(swf.as_dict(decompile_bytecode=args.decompile_bytecode), sort_keys=True, indent=4))
|
||||
|
||||
if args.action == "parsegeo":
|
||||
# First, load the AFP and BSI files
|
||||
|
||||
Reference in New Issue
Block a user