-
-
[技巧]在 WinDbg 脚本中使用参数
-
发表于:
2007-6-8 22:17
9151
-
WinDbg 6.7.5.0 版本运行脚本时多了一个新的命令 $$>a<,可以给脚本传递参数。下面是一个简单的例子,演示了参数的用法。
$$
$$ calc v0.0.1
$$ by 小喂 2007.06.08
$$
.if(@@c++(${/d:$arg1} && ${/d:$arg2}))
{
.printf "\n%d + %d = %d\n", ${$arg1}, ${$arg2}, ${$arg1} + ${$arg2}
.printf "%d - %d = %d\n", ${$arg1}, ${$arg2}, ${$arg1} - ${$arg2}
.printf "%d * %d = %d\n", ${$arg1}, ${$arg2}, ${$arg1} * ${$arg2}
.printf "%d / %d = %d\n", ${$arg1}, ${$arg2}, ${$arg1} / ${$arg2}
}
.else
{
.printf "\nusage: $$>a< <path>\calc.txt arg1 arg2\n\n"
}
运行一下:
0:000> $$>a< d:\windbg\scripts\calc.txt @eax 4
1580724 + 4 = 1580728
1580724 - 4 = 1580720
1580724 * 4 = 6322896
1580724 / 4 = 395181
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)