MCPcopy
hub / github.com/keystone-engine/keypatch / ida_get_item

Method ida_get_item

keypatch.py:307–325  ·  view source on GitHub ↗
(self, address, hex_output=False)

Source from the content-addressed store, hash-verified

305 # return bytes of instruction or data
306 # return None on failure
307 def ida_get_item(self, address, hex_output=False):
308 if self.check_address(address) != 1:
309 # not a valid address
310 return (None, 0)
311
312 # return None if address is in the middle of instruction / data
313 if address != idc.ItemHead(address):
314 return (None, 0)
315
316 len = idc.ItemSize(address)
317 item = idaapi.get_many_bytes(address, len)
318
319 if item is None:
320 return (None, 0)
321
322 if hex_output:
323 item = to_hexstr(item)
324
325 return (item, len)
326
327 @staticmethod
328 def get_op_dtype_name(op_idx):

Callers 2

patch_codeMethod · 0.95
setupMethod · 0.80

Calls 2

check_addressMethod · 0.95
to_hexstrFunction · 0.85

Tested by

no test coverage detected