Better remote veh sample :)

This commit is contained in:
Clement Rouault
2016-01-28 17:02:18 +01:00
parent ee62d6a972
commit 7be3561ccf
+10 -4
View File
@@ -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)
"""