Esempio n. 1
0
 def _read(self):
     self._debug['header']['start'] = self._io.pos()
     self.header = PacketPpi.PacketPpiHeader(self._io, self, self._root)
     self.header._read()
     self._debug['header']['end'] = self._io.pos()
     self._debug['fields']['start'] = self._io.pos()
     self._raw_fields = self._io.read_bytes((self.header.pph_len - 8))
     _io__raw_fields = KaitaiStream(BytesIO(self._raw_fields))
     self.fields = PacketPpi.PacketPpiFields(_io__raw_fields, self,
                                             self._root)
     self.fields._read()
     self._debug['fields']['end'] = self._io.pos()
     self._debug['body']['start'] = self._io.pos()
     _on = self.header.pph_dlt
     if _on == PacketPpi.Linktype.ppi:
         self._raw_body = self._io.read_bytes_full()
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = PacketPpi(_io__raw_body)
         self.body._read()
     elif _on == PacketPpi.Linktype.ethernet:
         self._raw_body = self._io.read_bytes_full()
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = ethernet_frame.EthernetFrame(_io__raw_body)
         self.body._read()
     else:
         self.body = self._io.read_bytes_full()
     self._debug['body']['end'] = self._io.pos()
Esempio n. 2
0
 def _read(self):
     self._debug['ts_sec']['start'] = self._io.pos()
     self.ts_sec = self._io.read_u4le()
     self._debug['ts_sec']['end'] = self._io.pos()
     self._debug['ts_usec']['start'] = self._io.pos()
     self.ts_usec = self._io.read_u4le()
     self._debug['ts_usec']['end'] = self._io.pos()
     self._debug['incl_len']['start'] = self._io.pos()
     self.incl_len = self._io.read_u4le()
     self._debug['incl_len']['end'] = self._io.pos()
     self._debug['orig_len']['start'] = self._io.pos()
     self.orig_len = self._io.read_u4le()
     self._debug['orig_len']['end'] = self._io.pos()
     self._debug['body']['start'] = self._io.pos()
     _on = self._root.hdr.network
     if _on == Pcap.Linktype.ppi:
         self._raw_body = self._io.read_bytes(self.incl_len)
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = packet_ppi.PacketPpi(_io__raw_body)
         self.body._read()
     elif _on == Pcap.Linktype.ethernet:
         self._raw_body = self._io.read_bytes(self.incl_len)
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = ethernet_frame.EthernetFrame(_io__raw_body)
         self.body._read()
     else:
         self.body = self._io.read_bytes(self.incl_len)
     self._debug['body']['end'] = self._io.pos()
Esempio n. 3
0
 def _read(self):
     self.ts_delta = self._io.read_u8le()
     self.orig_len = self._io.read_u4le()
     self.inc_len = self._io.read_u4le()
     _on = self._root.mac_type
     if _on == MicrosoftNetworkMonitorV2.Linktype.ethernet:
         self._raw_body = self._io.read_bytes(self.inc_len)
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = ethernet_frame.EthernetFrame(_io__raw_body)
     else:
         self.body = self._io.read_bytes(self.inc_len)
 def _read(self):
     self._debug['ts_delta']['start'] = self._io.pos()
     self.ts_delta = self._io.read_u8le()
     self._debug['ts_delta']['end'] = self._io.pos()
     self._debug['orig_len']['start'] = self._io.pos()
     self.orig_len = self._io.read_u4le()
     self._debug['orig_len']['end'] = self._io.pos()
     self._debug['inc_len']['start'] = self._io.pos()
     self.inc_len = self._io.read_u4le()
     self._debug['inc_len']['end'] = self._io.pos()
     self._debug['body']['start'] = self._io.pos()
     _on = self._root.mac_type
     if _on == self._root.Linktype.ethernet:
         self._raw_body = self._io.read_bytes(self.inc_len)
         _io__raw_body = KaitaiStream(BytesIO(self._raw_body))
         self.body = ethernet_frame.EthernetFrame(_io__raw_body)
         self.body._read()
     else:
         self.body = self._io.read_bytes(self.inc_len)
     self._debug['body']['end'] = self._io.pos()