Hey there! I'm writing a DLL as a plugin for an unmanaged piece of software, the DLL exports a struct with basic information such as name etc. There is no problem with this, it works well, other than a couple of compiler warnings that I wont go into just yet. In my plugin, I want to use a managed class (__gc). I declare it as global like this: gcroot Omg;
Here is the class definition: public __gc class COmg { public: COmg( void ) {} ~COmg( void ) {} };
This still compiles and loads fine, until I try and use my gcroot'ed class: Omg = new COmg;
It dies at this line, as far as I know im linking with the .NET framework fine, because everything compiles and runs, and i've done similar projects to this in the past. I tried calling this in try/catch braces but it doesn't help. I'd appreciate any help! Thanks. P.S. Here are the compiler warnings that may be contributing to this? MSVCRT.lib(checkclr.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators MSVCRT.lib(secchk.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators Core.obj : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
X
Xen3h
@Xen3h
Posts
-
gcroot constructor crash -
Finding a structures addressI use some structures in an app using pointers, basically everytime the program gets updated these addresses change slightly, I usually get told by someone what the address is. Basically I want to be able to automatically find the address of the structure in the app, but i'm not sure how to do it.. I think i remember someone saying pattern searching or something. Any help is appreciated. :)
-
Directly Hooking a FunctionSay I know the address of a function (does this help), I want it to call my copy of the function, and then the original function. I want to do it without making a wrapper, and without hooking GetProcAddress because I can already do it that way, but i'd like a much more direct way possibly involving inline asm etc. Any help + ideas is appreciated. :)