2018-04-22 04:14:09 +05:30
|
|
|
#!/usr/bin/python3
|
2018-04-21 16:09:25 +05:30
|
|
|
import ctypes
|
|
|
|
|
|
|
|
class PldHeader(ctypes.Structure):
|
|
|
|
_fields_ = [
|
|
|
|
("numOffset", ctypes.c_int),
|
|
|
|
("offsets", ctypes.POINTER(ctypes.c_int))
|
|
|
|
]
|
|
|
|
|
|
|
|
class Devil1FN_PLD(ctypes.Structure):
|
|
|
|
_fields_ = [
|
|
|
|
("getheader" , ctypes.CFUNCTYPE(bool, ctypes.POINTER(PldHeader), ctypes.c_char_p)),
|
|
|
|
("sizeofsector", ctypes.CFUNCTYPE(int, ctypes.POINTER(PldHeader), ctypes.c_int)),
|
|
|
|
("printheader" , ctypes.CFUNCTYPE(None, ctypes.POINTER(PldHeader)))
|
|
|
|
]
|
|
|
|
|
|
|
|
def main():
|
2018-04-22 04:14:09 +05:30
|
|
|
sharedlib='./lib3ddevil1.so'
|
|
|
|
libc = cdll.LoadLibrary(sharedlib)
|
|
|
|
if (not lib):
|
|
|
|
print("Couldn't load %s" % sharedlib)
|
|
|
|
return 1
|
|
|
|
|
|
|
|
print("OK")
|
|
|
|
with open("pl01.pld", "rb") as f:
|
|
|
|
data = f.read()
|