https://github.com/0xbc/chiasm-shell
Python-based interactive assembler/disassembler CLI, powered by Keystone/Capstone.
https://github.com/0xbc/chiasm-shell
assembler capstone cli disassembler keystone
Last synced: 10 months ago
JSON representation
Python-based interactive assembler/disassembler CLI, powered by Keystone/Capstone.
- Host: GitHub
- URL: https://github.com/0xbc/chiasm-shell
- Owner: 0xbc
- License: mit
- Created: 2016-12-03T03:36:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-27T04:59:24.000Z (over 9 years ago)
- Last Synced: 2025-07-09T10:49:24.927Z (11 months ago)
- Topics: assembler, capstone, cli, disassembler, keystone
- Language: Python
- Size: 30.3 KB
- Stars: 31
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chiasm-shell
[](https://pypi.python.org/pypi/chiasm-shell)
Python-based interactive assembler/disassembler CLI, powered by [Keystone]/[Capstone].
## Why did you make this?
I wanted to quickly view some opcodes with [metasm-shell.rb], but I didn't have a Metasploit install handy. I didn't really want to mess around with Ruby either, so I figured that writing my own replacement was a good excuse to play with Keystone and Capstone.
## How do I install it?
```bash
pip install chiasm-shell
# OR
mkvirtualenv chiasm-shell # optional
git clone https://github.com/0xbc/chiasm-shell
cd chiasm-shell
python setup.py install # assumes you have Capstone and Keystone
# build toolchains installed, which includes CMake.
```
## How do I run it?
```bash
chiasm-shell
# or, from the repo base directory:
python -m chiasm_shell.chiasm_shell
```
## How do I use it?
- When the prompt is `asm>`, you're using the interactive assembler backend (Keystone).
- Input one or more assembly statements separated by a semi-colon. x86 uses Intel syntax only at the moment.
- When the prompt is `disasm>`, you're using the interactive disassembler backend (Capstone).
- Input one or more bytes represented by \xXX, where XX is a hex value.
- To switch backends, use `switch asm` or `switch disasm`.
- To change architecture, use `setarch `.
- e.g. `setarch x86 64`.
- You can use more than one mode, separated by spaces.
- Use `lsarch` and `lsmode` to view supported architectures and modes for the current backend
- At the moment, you need to know what modes are relevant to each architecture - check the Keystone/Capstone source if you're not sure.
- Type `help` to see a list of commands; `help ` to see the docstring for `cmd`.
## Example usages
```
asm> inc eax; xor ebx, ebx
\x40\x31\xdb
```
```
disasm> \x40\x31\xdb
0x1000: inc eax
0x1001: xor ebx, ebx
```
## It's broken/I have a suggestion/etc.
Please get in touch/raise an issue/PR/etc!
## Known Issues
- None at this time.
## TODO
- Syntax highlighting and/or tab completion for assembly
- Intelligent mode selection
- Support different input/output formats
- Test suite
[keystone]:
[capstone]:
[metasm-shell.rb]: