JWP Programs Newbie cheater
Reputation: 0
Joined: 19 Dec 2011 Posts: 23
|
Posted: Tue Feb 28, 2012 3:52 am Post subject: About PAGE_GUARD Exception..;; |
|
|
Hi, I am sorry about my similar questions..
but I have to ask for more..;
I wan't to get exception for memory breakpoint.
so I wrote a sample source.
-
procedure TForm1.StartCatchExceptionsClick(Sender: TObject);
var Old:DWORD;
begin
VirtualProtect(Pointer($00400000), 4, PAGE_GUARD, Old);
AddVectoredExceptionHandler(1, DWORD(@VectoredHandler));
end;
This is VectoredHandler Function.
-
function VectoredHandler(ExceptionInfo : EXCEPTION_POINTERS): LongInt; stdcall;
Form1.Listbox1.Items.Add(IntToHex(ExceptionInfo.ExceptionRecord^.ExceptionInformation[1], 8));
result:= 0;//EXCEPTION_CONTINUE_SEARCH ;
end;
and a code to raise exception is this. (Write to guard page.)
-
procedure TForm1.RaiseExceptionBtnClick(Sender: TObject);
var Value, BytesWrite:DWORD;
begin
Value:=1234;
WriteProcessMemory(GetCurrentProcess, Pointer($00400000), @Value, 4, BytesWrite);
end;
but there's no exception.
so I modified that "StartCatch" source.
VirtualProtect(Pointer($00400000), 4, PAGE_NOACCESS, Old);
and
VirtualProtect(Pointer($00400000), 4, PAGE_READONLY, Old);
but those weren't right.
What should I do??
Thanks for reading.
|
|