File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from x64dbg import *
2+
3+ def Log (txt ):
4+ print ("[Themida IAT fixer] " + txt )
5+
6+ def Trace (addr , mainModule ):
7+ Log ("Tracing address 0x%x" % addr )
8+ oldEIP = Register .GetEIP ()
9+ Register .SetEIP (addr )
10+ while Register .GetEIP () >= mainModule .base and Register .GetEIP () <= (mainModule .base + mainModule .size ):
11+ Debug .StepIn ()
12+
13+ resolvedAddr = Register .GetEIP ()
14+ Register .SetEIP (oldEIP )
15+ return resolvedAddr
16+
17+ def main ():
18+ Gui .Message ("This script does not support advanced api wrapping" )
19+ startIAT = Gui .InputValue ("Start IAT" )
20+ endIAT = Gui .InputValue ("End IAT" )
21+ Log ("Start IAT: 0x%X" % startIAT )
22+ Log ("End IAT: 0x%X" % endIAT )
23+
24+ currentPtr = startIAT
25+ mainModule = Module .GetMainModuleInfo ()
26+ while currentPtr <= endIAT :
27+ addr = Memory .ReadDword (currentPtr )
28+ if Memory .IsValidPtr (addr ):
29+ if addr >= mainModule .base and addr <= (mainModule .base + mainModule .size ):
30+ resolvedAddr = Trace (addr , mainModule )
31+ Memory .WriteDword (currentPtr , resolvedAddr )
32+ currentPtr += 4
33+ Gui .Message ("Done" )
34+
35+ if __name__ == "__main__" :
36+ main ()
37+
You can’t perform that action at this time.
0 commit comments