This goal of this project is to provide tools to work with various java related bytecode formats, mainly JVM and dalvik bytecode.
The following modules are currently available
classfile
: reads and writes class filesdexfile
: reads and writes dex filesdexdump
: prints the contents of dex files in the same format as the dexdump toolclassdump
: prints the contents of class files in the same format as the javap toolsmali
: assembler/disassembler for dex filesjasm
: assembler/disassembler for class filestools
: convenient command line tools for the different modules
- In the root directory run: ./gradlew distZip
- cd tools/build/distributions
- Unzip the file 'bat-tools-${VERSION}.zip'
- Run bat-${toolname}.sh from the unzipped directory
- baksmali tool
Usage: bat-baksmali [-v] [-o=<outputFile>] inputfile
disassembles dex files.
Parameters:
inputfile input file to process (*.dex)
Options:
-o=<outputFile> output directory
-v verbose output
bat-baksmali.sh -v -o out classes.dex
The generated smali files will be created in the out directory in a directory structure resembling the package name of the disassembled classes.
To use the different modules via e.g. gradle in your own application, you can add the following to your build configuration:
repositories {
...
maven("https://jitpack.io")
}
dependencies {
...
implementation("com.github.netomi.bat:<module>:<tag>|<commit>|<release>")
}
where module might be one of
classfile
dexfile
classdump
dexdump
smali
jasm
tinydvm