Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args):
FieldSet.__init__(self, *args)
self._size = (8 + self["size"].value) * 8
def __init__(self, parent, name, res_type=None):
FieldSet.__init__(self, parent, name)
nb_entries = self["header/nb_name"].value + \
self["header/nb_index"].value
self._size = Header.static_size + nb_entries * 64
self.res_type = res_type
def __init__(self, *args):
FieldSet.__init__(self, *args)
self.version = self.stream.readBits(
self.absolute_address + 32 + 16 + 12, 4, self.endian)
def __init__(self, *args):
FieldSet.__init__(self, *args)
if not hasattr(self.root, 'streamgroups'):
self.root.streamgroups = {}
for tag in range(0xBC, 0x100):
self.root.streamgroups[tag] = None
tag = self["tag"].value
if tag in self.tag_info:
self._name, self.parser, self._description = self.tag_info[tag]
elif 0xBC <= tag <= 0xFF:
if 0xC0 <= tag < 0xE0:
# audio
streamid = tag - 0xC0
self._name, self.parser, self._description = (
"audio[%i][]" % streamid, Stream, "Audio Stream %i Packet" % streamid)
elif 0xE0 <= tag < 0xF0:
# video
streamid = tag - 0xE0
def __init__(self, parent, name):
FieldSet.__init__(self, parent, name)
self._group_count = None
def __init__(self, *args):
FieldSet.__init__(self, *args)
self._size = self["size"].value * 8
def __init__(self, parent, ids):
FieldSet.__init__(self, parent, "?[]")
# Set name
id = self['id'].value
self.val = ids.get(id)
if not self.val:
if id == 0xBF:
self.val = 'CRC-32[]', Binary
elif id == 0xEC:
self.val = 'Void[]', Binary
elif id == 0x1B538667:
self.val = 'SignatureSlot[]', signature
else:
self.val = 'Unknown[]', Binary
self._name = self.val[0]
# Compute size
def __init__(self, *args):
FieldSet.__init__(self, *args)
if 3 <= self["../ver_major"].value:
self._size = (10 + self["size"].value) * 8
else:
self._size = (self["size"].value + 6) * 8
def __init__(self, *args, **kw):
FieldSet.__init__(self, *args, **kw)
if not self._size:
self._size = self["volume_len"].value * 8
def __init__(self, parent, name, index):
FieldSet.__init__(self, parent, name, None)
self.uniq_id = 1 + index