高级内存编辑/函数调用
我对视频游戏的编码训练器(修改不同过程的值的程序)非常感兴趣。我已经完成了简单的“上帝模式”和“无限金钱”的事情,但我想做的远不止这些。 (使用 WriteProcessMemory 进行简单编辑)
我正在开发的视频游戏的互联网上有函数的内存地址,其中一个函数类似于“CreateCar”,我想从外部程序调用该函数。
我的问题:如何使用进程句柄或其他方法从 C/C++ 中的外部进程调用函数(提供函数地址)。
PS:如果有人可以将我链接到有助于此类事情的工具(我有调试器,不需要更多..),那就太好了。
I've gotten extremely interested into coding trainers (Program that modifies value of a different process) for video games. I've done the simple 'god-mode' and 'unlimited money' things, but I want to do alot more than that. (Simple editing using WriteProcessMemory)
There are memory addresses of functions on the internet of the video game I'm working on, and one of functions is like "CreateCar" and I'm wanting to call that function from an external program.
My question: How can I call a function from an external process in C/C++, provided the function address, using a process handle or other method.
PS: If anyone could link me to tools (I've got debuggers, no need for more..) that help with this sort of thing, that'd be nice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能,至少不能安全。如果该函数只有一个参数,则可以在该进程中的函数地址处创建一个新线程。如果它有更多,您可能需要注入一个 DLL 来完成它。
但这些解决方案都不安全,因为如果其他线程当前正在使用数据结构,则创建新线程来运行该函数可能会损坏数据结构。在另一个进程中调用函数的唯一安全方法是以某种方式将调用插入到该进程中正确的位置,以便它在逻辑上对于该程序来说是正确的。不要介意技术障碍(在任意位置插入挂钩);你需要确切地知道程序是如何工作的,这基本上意味着你需要进行大量的逆向工程(或者你需要获取源代码)。
You can't, at least not safely. If the function has exactly one parameter, you can create a new thread in that process at the function address. If it has more, you might want to inject a DLL to do it.
But neither of these solutions are safe because creating a new thread to run the function can and will corrupt data structures if other threads are currently using them. The only safe way to call a function in another process is to somehow insert the call in exactly the right place in that process so that it's logically correct for that program. Never mind the technical hurdles (inserting hooks at arbitrary locations); you need to know exactly how the program works, which basically means you have a lot of reverse engineering ahead of you (or you need to get the source code).