映射函数名称和内存地址 [英] mapping Function names and Memory addresses

查看:132
本文介绍了映射函数名称和内存地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有,



我正在开发一个可以改变正在运行的应用程序数据的WinDBG扩展。

此时我可以获取关键部分的内存地址。

但我的要求是获取给定函数名的内存地址。

有没有办法做同样的事情(直接命令或一组命令)。



提前致谢。

Hey all,

I am working on a WinDBG extension that can alter data of a running application.
At this point i am able to fetch the memory addresses of critical sections.
But my requirement is to get the memory address of a given function name.
Is there a way to do the same (a direct command or a set of commands).

Thanks in advance.

推荐答案





请参阅以下链接,这可能会对您有所帮助。



http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/e14aadd4-5711-42a4-b635- 4044e219493e / [ ^ ]



如何使用C#编写内存扫描仪 [ ^ ]


当你需要找到已知函数或全局变量所在的地址时,你可以使用命令的
windbg.exe调试器。在尝试设置

代码或数据断点时,此转换通常很有用。为了实现这一点,自然地,包含

函数或全局符号的模块(DLL或主EXE)应该已经被目标进程加载。请注意,此命令

还支持通配符(*),这通常可以方便地发现与给定模式匹配的可用

符号(函数或全局变量)名称





0:000> x记事本!*主*

00151320记事本!_imp ____ getmainargs =<没有类型信息>

00151405记事本!WinMain =<没有类型信息>

00153689 notepad!WinMainCRTStartup =<没有类型信息>

0:000> x记事本!g_ *

0015c00c记事本!g_ftOpenedAs =<没有类型信息>

0015e040记事本!g_ftSaveAs =<没有类型信息>

0015c100 notepad!g_wpOrig =<没有类型信息>





参考:Windows调试内部(Tarik Soulami)
When you need to find the address at which a known function or a global variable resides, you can
use the x command of the windbg.exe debugger. This translation is often useful when trying to set
code or data breakpoints. For this to work, naturally, the module (DLL or main EXE) that contains the
function or global symbol should’ve already been loaded by the target process. Note that this command
also supports the wildcard character (*), which is often convenient for discovering the available
symbol (function or global variable) names that match a given pattern
.

0:000> x notepad!*main*
00151320 notepad!_imp____getmainargs = <no type information>
00151405 notepad!WinMain = <no type information>
00153689 notepad!WinMainCRTStartup = <no type information>
0:000> x notepad!g_*
0015c00c notepad!g_ftOpenedAs = <no type information>
0015e040 notepad!g_ftSaveAs = <no type information>
0015c100 notepad!g_wpOrig = <no type information>


reference : Inside Windows Debugging (Tarik Soulami)


这篇关于映射函数名称和内存地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆