C#查找进程启动内存 [英] C# finding process starting memory
本文介绍了C#查找进程启动内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我在C#中进行内存编辑时遇到问题。
我需要一种方法来查找'gta-sa'(0x2C0000)的内存值在C#中,每次应用程序启动时都会更改。
图像 [ ^ ]
任何帮助将不胜感激:)) />
我尝试了什么:
我试过在谷歌上看,但我不我认为我正确地写了这个问题。
Hello,
I have a problem with memory editing in C#.
I need a way to find out the memory value of 'gta-sa' (0x2C0000) in C# as it changes every time the application starts.
Image[^]
Any help would be greatly appreciated :)
What I have tried:
I tried looking on Google but I dont think I'm wording the question correctly.
推荐答案
你的错误。您打开该过程就好像它是一个文件并从该过程的开头开始阅读,您可以在扫雷,在幕后 [ ^ ]。
Your going about it wrong. You open the process as if it was a file and start reading from the beginning of the process, an example of which you can find at Minesweeper, Behind the scenes[^].
我找到了解决方案。
I have found a solution.
Process proc = Process.GetProcessesByName("gta-sa").First();
IntPtr startOffset = proc.MainModule.BaseAddress;
IntPtr endOffset = IntPtr.Add(startOffset ,proc.MainModule.ModuleMemorySize);
这将找到我需要的流程的基地址。
This will find the base address of the process I need.
这篇关于C#查找进程启动内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文