delphi中其他进程的StackWalk?

发布于 2024-09-24 04:18:55 字数 31 浏览 1 评论 0原文

你知道如何在delphi中读取另一个进程堆栈吗?

Do you know how to read another process stack in delphi ??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

看轻我的陪伴 2024-10-01 04:18:55

是的。

您可以使用 Toolhelp 函数枚举线程;使用 GetThreadContext();并使用 ReadProcessMemory()。堆栈在内存中向下增长,因此在 ESP 之后读取内存位置会沿着堆栈向下增长。

Yes.

You can enumerate threads with Toolhelp functions; get the context with GetThreadContext(); and read the stack memory (i.e. using ESP from the context) with ReadProcessMemory(). The stack grows downwards in memory, so reading memory locations after ESP is going down the stack.

誰ツ都不明白 2024-10-01 04:18:55

您可以查看我的采样分析器以下单元的“TThreadSampler.MakeStackDump”过程: http://code.google.com/p/asmprofiler/source/browse/trunk/Sampling/mcThreadSampler.pas

该函数可以从同一个线程读取,或者同一个线程读取进程或不同进程(每个进程都有自己的优化功能)。

顺便说一句:我的采样分析器读取 Delphi 调试符号(.map、.jdbg 等),因为仍然没有好的 Delphi 到 Pdb 调试符号转换器(因此您可以在 Windows 调试器或 Process Explorer、Visual Studio 中查看 Delphi 程序的堆栈) ETC)。您还可以使用我的采样分析器来查看任何进程的当前堆栈!
http://code.google.com/p/asmprofiler/wiki/AsmProfilerSamplingMode

You could take a look at the "TThreadSampler.MakeStackDump" procedure of the following unit of my sampling profiler: http://code.google.com/p/asmprofiler/source/browse/trunk/Sampling/mcThreadSampler.pas

This function can read from the same thread, or same process or different process (each with it's own optimized function).

Btw: my Sampling Profiler reads Delphi debug symbols (.map, .jdbg, etc) because there is still no good Delphi to Pdb debug symbol converter (so you can view the stack of a Delphi program in Windows debugger or Process Explorer, Visual Studio etc). You can also use my sampling profiler for view the current stack of any process!
http://code.google.com/p/asmprofiler/wiki/AsmProfilerSamplingMode

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文