Canty How do I cheat?
Reputation: 0
Joined: 11 Dec 2016 Posts: 2
|
Posted: Sun Dec 11, 2016 2:18 pm Post subject: Hooking in C# / .net framework application |
|
|
Hey guys!
I've been looking for a solution for this problem for a while now: I'm writing a hack via dll injection for a program, and I would really like to hook a specific function. Now, if that function was simply part of the windows api or any dll with exported symbols, I'd have no problem at all. Hooking that seems rather straightforwad, and there are hundreds of libraries available that allow you to do that without even knowing what you're doing.
Unfortunately, the function I want to hook is part of the .net framework. From what I've read, you have to mess around with JIT-compilation and also apply the hook at the exact, right time of it if you want every call, including the very first one, to be redirected. At least the function is static, so, unless the .net framework behaves different from what I'd expect, which I could totally imagine as a C++ developer, I wouldn't need an instance pointer or anything like that.
So, what I wanted to ask, is there any guide out there explaining how to hook managed code, maybe even a library that already allows it? It would be cool if it was for C++, though I'd be happy with a solution for C# as well. I'm not picky here, I just want this working.
Just editing the executable is not an option since it checks its own hash. That would probably be bypassable as well, but I'd rather not mess with that right now. The hooking approach would probably come in handy at other times later on as well.
So yeah, if anyone could help me out here, I'd be really grateful!
|
|