does anyone know if I can point to function in C# (not delegates), like in C++?
I've googled it and all I can found is about delegates.
I want to cast an address into a pointer of a function.
does anyone know if I can point to function in C# (not delegates), like in C++?
I've googled it and all I can found is about delegates.
I want to cast an address into a pointer of a function.
It doesn't work that way. Your C# code isn't in the processes address space so you have to allocate memory and call functions via a new thread.
You can't do that with C#. You can however, write a small stub in C++ to point that function to your managed code. (Though, at that point, it's probably easier just to go fully C++)
This would require you to load the CLR from the target process, and then load your managed code.
thx it's the same as what I thought
Oh I misread. He basically wants detours in C#? Yeah, not gonna happen.
I guess I'll have to manage something with both C# and C++
Or just do it in all C++ and save yourself a bunch of hassle.
yeah, maybe...
I'll have to rewrite some of the BlackMagic's features into C++.
EDIT: btw should I open any specific type of project in C++ for the bot and the injected dll or just a normal empty project?
Last edited by Shamun; 12-10-2008 at 04:10 PM.
Errr, you don't have to rewrite any of BlackMagic. The whole point of BlackMagic is its working around a lot of limitations imposed by the language. Once you're using native code and inside your targets address space all those limitations are gone.
^this
The only reason I even bothered with writing the BlackMagic library is I'm, for no particular reason, currently dedicated to C#. I can't explain it. Maybe it's because I never bothered to learn about creating dialog windows in unmanaged code, maybe it's because I'm an idiot. If you want ease of use from a bot standpoint--i.e. want to easily be able to call things in-process, etc.--write it in C++. Period.
I actually lol'd.yeah, maybe...
I'll have to rewrite some
Thanks for the help I got your point...