From 85857024714643943076034e7432dbf123100296 Mon Sep 17 00:00:00 2001 From: _ <_> Date: Tue, 24 Apr 2018 18:46:10 -0700 Subject: [PATCH] Fixed access of offset attribute in PldHeader --- bindings/py3devil1.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/py3devil1.py b/bindings/py3devil1.py index fea35be..4e67102 100755 --- a/bindings/py3devil1.py +++ b/bindings/py3devil1.py @@ -6,6 +6,7 @@ import ctypes #--------------------------------------+ class PldHeader(ctypes.Structure): + _pack_ = 1 _fields_ = [ ("numOffset", ctypes.c_int), ("offsets", ctypes.POINTER(ctypes.c_int)) @@ -217,6 +218,10 @@ if __name__ == "__main__": data = f.read() devil1pld.getheader(ctypes.byref(pldheader), data) devil1pld.printheader(ctypes.byref(pldheader)) + print(pldheader) + print(pldheader.numOffset) + for i in range(0, pldheader.numOffset): + print(hex(pldheader.offsets[i])) def textest(devil1tex, texheader): with open("pl01.pld_1.txp", "rb") as f: