PDA

View Full Version : PAGE_EXECUTE_WRITECOPY As Anti-Debug Trick


walied
September 28th, 2012, 11:49
Here you can find it

http://waleedassar.blogspot.com/2012/09/pageexecutewritecopy-as-anti-debug-trick.html ("http://waleedassar.blogspot.com/2012/09/pageexecutewritecopy-as-anti-debug-trick.html")

Any comments or ideas are very welcome

blabberer
September 28th, 2012, 15:11
though virtualquery / virtual protect / access violation check / guard page seh handler and that kind of things are a bit old

i want to comment that using of hardware bps for step over / trace over etc isn't new to odbg 2.1

it has been there for quiet some time iirc from 1.08

a screen shot for 1.10 where you can ask odbg to set hbp for step over posted below

walied
September 28th, 2012, 15:29
Oh, yeah. This was just to note that not every OllyDbg version has this option e.g. OllyDbg v2.00.01 (Latest 2.x version) seems to lack this option. Thanks anyway, i have updated the blog post to include OllyDbg v1.10.

Indy
September 28th, 2012, 15:33
This is not a trick.

walied
September 28th, 2012, 15:44
Quote:
[Originally Posted by Indy;93307]This is not a trick.

I am sure i am not so good at naming stuff. but what is your point?

walied
September 28th, 2012, 15:45
Quote:
[Originally Posted by blabberer;93305]though virtualquery / virtual protect / access violation check / guard page seh handler and that kind of things are a bit old


Could you please elaborate more?

blabberer
September 28th, 2012, 23:08
look for articles by peter ferrie / kris kaspersky etc


basically ollydbg break on memory access uses PAGE_GUARD and handles the exception raised iirc 0x80000001 and resets the flag using VirtualProtect

which possibly can be monitored is the underlying concept

walied
September 30th, 2012, 03:22
Quote:
[Originally Posted by blabberer;93310]look for articles by peter ferrie / kris kaspersky etc


basically ollydbg break on memory access uses PAGE_GUARD and handles the exception raised iirc 0x80000001 and resets the flag using VirtualProtect

which possibly can be monitored is the underlying concept


By the way, the way Breakpoint-> Memory-On-Access works in OllyDbg is not by calling the "VirtualProtectEx" function with the "flNewProtect" parameter set to PAGE_GUARD. It just works by calling the "VirtualProtectEx" function with the "flNewProtect" parameter set to PAGE_NOACCESS. However, OllyDbg properly handles STATUS_GUARD_PAGE_VIOLATION exceptions.

aqrit
September 30th, 2012, 12:16
VirtualAlloc( MEM_WRITE_WATCH ) is similar

walied
October 1st, 2012, 08:31
Quote:
[Originally Posted by aqrit;93320]VirtualAlloc( MEM_WRITE_WATCH ) is similar

Thanks Sir. I really did not know that. It is really useful.