MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / addr_to_fmap_offset

Function addr_to_fmap_offset

python/examples/feature_map.py:29–35  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

27factor = image_len / data_len
28
29def addr_to_fmap_offset(addr):
30 for (i,seg) in enumerate(bv.segments):
31 #print(f'segment {i}: [{seg.start:08X}, {seg.end:08X})')
32 if addr >= seg.start and addr < seg.end:
33 a = sum([s.end - s.start for s in bv.segments[0:i]]) + (addr - seg.start)
34 return int(factor * a)
35 assert False, f'address {addr:08X} was not in any segment'
36
37for seg in bv.segments:
38 print(f'segment [{seg.start:08X}, {seg.end:08X}) -draw-> ' + \

Callers 2

feature_map.pyFile · 0.85
highlightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected