Lines Matching refs:buf

32     def get_py3_bytes(buf):  argument
33 return buf
65 def get_py3_bytes(buf): argument
66 return Py3Bytes(buf)
369 def unpack_from(cls, buf, offset=0): argument
370 unpacked = struct.unpack_from(cls.struct_fmt, buf, offset)
615 def _extract_zero_terminated_buf_slice(self, buf, offset): argument
617 end = buf.find(b'\0', offset)
619 return buf[offset:]
620 return buf[offset:end]
625 def _extract_zero_terminated_str(self, buf, offset): argument
627 buf_slice = self._extract_zero_terminated_buf_slice(buf, offset)
630 def _extract_zero_terminated_str(self, buf, offset): argument
632 return intern(self._extract_zero_terminated_buf_slice(buf, offset))
635 def _parse_from_buf_internal(self, buf): argument
639 if len(buf) < 8:
642 if buf[0:4] != ELF.ELF_MAGIC:
645 self.ei_class = buf[ELF.EI_CLASS]
649 self.ei_data = buf[ELF.EI_DATA]
653 self.file_size = len(buf)
673 return cls._make(struct.unpack_from(fmt, buf, offset))
691 p = struct.unpack_from(elf_phdr_fmt, buf, offset)
708 p = struct.unpack_from(elf_sym_fmt, buf, offset)
714 return self._extract_zero_terminated_str(buf, offset)
814 def _parse_from_buf(self, buf): argument
817 self._parse_from_buf_internal(buf)
880 def _parse_from_dump_buf(self, buf): argument
882 self._parse_from_dump_lines('<str:0x{:x}>'.format(id(buf)),
883 buf.splitlines())
895 def loads(buf): argument
898 elf._parse_from_buf(buf)
911 def load_dumps(buf): argument
914 elf._parse_from_dump_buf(buf)
937 def extract_dex_string(cls, buf, offset=0): argument
938 end = buf.find(b'\0', offset)
939 return buf[offset:] if end == -1 else buf[offset:end]
943 def extract_uleb128(cls, buf, offset=0): argument
948 byte = buf[offset + num_bytes]
998 def enumerate_dex_strings_buf(cls, buf, offset=0, data_offset=None): argument
999 buf = get_py3_bytes(buf)
1000 header = cls.Header.unpack_from(buf, offset=offset)
1019 offset = StringId.unpack_from(buf, offset).string_data_off
1023 offset += cls.extract_uleb128(buf, offset)[1]
1026 yield cls.extract_dex_string(buf, offset)
1111 def enumerate_dex_strings_vdex_buf(cls, buf): argument
1112 buf = get_py3_bytes(buf)
1114 magic, version = struct.unpack_from('4s4s', buf)
1134 vdex_header = VdexHeader.unpack_from(buf, offset=0)
1165 dex_magic = buf[offset:offset + 4]
1169 dex_header = cls.Header.unpack_from(buf, offset)
1171 for s in cls.enumerate_dex_strings_buf(buf, offset):