MCPcopy Create free account
hub / github.com/HexHive/NASS / ProcMap

Class ProcMap

utils/utils.py:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class ProcMap:
24 def __init__(self, vmas) -> None:
25 self.vmas = vmas
26
27 def get_vmabyname(self, vma_name):
28 for vma in self.vmas:
29 if vma.vma_name is None:
30 continue
31 if vma_name in vma.vma_name:
32 return vma
33 return None
34
35 def get_vmabyaddr(self, addr):
36 for vma in self.vmas:
37 if addr <= vma.end and addr >= vma.base:
38 return vma
39 return None
40
41 def get_vmaaddroff(self, addr):
42 vma = self.get_vmabyaddr(addr)
43 print(hex(addr), hex(vma.base))
44 return addr - vma.base
45
46
47class PocMap_VMA:

Callers 1

parse_proc_mapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected