Small script to assemble/disassemble from CLI
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Small script using Capstone/Keystone to assemble/disassemble x86/x64 instructions from the command line.

Add the below functions into your .bashrc or .bash_profile for daily usage.

asma() {
    python ~/Scripts/OneOffs/ -f a -i "$@"

asmd() {
    python ~/Scripts/OneOffs/ -f d -i "$@"


Using the functions above, it's pretty straight forward.

For assembling -

$ asma 'jmp esp; inc ecx; call 0x400100'

For disassembling -

$ asmd 'ffe441e8f8004000'
jmp       esp
inc       ecx
call      0x1400100

A couple of other options if you need some more control over architecture.

usage: [-h] [-a {x86,x64,arm}] -i INPUT -f {a,d}

Generate ASM or disasemble bytes. ASM should be semi-colon separated (";").

optional arguments:
  -h, --help            show this help message and exit
  -a {x86,x64,arm}, --arch {x86,x64,arm}
                        Architecture choice.
  -i INPUT, --input INPUT
                        Your input to assemble or disassemble.
  -f {a,d}, --func {a,d}
                        Assemble [a] or Disassemble [d].