Skip to content

Latest commit

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pynasm

python to nasm assembly conversion, with cpu control.

  • x86 64bits only for now.

This allows to create:

  • shellcodes
  • PIC relocatable low-level code
  • infections (for red-teaming)
  • obfuscation

Disclaimer

Don't use this for creating malicious payloads!

Usage

python3 pynasm.py shellcode.py
nasm -f bin shellcode.nasm

Emulate with SCEMU for testing

./scemu -f shellcode -vv -6

Demo

https://www.youtube.com/watch?v=o072bXNtxmg

Examples

check the examples folder.

Control blocks

blocks

Comparing strings

python code

emulated binary

API Call

api call

emulation

virtual allocs

emulation

TODO:

  • use pushad/popad on prologe/epiloge to isolate registers on functions?
  • support local vars
  • rax = [0x1a, 0x3b, 0xff, 0x00]
  • elif

About

Python to nasm compilation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages