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.
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.
chiasm-shell # or, from the repo base directory: python -m chiasm_shell.chiasm_shell
asm>, you're using the interactive assembler backend (Keystone).
disasm>, you're using the interactive disassembler backend (Capstone).
setarch <arch> <mode(s)>.
setarch x86 64.
lsmodeto view supported architectures and modes for the current backend
helpto see a list of commands;
help <cmd>to see the docstring for
asm> inc eax; xor ebx, ebx \x40\x31\xdb
disasm> \x40\x31\xdb 0x1000: inc eax 0x1001: xor ebx, ebx
Please get in touch/raise an issue/PR/etc!