WinDBG脚本入门
最近开始看一些针对非托管进程的WinDBG的使用了, Tess推荐去看Debugging Toolbox. 其第一篇就把我难住了, 脚本看不懂.
动手实践了一下, 发现下面的文章所讲的内容特别有帮助, 于是转载在这里.
原文地址
First steps with WinDBG scripting… (Memento)
http://www.msuiche.net/2007/08/03/first-steps-with-windbg-scripting-memento/
Here is a sample of script for Windbg for people who doesn’t want to waste time because they don’t find any document.
Firstly, to declare a variable you must use the prefix “r”. Moreover, the name must be $t[0..n]
Secondly, if you use the flag “/D” after “.printf” you can use pseudo-html code inside.
Thirdly, to read the value of an address you have to use “poi()” with the prefix “@” like : poi(@$t0)
To write byte or dword, you should use “eb” or “ed”.
And… the most fun is that you can create links like the following scheme :
.printf /D “<link cmd=\”COMMAND_TO_EXECUTE\”>DISPLAY_TEXT</link>\\n”;
To execute a script use
kd> $$>< "FULL_SCRIPT_PATH"
References:
http://blogs.msdn.com/debuggingtoolbox/archive/tags/Windbg+Scripts/default.aspx
http://www.dumpanalysis.org/blog/index.php/category/windbg-scripts/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2011-03-15 如果域控(domain controller)在防火墙内, 那么需要开放哪些端口才能让墙外的机器正常连接domain controller呢?
2010-03-15 记一次看DUMP的实战
2010-03-15 跨Farm的SSP的配置
2010-03-15 如何在x64的机器上使用WinDBG来debug一个32bit的.NET应用程序
2010-03-15 Deferred Symbol Loading
2010-03-15 Conent Deployment Job 的一点知识 关于Change log
2010-03-15 SQL Error Log 的位置