Introduction¶
The ppci (pure python compiler infrastructure) project is a compiler written entirely in python.
The project contains:
- A compiler, an assembler, a linker and a build system
- Language front-ends: Brainfuck, c3
- Backends for various platforms: arm, avr, msp430, python, thumb, x86_64
An example usage of the low level encoding api:
>>> from ppci.arch.x86_64 import instructions, registers
>>> i = instructions.Pop(registers.rbx)
>>> i.encode()
b'['
An other example:
>>> import io
>>> from ppci.api import asm
>>> source_file = io.StringIO("""section code
... mov rax, 60
... mov rdi, 42""")
>>> obj = asm(source_file, 'x86_64')
>>> obj.get_section('code').data
bytearray(b'H\xb8<\x00\x00\x00\x00\x00\x00\x00H\xbf*\x00\x00\x00\x00\x00\x00\x00')
Warning
This project is in alpha state and not ready for production use!