Skip to content

Instantly share code, notes, and snippets.

@uvlad7
Created January 1, 2023 14:46
Show Gist options
  • Save uvlad7/a2f9722a66e34a3db489c25296321506 to your computer and use it in GitHub Desktop.
Save uvlad7/a2f9722a66e34a3db489c25296321506 to your computer and use it in GitHub Desktop.
from cffi import FFI
ffi = FFI()
ffi.cdef("""
int printf(const char *format, ...);
""")
C = ffi.dlopen(None)
x = ffi.cast("long long", 1)
l = ffi.new("long long[2]")
if (int(x)): # Little-endian
l[0] = 7299807751963697480
l[1] = 9414436869185655
else:
l[0] = 5215573471842553445
l[1] = 8583959181729603840
C.printf(b"%s\n", l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment