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
Don't use this for creating malicious payloads!
generating a relocatable 64bits code blob
python3 pynasm.py shellcode.py
nasm -f bin shellcode.nasm
ls shellcode
or generating an 64bits exe
python3 pynasm.py program.py exe
nasm -f win64 program.nasm
x86_64-w64-mingw32-ld program.obj
ls a.exe
./scemu -f shellcode -vv -6
https://www.youtube.com/watch?v=o072bXNtxmg
check the examples folder.
https://github.com/sha0coder/pynasm/blob/main/DOCUMENTAITON.md
- modulus with aug assign %=
- len(s) from a parameter
- complex ifs and/or
- elif
- break
- continue
- structures
- alloc 100 with: padding times 100 db 0x00