Created
January 1, 2023 14:46
-
-
Save uvlad7/a2f9722a66e34a3db489c25296321506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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