Files
hakril-PythonForWindows/remote_callback.py
T
2015-04-13 15:56:25 +02:00

21 lines
674 B
Python

import ctypes
import ctypes.wintypes
from windows.hooks import *
# Example of callback for IAT hooks
@Callback(ctypes.c_void_p, ctypes.c_ulong)
def exit_callback(x, real_function):
print("Try to quit with {0} | {1}".format(x, type(x)))
if x == 3:
print("TRYING TO REAL EXIT")
return real_function(1234)
return 0x4242424243444546
@CreateFileACallback
def createfile_callback(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile, real_function):
print("Trying to open {0}".format(lpFileName))
if "dick" in lpFileName:
return 0x4242
return real_function()