简体   繁体   English

如何从内存中读取字符串?

[英]How can i read a string from memory?

I'm working on a c++ windows application project.我正在开发一个 c++ windows 应用程序项目。 A portion of this project requires me to read the value of a memory address used in a separate process and use this value as a "trigger" within a function.该项目的一部分要求我读取在单独进程中使用的内存地址的值,并将该值用作函数中的“触发器”。 I know the value is a string, and constantly changes, but i have no idea how to read or use it.我知道该值是一个字符串,并且不断变化,但我不知道如何阅读或使用它。 Any ideas?有任何想法吗? Any help would be wonderful.任何帮助都会很棒。

Are you allowed to use standard IPC?是否允许使用标准 IPC? If not, you're going to run into issues.如果没有,你会遇到问题。 Processes are not supposed to share memory space like that.进程不应该像那样共享内存空间。 In fact, if you compile with standard settings and try to read outside your application's memory space, you'll get a fatal seg-fault.事实上,如果您使用标准设置进行编译并尝试读取应用程序内存空间之外的内容,则会出现致命的段错误。

What you're going to want to do is essentially design a very rudimentary debugger, which is no small task.您要做的基本上是设计一个非常基本的调试器,这不是一项小任务。 I would recommend starting by looking at existing debugger source code (eg, x64dbg, or cheat engine: https://github.com/cheat-engine/cheat-engine ).我建议首先查看现有的调试器源代码(例如,x64dbg,或作弊引擎: https : //github.com/cheat-engine/cheat-engine )。

What is the purpose of this project?这个项目的目的是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM