Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netomi/bat
Bytecode Analysis Toolkit.
https://github.com/netomi/bat
analysis bytecode dalvik dex jvm-bytecode smali smali-baksmali virtual-machine
Last synced: about 1 month ago
JSON representation
Bytecode Analysis Toolkit.
- Host: GitHub
- URL: https://github.com/netomi/bat
- Owner: netomi
- License: apache-2.0
- Created: 2020-05-20T07:41:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-28T17:25:09.000Z (about 2 years ago)
- Last Synced: 2023-03-12T06:52:52.991Z (almost 2 years ago)
- Topics: analysis, bytecode, dalvik, dex, jvm-bytecode, smali, smali-baksmali, virtual-machine
- Language: Kotlin
- Homepage:
- Size: 3.03 MB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Bytecode Analysis Toolkit
![Build status](https://github.com/netomi/bat/workflows/build-status/badge.svg)
[![GitHub license](https://img.shields.io/github/license/netomi/bat)](https://github.com/netomi/bat/blob/master/LICENSE)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** files
* `dexfile`: reads and writes **dex** files
* `dexdump`: prints the contents of **dex** files in the same format as the _dexdump_ tool
* `classdump`: prints the contents of **class** files in the same format as the _javap_ tool
* `smali`: assembler/disassembler for **dex** files
* `jasm`: assembler/disassembler for **class** files
* `tools`: convenient command line tools for the different modules## Usage
1. In the root directory run: ./gradlew distZip
2. cd tools/build/distributions
3. Unzip the file 'bat-tools-${VERSION}.zip'
4. Run bat-${toolname}.sh from the unzipped directory### Example usage:
* baksmali tool
```shell
Usage: bat-baksmali [-v] [-o=] inputfile
disassembles dex files.Parameters:
inputfile input file to process (*.dex)Options:
-o= output directory
-v verbose output```
> bat-baksmali.sh -v -o out classes.dexThe generated **smali** files will be created in the **out** directory in a directory structure resembling the package name of the disassembled classes.
## Dependency
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::||")
}
```where **module** might be one of
* `classfile`
* `dexfile`
* `classdump`
* `dexdump`
* `smali`
* `jasm`
* `tinydvm`## License
[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)