System.NullReferenceException occurred in Unknown module

c++ / delphi package - dll injection and api hooking
Post Reply
tuantm
Posts: 1
Joined: Wed Aug 22, 2012 7:34 am

System.NullReferenceException occurred in Unknown module

Post by tuantm »

Currently I'm developing a CSharp Project which use madCHook.dll to do the Ipc Stuff (CreateIpcQueue, SendIpcMessage ...) to a C++ service which do the hook work to all process. This combination worked correctly but after each 2 minutes running, my c# program was always terminated by an Exception as below:

"System.NullReferenceException occurred in Unknown module
Additional Information: Object reference not set to an instance of an object"

The program was break at a thread with TID = 6316 and when I looked at processxp (sysinternals), it was a madchook.dll thread (madCHook.dll+0x1bb2c in Windows XP SP3 32bit).

Do anyone have any ideas?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: System.NullReferenceException occurred in Unknown module

Post by madshi »

madCodeHook 3.x does not have a madCHook.dll, anymore. And it's no longer recommended to use that dll with madCodeHook 2.x, either. What you should do instead is write your own dll with MSVC++ by using the madCodeHook static lib. Your dll would then do all the madCodeHook related stuff inside and export just one or two functions for your C# project.
Post Reply