1 From fd2a6b2899c8b836a086b43ec9ebccf726f71ec4 Mon Sep 17 00:00:00 2001
2 From: Moritz Sanft <58110325+msanft@users.noreply.github.com>
3 Date: Sat, 11 May 2024 11:04:19 +0200
4 Subject: [PATCH] core: remove IDAPython dependency
6 Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
8 miasm/core/bin_stream_ida.py | 45 ------------------------------------
9 1 file changed, 45 deletions(-)
10 delete mode 100644 miasm/core/bin_stream_ida.py
12 diff --git a/miasm/core/bin_stream_ida.py b/miasm/core/bin_stream_ida.py
13 deleted file mode 100644
14 index 15bd9d8b..00000000
15 --- a/miasm/core/bin_stream_ida.py
18 -from builtins import range
19 -from idc import get_wide_byte, get_segm_end
20 -from idautils import Segments
21 -from idaapi import is_mapped
23 -from miasm.core.utils import int_to_byte
24 -from miasm.core.bin_stream import bin_stream_str
27 -class bin_stream_ida(bin_stream_str):
29 - bin_stream implementation for IDA
31 - Don't generate xrange using address computation:
32 - It can raise error on overflow 7FFFFFFF with 32 bit python
34 - def _getbytes(self, start, l=1):
37 - offset = ad + start + self.base_address
38 - if not is_mapped(offset):
39 - raise IOError(f"not enough bytes @ offset {offset:x}")
40 - out.append(int_to_byte(get_wide_byte(offset)))
41 - return b''.join(out)
43 - def readbs(self, l=1):
44 - if self.offset + l > self.l:
45 - raise IOError("not enough bytes")
46 - content = self.getbytes(self.offset)
51 - raise NotImplementedError('Not fully functional')
53 - def setoffset(self, val):
58 - if hasattr(self, "_getlen"):
60 - max_addr = get_segm_end(list(Segments())[-1] - (self.offset - self.base_address))
61 - self._getlen = max_addr