Permalink
Browse files

Add an option to baksmali to allow disassembling odex opcodes

These instructions should never be present in a dex file, only in odex/oat
files. However, it's sometimes useful to be able to disassemble an otherwise
valid dex file that happens to contain odex instructions.
  • Loading branch information...
JesusFreke committed May 15, 2017
1 parent 58a4809 commit dd22a795d86aa1461d85c452cae7b7b811c462e2
Showing with 8 additions and 0 deletions.
  1. +8 −0 baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java
@@ -132,6 +132,10 @@
"fields from the current class.")
private boolean implicitReferences = false;
+ @Parameter(names = "--allow-odex-opcodes",
+ description = "Allows odex opcodes to be disassembled, even if the result won't be able to be reassembled.")
+ private boolean allowOdex = false;
+
@Parameter(names = "--classes",
description = "A comma separated list of classes. Only disassemble these classes")
@ExtendedParameter(argumentNames = "classes")
@@ -282,6 +286,10 @@ protected BaksmaliOptions getOptions() {
dexFile.getClasses());
}
+ if (allowOdex) {
+ options.allowOdex = true;
+ }
+
return options;
}
}

0 comments on commit dd22a79

Please sign in to comment.