Flag: Tornado! Hurricane!

Error: Authentication required to access requested resource.

 Forums >>    >> 

Topic created on: by .


  EliCZ     July 23, 2009 01:51.24 CDT
The "bug" is documented here: http://msdn.microsoft.com/en-us/library/aa366549(VS.85).aspx

"If a guard page exception occurs during a system service, the service fails and typically returns some failure status indicator. Since the system also removes the relevant memory page's guard page status, the next invocation of the same system service won't fail due to a STATUS_GUARD_PAGE_VIOLATION exception (unless, of course, someone reestablishes the guard page)."

  nezumi     July 23, 2009 03:33.05 CDT
EliCZ
if so, why ReadProcessMemory() turns PAGE_GUARD off for pages allocated by VirtualAlloc(), but does not turn it off for VirtualProtect() as well as for PE image?

"typically returns" is not good for the official documentation and I quoted that part of the documentation on my blog.

PAGE_GUARD should work as it's expected to. if sometimes it works, sometimes does not - this means: it does not work at all, so this is a bug :)

btw, it's _not_ documented that OllyDbg does not pass the exception to applications :)

anyway, thanks for feedback! you helped me to realize that my post it's not clean enough...

  EliCZ     July 24, 2009 02:26.37 CDT
> if so, why ReadProcessMemory() turns PAGE_GUARD off for pages allocated by VirtualAlloc(), but [b]does not turn it off for VirtualProtect() as well as for PE image?

Can you write an example demonstrating this?


> PAGE_GUARD should work as it\'s expected to. if sometimes it works, sometimes does not - this means: it does not work at all, so this is a bug :)

I think it works as described in MSDN.
How _exactly_ should it work for you?


As I understand Windows it works like this:

* When an exception occurs in user-mode, a user-mode exception is raised (except stack growing).

* When an exception occurs in kernel-mode, a kernel-mode exception is raised.

* If kernel-mode exception happens during system service (typically when probing user-mode buffers) that has __try/__except, service returns an error status.

* Any touching of guarded page turns off PAGE_GUARD; when touched in user-mode an exception is dispatched to user-mode handler, when touched by system service a status is returned.

Am I wrong somewhere?

Note: Registration is required to post to the forums.

There are 28,225 total registered users.


Recently Created Topics
Reverse Engineering ...
Jan/23
Career: DoD Agency I...
Jan/22
"Disappearing&q...
Jan/17
Career: Software Sec...
Jan/11
Where is the call st...
Jan/07
IDA Pro 6.1 Breakpoi...
Jan/01
How to create data s...
Dec/30
can i search all mod...
Dec/23
IDA symbol table exp...
Dec/20
An anti-attach trick
Dec/17


Recent Forum Posts
Reverse Engineering ...
NirIzr
"Disappearing&q...
NirIzr
Reverse Engineering ...
charlie
"Disappearing&q...
charlie
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
Looking for value in...
NirIzr


Recent Blog Entries
cmathieu
Feb/07
Hacker Carnival

waleedassar
Feb/06
OllyDbg v1.10 And Hardware ...

waleedassar
Jan/31
Yet Another Anti-Debug Trick

RolfRolles
Jan/22
Finding Bugs in VMs with a ...

waleedassar
Jan/13
An OllyDbg Bug Disables Sof...

More ...


Recent Blog Comments
waleedassar on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/05
Yet Another Anti-Debug Trick

trolotou on:
Feb/05
Doudoune Moncler -Pennies F...

waleedassar on:
Feb/01
Yet Another Anti-Debug Trick

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit