This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
RustedIronRing/ffi_tests.py

18 lines
355 B
Python
Raw Normal View History

2020-04-18 17:43:55 +02:00
#!/usr/bin/env python3
"""Import hash from the rir dynamic lib."""
2020-05-09 18:58:55 +02:00
import ctypes
2020-04-18 17:43:55 +02:00
import sys
2020-05-09 18:58:55 +02:00
lib = ctypes.cdll.LoadLibrary(sys.argv[1])
s = ctypes.c_char_p(b"/chr/c0000.anibnd.dcx")
lib.nam_hash.restype = ctypes.c_uint32
h = lib.nam_hash(s)
print(hex(h))
lib.nam_hash_as_string.restype = ctypes.c_char_p
h_str = lib.nam_hash_as_string(h)
print(h_str)