code:
___
from COMMON import *
FILE(open('Struct test.dat','wb'))
StructArr(['bu8','bu16'],[[255,600],[128,400],[180,255],[0,16],[0,0]]) #zero-struct
StructArr('bu32',[255,128,180,16]) #count
pad(1)
StructArr(['bu32','bu8','bu8'],[[0,16,0],[8060,124,30],[64032,118,0],[0,20,30],[0,255,2]]) #stop-struct
FILE(open('Struct test.dat','rb'))
print '\n0-struct:'
print StructArr(['bu8','bu16'])
print '\ncount:'
print StructArr(['bu32'],4)
skip(1)
print '\nstop-struct:'
print StructArr(['bu32','bu8','bu8'],['*',255,'*'])
CLOSE()
input()
___
data:
___
FF 02 58 80 01 90 B4 00 FF 00 00 10 00 00 00 00
00 00 FF 00 00 00 80 00 00 00 B4 00 00 00 10 00
00 00 00 00 10 00 00 00 1F 7C 7C 1E 00 00 FA 20
76 00 00 00 00 00 14 1E 00 00 00 00 FF 02
___
interpreter:
___
0-struct:
[[255, 600], [128, 400], [180, 255], [0, 16]]
count:
[[255], [128], [180], [16]]
stop-struct:
[[0, 16, 0], [8060, 124, 30], [64032, 118, 0], [0, 20, 30]]
___