mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-29 10:12:02 +05:30
Added demonstration of design
This commit is contained in:
parent
790afd9960
commit
01815bc90f
@ -12,6 +12,12 @@ class PldHeader(ctypes.Structure):
|
|||||||
("offsets", ctypes.POINTER(ctypes.c_int))
|
("offsets", ctypes.POINTER(ctypes.c_int))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def getoffsets(self):
|
||||||
|
pyoffsets = []
|
||||||
|
for i in range(0, self.numOffset):
|
||||||
|
pyoffsets.append(self.offsets[i])
|
||||||
|
return pyoffsets
|
||||||
|
|
||||||
class Devil1PLD_FN(ctypes.Structure):
|
class Devil1PLD_FN(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
("getheader" , ctypes.CFUNCTYPE(
|
("getheader" , ctypes.CFUNCTYPE(
|
||||||
@ -232,11 +238,8 @@ if __name__ == "__main__":
|
|||||||
data = f.read()
|
data = f.read()
|
||||||
devil1pld.getheader(ctypes.byref(pldheader), data)
|
devil1pld.getheader(ctypes.byref(pldheader), data)
|
||||||
devil1pld.printheader(ctypes.byref(pldheader))
|
devil1pld.printheader(ctypes.byref(pldheader))
|
||||||
print(pldheader)
|
for offset in pldheader.getoffsets():
|
||||||
print(pldheader.numOffset)
|
print(hex(offset))
|
||||||
print(pldheader.offsets)
|
|
||||||
for i in range(0, pldheader.numOffset):
|
|
||||||
print(hex(pldheader.offsets[i]))
|
|
||||||
|
|
||||||
def textest(devil1tex, texheader):
|
def textest(devil1tex, texheader):
|
||||||
with open("pl01.pld_1.txp", "rb") as f:
|
with open("pl01.pld_1.txp", "rb") as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user