Strategies for finding binary dependencies
at main 11 lines 387 B view raw
1# © NONE 2# SPDX-License-Identifier: CC0-1.0 3 4from cffi import FFI 5ffi = FFI() 6ffi.cdef(""" 7 int printf(const char *format, ...); // copy-pasted from the man page 8""") 9C = ffi.dlopen(None) # loads the entire C namespace 10arg = ffi.new("char[]", b"world") # equivalent to C code: char arg[] = "world"; 11C.printf(b"hi there, %s.\n", arg) # call printf