mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Better remote veh sample :)
This commit is contained in:
@@ -21,17 +21,23 @@ windows.utils.create_console()
|
||||
|
||||
@VectoredException
|
||||
def handler(exc):
|
||||
print("POUET")
|
||||
print("POUET EXCEPTION")
|
||||
if exc[0].ExceptionRecord[0].ExceptionCode == EXCEPTION_ACCESS_VIOLATION:
|
||||
target_addr = ctypes.cast(exc[0].ExceptionRecord[0].ExceptionInformation[1], ctypes.c_void_p).value
|
||||
print("Instr at {0} accessed to addr {1}".format(hex(exc[0].ExceptionRecord[0].ExceptionAddress), hex(target_addr)))
|
||||
#return windef.EXCEPTION_CONTINUE_EXECUTION
|
||||
windows.winproxy.VirtualProtect(target_page, 0x1000, windef.PAGE_READWRITE)
|
||||
return windef.EXCEPTION_CONTINUE_EXECUTION
|
||||
return windef.EXCEPTION_CONTINUE_SEARCH
|
||||
|
||||
|
||||
windows.winproxy.AddVectoredExceptionHandler(0, handler)
|
||||
print("YOLO<3")
|
||||
print(ctypes.c_uint.from_address(0x42424242).value)
|
||||
|
||||
target_page = windows.current_process.virtual_alloc(0x1000)
|
||||
print("Protected page is at {0}".format(hex(target_page)))
|
||||
windows.winproxy.VirtualProtect(target_page, 0x1000, windef.PAGE_NOACCESS)
|
||||
|
||||
print("YOLO <3")
|
||||
print(ctypes.c_uint.from_address(target_page + 0x42).value)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user