diff options
| author | serpilliere <devnull@localhost> | 2014-06-25 14:24:48 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2014-06-25 14:24:48 +0200 |
| commit | 9b11210e07287b83aefadd288b9eb466e0fd0732 (patch) | |
| tree | 0b7b52dc5985b050935431b66d0d35700b317e8f /miasm2/core/bin_stream.py | |
| parent | 240490662b3f3c0b44913d13c99a54332630d612 (diff) | |
| download | miasm-9b11210e07287b83aefadd288b9eb466e0fd0732.tar.gz miasm-9b11210e07287b83aefadd288b9eb466e0fd0732.zip | |
bin_stream: wrap is_addr_in to allow bs pickling
Diffstat (limited to 'miasm2/core/bin_stream.py')
| -rw-r--r-- | miasm2/core/bin_stream.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/miasm2/core/bin_stream.py b/miasm2/core/bin_stream.py index 7ae6d3fa..a15ffa8e 100644 --- a/miasm2/core/bin_stream.py +++ b/miasm2/core/bin_stream.py @@ -68,8 +68,6 @@ class bin_stream_str(bin_stream): self.offset = offset self.shift = shift self.l = len(bin) - if "is_addr_in" in self.bin.__class__.__dict__: - self.is_addr_in = lambda ad: self.bin.is_addr_in(ad) def getbytes(self, start, l=1): if start + l > self.l: @@ -142,8 +140,9 @@ class bin_stream_pe(bin_stream): self.bin = bin self.offset = offset self.l = bin.__len__() - if "is_addr_in" in self.bin.__class__.__dict__: - self.is_addr_in = lambda ad: self.bin.is_addr_in(ad) + + def is_addr_in(self, ad): + return self.bin.is_addr_in(ad) def getlen(self): return self.mylen |