Assemble shellcode within Emacs
The package requires a binary shellcode-asm to be present on the system.
To compile/install the binary, ensure the keystone library is installed, then run:
make
sudo make installThen, load the package into emacs by specifying this in your config:
(load-file "path/to/shellcode-asm.el")If you wish, you may uninstall the binary by running:
sudo rm /usr/local/bin/shellcode-asm
shellcode-asm-assemble-buffer: Assembles the text present in the current buffer, most useful when used with scratch buffer.shellcode-asm-assemble-region: Assembles the currently selected text region.shellcode-asm-set-default-architecture: Sets the default assembly arch.shellcode-asm-mode: Sets the minor mode to allow for keybinds to the above;<C-c> <C-a>: shellcode-asm-assemble-buffer<C-c> <C-r>: shellcode-asm-assemble-region<C-c> <C-s>: shellcode-asm-set-default-architecture
- x86-64
- x86-32
- x86-16
- arm64
- arm32
- arm32thumb
If you wish to use the standalone shellcode-asm binary, its usage is as follows:
<assembly> | shellcode-asm <arch>
Where <assembly> pipes into the command (cat file.asm, echo "xor eax, eax\nret", etc...), and <arch> is one of the architectures listed above.
