Support for showing if app is 32bit vs 64bit, and support for doing message hooks on both

Added support for message hook viewer to hook both 32 and 64 bit
applications.
Fixed filtering on the msg hook viewer
Added custom filtering on msg hook viewer
Added Process Id targetting on msg hook viewer
Added SetMsgHook.exe command line app as an alternative way of starting
msg hook viewer.
This commit is contained in:
Edward Jakubowski
2014-06-03 06:28:14 -04:00
parent 05748b4582
commit d100d23259
41 changed files with 1232 additions and 72 deletions

View File

@@ -8,6 +8,30 @@
#include "stdafx.h"
#include "org_synthuse_MsgHook.h"
/*
* Class: org_synthuse_MsgHook
* Method: initialize
* Signature: (Ljava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_initialize(JNIEnv *env, jobject obj, jstring jdll32bitname, jstring jdll64bitname)
{
const char *tdll32bitname = env->GetStringUTFChars(jdll32bitname, 0);//convert string
memset((void *)&dll32bitName, '\0', sizeof(TCHAR) * MAX_TEST_SIZE); // set TCHAR array to all 0
int tstrLen = MultiByteToWideChar(CP_UTF8, 0, tdll32bitname, (int)strlen(tdll32bitname), NULL, 0); //get t len
MultiByteToWideChar(CP_UTF8, 0, tdll32bitname, (int)strlen(tdll32bitname), dll32bitName, tstrLen); // convert char to tchar
env->ReleaseStringUTFChars(jdll32bitname, tdll32bitname); //release string
const char *tdll64bitname = env->GetStringUTFChars(jdll64bitname, 0);//convert string
memset((void *)&dll64bitName, '\0', sizeof(TCHAR) * MAX_TEST_SIZE); // set TCHAR array to all 0
tstrLen = MultiByteToWideChar(CP_UTF8, 0, tdll64bitname, (int)strlen(tdll64bitname), NULL, 0); //get t len
MultiByteToWideChar(CP_UTF8, 0, tdll64bitname, (int)strlen(tdll64bitname), dll64bitName, tstrLen); // convert char to tchar
env->ReleaseStringUTFChars(jdll64bitname, tdll64bitname); //release string
return true;
}
/*
* Class: org_synthuse_MsgHook
@@ -48,6 +72,12 @@ JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMsgHookWindowTargetClass
return true;
}
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMsgHookWindowTargetPid(JNIEnv *env, jobject obj, jint jpid)
{
_stprintf_s(targetProcessId, _T("%ld"), (long)jpid);
return true;
}
/*
* Class: org_synthuse_MsgHook
* Method: setMessageHook