-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnamespace.py
More file actions
30 lines (22 loc) · 846 Bytes
/
namespace.py
File metadata and controls
30 lines (22 loc) · 846 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
# Fix a method of a give namespace
#@author simo
#@category iOS.kernel
#@keybinding Meta Shift N
#@toolbar logos/ns.png
# -*- coding: utf-8 -*-
from utils.helpers import *
from utils.methods import *
if __name__ == "__main__":
targetFunction = getSymbolAt(currentAddress)
if targetFunction == None :
targetFunction = askString("You didn't select a method", "Method name:")
exit(-1)
# how to track the history of strings ?
className = askString("Fix Namespace","namespace of "+ targetFunction.toString())
symbolTable = currentProgram.getSymbolTable()
namespace = symbolTable.getNamespace(className,None)
if namespace == None:
popup("%s class not found" %(className))
exit(-1)
fix_namespace(className,getFunctionAt(targetFunction.getAddress()))
print "Done"