Skip to content

Instantly share code, notes, and snippets.

@sposterkil
Created December 12, 2014 21:18
Show Gist options
  • Save sposterkil/4cad9df2fa7b20c806b4 to your computer and use it in GitHub Desktop.
Save sposterkil/4cad9df2fa7b20c806b4 to your computer and use it in GitHub Desktop.
Binary compilation
with NamedTemporaryFile(suffix=".s", mode='rw+b') as asm_temp:
asm_temp.write(get_asm(source_file))
asm_temp.write(get_lib())
log("> Compiling with gcc...")
subprocess.call(["gcc",
"-m32",
"-o", output_file.name,
asm_temp.name
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment