diff options
| author | Ajax <commial@gmail.com> | 2016-01-08 15:40:04 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2016-01-08 16:06:24 +0100 |
| commit | ee293b843e56b77b9bfd1b01dc3ce94b5340a5d4 (patch) | |
| tree | 715da7a3c312e5675a53f109b5cfe73f455c1130 /miasm2/core/bin_stream.py | |
| parent | 65cc029e58ddce3b9de3bc3d0fca5b6dcb00755c (diff) | |
| download | miasm-ee293b843e56b77b9bfd1b01dc3ce94b5340a5d4.tar.gz miasm-ee293b843e56b77b9bfd1b01dc3ce94b5340a5d4.zip | |
BinStream: use the wrapper on get_bytes for each bin stream
Diffstat (limited to 'miasm2/core/bin_stream.py')
| -rw-r--r-- | miasm2/core/bin_stream.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/miasm2/core/bin_stream.py b/miasm2/core/bin_stream.py index f716d902..739e671e 100644 --- a/miasm2/core/bin_stream.py +++ b/miasm2/core/bin_stream.py @@ -47,7 +47,7 @@ class bin_stream(object): self._cache = None def _getbytes(self, start, length): - return self.bin[start:start + l] + return self.bin[start:start + length] def getbytes(self, start, l=1): """Return the bytes from the bit stream @@ -112,11 +112,11 @@ class bin_stream_str(bin_stream): self.shift = shift self.l = len(input_str) - def getbytes(self, start, l=1): + def _getbytes(self, start, l=1): if start + l + self.shift > self.l: raise IOError("not enough bytes in str") - return super(bin_stream_str, self).getbytes(start + self.shift, l) + return super(bin_stream_str, self)._getbytes(start + self.shift, l) def readbs(self, l=1): if self.offset + l + self.shift > self.l: @@ -184,7 +184,7 @@ class bin_stream_container(bin_stream): self.offset += l return self.bin.get(self.offset - l, self.offset) - def getbytes(self, start, l=1): + def _getbytes(self, start, l=1): return self.bin.get(start, start + l) def __str__(self): @@ -213,7 +213,7 @@ class bin_stream_vm(bin_stream): def getlen(self): return 0xFFFFFFFFFFFFFFFF - def getbytes(self, start, l=1): + def _getbytes(self, start, l=1): try: s = self.vm.get_mem(start + self.base_offset, l) except: |