-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKC.py
More file actions
37 lines (30 loc) · 903 Bytes
/
Copy pathKC.py
File metadata and controls
37 lines (30 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
#@category iOS.kernel
#@toolbar logos/kc.png
#@keybinding Meta Shift K
from utils.helpers import *
from utils.class import *
from utils.iometa import ParseIOMeta
def fix_map():
prog = currentProgram
memory = prog.getMemory()
blocks = memory.getBlocks()
for b in blocks:
if "__got" in b.getName():
b.setWrite(False)
def loadAll():
default = "/Users/mg/ghidra_kernelcache/kernel.txt"
ff = askString("iometa symbol file","Symbol file: ",default)
iom = ParseIOMeta(ff)
Obj = iom.getObjects()
kc = kernelCache(Obj)
kc.process_all_classes()
#kc.update_classes()
#kc.process_class("AppleUSBEthernetControllerAX88")
#kc.process_class("IOGraphicsAccelerator2")
#kc.process_class("_IOServiceNullNotifier")
if __name__ == "__main__":
DeclareDataTypes()
prepare()
fix_map()
loadAll()