示例#1
0
 def __init__(self, data):
     BinaryView.__init__(self, file_metadata=data.file, parent_view=data)
     self.raw = data
     if data.file.filename.endswith('.bin.16'):
         orig_file = data.file.filename[:-3]
         global strings
         strings = find_strings(orig_file)
示例#2
0
 def __init__(self, data: BinaryView):
     actual_data = data.read(0, len(data)).decode('utf8')
     binfile = BinFile()
     binfile.add(actual_data)
     decoded = b''.join(s.data for s in binfile.segments)
     parent = BinaryView.new(data=decoded)
     self.hex_segments = binfile.segments
     BinaryView.__init__(self, file_metadata=data.file, parent_view=parent)
示例#3
0
 def __init__(self, parent):
     BinaryView.__init__(self,
                         parent_view=parent,
                         file_metadata=parent.file)
     self.value_cache = {}
     self.error_cache = {}
     self.arch = parent.arch
     self.platform = parent.platform
示例#4
0
文件: dumb_view.py 项目: hydra45/DUMB
    def __init__(self, data):
        """
        Once our view is selected, this method is called to actually create it.
        :param data: the file data
        """
        BinaryView.__init__(self, file_metadata=data.file, parent_view=data)
        self.platform = Architecture['DUMB'].standalone_platform

        self.parse_format(data)
	def __init__(self, parent):
		self.memory = DebugMemoryView(parent)
		self.local_view = parent
		BinaryView.__init__(self, parent_view=self.memory, file_metadata=self.memory.file)
		self.arch = parent.arch
		self.platform = parent.platform

		self.saved_bases = {}

		# TODO: Read segments from debugger
		length = self.memory.perform_get_length()
		self.add_auto_segment(0, length, 0, length, SegmentFlag.SegmentReadable | SegmentFlag.SegmentWritable | SegmentFlag.SegmentExecutable)
		self.add_auto_section("Memory", 0, length)
示例#6
0
 def __init__(self, data):
     """
     Create memory map segments for the image
     We use only the ROM data, no additional data is mapped.
     Interpreter segment is not loaded to not confuse the user when looking at the image in the hex viewer
     """
     BinaryView.__init__(self, parent_view=data, file_metadata=data.file)
     self.platform = Architecture['CHIP-8'].standalone_platform
     self.data = data
     self.add_auto_segment(0x200, len(data), 0, len(data), SegmentFlag.SegmentReadable | SegmentFlag.SegmentWritable | SegmentFlag.SegmentExecutable | SegmentFlag.SegmentContainsCode)
     self.add_user_section('ROM Data', 0x200, len(data), SectionSemantics.ReadOnlyCodeSectionSemantics)
     self.add_entry_point(0x200)
     self.get_function_at(0x200).name = 'entry'
示例#7
0
 def __init__(self, data):
     BinaryView.__init__(self, parent_view=data, file_metadata=data.file)
     self.raw = data
示例#8
0
    def __init__(self, data):
        BinaryView.__init__(self, data.file, data)

        self.arch = Architecture['m16c']
        self.platform = Platform['m16c']
示例#9
0
 def __init__(self, data):
     BinaryView.__init__(self, file_metadata=data.file, parent_view=data)
     self.platform = Architecture["thumb2"].standalone_platform
     self._parse_format(data)
示例#10
0
 def __init__(self, data):
     # Binary Ninja apparently looks at the file metadata for the parent view, so we have to bind that to a Binary View as well
     self.file = FileMetadata(filename="/dev/null")
     BinaryView.__init__(self, file_metadata=self.file, parent_view=BinaryView(file_metadata=self.file), handle=None)
     self.raw = data