From 4add6313e9b795089a9e830920d7491857e70d67 Mon Sep 17 00:00:00 2001 From: Jason Hood Date: Sun, 5 Feb 2012 11:31:39 +1000 Subject: [PATCH] Fix 32-bit process identifying 64-bit process. --- proctype.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proctype.c b/proctype.c index cc665d1..81213f9 100644 --- a/proctype.c +++ b/proctype.c @@ -75,6 +75,15 @@ int ProcessType( LPPROCESS_INFORMATION pinfo, BOOL* gui ) } } } +#ifdef _WIN32 + // If a 32-bit process manages to load a 64-bit one, we may miss the base + // address. If the pointer overflows, assume 64-bit and abort. + if (ptr > ptr + minfo.RegionSize) + { + DEBUGSTR( 1, L" Ignoring apparent 64-bit process." ); + return 0; + } +#endif } DEBUGSTR( 1, L" Ignoring non-Windows process" );