A forum for reverse engineering, OS internals and malware analysis 

Discussion on reverse-engineering and debugging.
 #5165  by Brookit
 Fri Feb 25, 2011 11:57 am
I’ve coded this tool-set last year and only now I decided to share it with small modifications. Pack includes binaries and source code and short description how it works. Except anti-anti-debugging it shows how we can silently hook SSDT functions on Windows 7 x64. Basically it only hides from IsDebuggerPresent and CheckRemoteDebuggerPresent sometimes it’s enough to bypass anti-debugging checks especially when advanced plugins for OllyDbg are not working because they are using drivers.
http://int0h.wordpress.com/2011/02/22/a ... via-wow64/
 #5167  by EP_X0FF
 Fri Feb 25, 2011 12:11 pm
How does Native API hooking in user mode related to SSDT kernel mode patch?
Or I miss something?
 #5267  by EP_X0FF
 Wed Mar 02, 2011 1:07 pm
Interception of code area at fs:[0xc0] ... this leads to a far jmp into wow64cpu.dll .. yes?
Maybe it is the simplest way, don't know :)

This project shows how you can use advantages of Wow64 system in case of antidebugging.

First of all you might know that all Wow64 processes (32 bit) runs in user mode emulation.
It's provided by three dll's:

Wow64.dll provides the core emulation infrastructure and the thunks for the Ntoskrnl.exe entry-point functions.
Wow64Win.dll provides thunks for the Win32k.sys entry-point functions.
Wow64Cpu.dll is an interface library that abstracts characteristics of the host processor.
Wow64 also can use special custom wow64 logger - wow64log.dll

This project uses custom wow64log.dll implementation to get in target process context. Fake logger dll loads your payload dll at DllMain.
Payload dll clears PEB->BeingDebugged flag, hooks NtQueryInformationProcess (for faking ProcessDebugPort information) and starts Native watchdog thread, which main purpose - constantly zero PEB->BeingDebugged flag by switching mode from 64 bit to 32 bit, jumping back and so on.

Hook itself is trivial jmp (see source).
Under "SSDT functions" author means trivial user mode Native API. So this is not PageGuard bypass or something extra-ordinal.