@@ -57,6 +57,7 @@ def getvalue(self):
5757TYPE_ARRAY = 1
5858TYPE_MAP = 2
5959TYPE_RAW = 3
60+ TYPE_BIN = 4
6061
6162DEFAULT_RECURSE_LIMIT = 511
6263
@@ -297,6 +298,10 @@ def _read_header(self, execute=EX_CONSTRUCT, write_bytes=None):
297298 obj = struct .unpack (">i" , self ._fb_read (4 , write_bytes ))[0 ]
298299 elif b == 0xd3 :
299300 obj = struct .unpack (">q" , self ._fb_read (8 , write_bytes ))[0 ]
301+ elif b == 0xd9 :
302+ n = struct .unpack ("B" , self ._fb_read (1 , write_bytes ))[0 ]
303+ obj = self ._fb_read (n , write_bytes )
304+ typ = TYPE_RAW
300305 elif b == 0xda :
301306 n = struct .unpack (">H" , self ._fb_read (2 , write_bytes ))[0 ]
302307 obj = self ._fb_read (n , write_bytes )
@@ -305,6 +310,18 @@ def _read_header(self, execute=EX_CONSTRUCT, write_bytes=None):
305310 n = struct .unpack (">I" , self ._fb_read (4 , write_bytes ))[0 ]
306311 obj = self ._fb_read (n , write_bytes )
307312 typ = TYPE_RAW
313+ elif b == 0xc4 :
314+ n = struct .unpack ("B" , self ._fb_read (1 , write_bytes ))[0 ]
315+ obj = self ._fb_read (n , write_bytes )
316+ typ = TYPE_BIN
317+ elif b == 0xc5 :
318+ n = struct .unpack (">H" , self ._fb_read (2 , write_bytes ))[0 ]
319+ obj = self ._fb_read (n , write_bytes )
320+ typ = TYPE_BIN
321+ elif b == 0xc6 :
322+ n = struct .unpack (">I" , self ._fb_read (4 , write_bytes ))[0 ]
323+ obj = self ._fb_read (n , write_bytes )
324+ typ = TYPE_BIN
308325 elif b == 0xdc :
309326 n = struct .unpack (">H" , self ._fb_read (2 , write_bytes ))[0 ]
310327 typ = TYPE_ARRAY
@@ -373,6 +390,8 @@ def _fb_unpack(self, execute=EX_CONSTRUCT, write_bytes=None):
373390 if self ._encoding is not None :
374391 obj = obj .decode (self ._encoding , self ._unicode_errors )
375392 return obj
393+ if typ == TYPE_BIN :
394+ return obj
376395 assert typ == TYPE_IMMEDIATE
377396 return obj
378397
0 commit comments