您不能在 char * 上使用 /mu /mu 用于 null 终止的 unicode 字符串 而不是 ascii 字符串对于 ascii 字符串 使用 /ma
我假设你有描述性的参数名称,而不是像 d 这样的参数
这显然会与 0xd aka 0n13
is d a number , string or symbol ??
poi(d) 在你的情况下会解决什么是 poi(0x13) 这显然是一个不好的取消引用
或一个局部符号不合逻辑地命名为 d ??
当你中断时,别名也不会被解释
使用别名时,您应该始终将它们填充到脚本文件中并执行
每次中断时的脚本文件
这里是一个脚本文件的例子
as /ma ${/v:MyAlias} poi(k)
.block {
r $t0 = $spat("${MyAlias}" , "tiger")
.printf "%x\t${MyAlias}\n" , @$t0
.if(@$t0 != 1) {gc}
}
这是在调试模式下编译并关闭优化的代码
在发布模式下编译器将足够聪明,可以内联 printf() 调用
#include <stdio.h>
#include <stdlib.h> //msvc _countof
void func(char* h,char* i,char* j,char* k ) {
printf( "%s %s %s %s\n" ,h,i,j,k );
return;
}
int main(void) {
char* foo[] = {"goat","dog","sheep","cat","lion","tiger",0,"vampire"};
for(int x=0;x<_countof(foo);x++) {
func("this" , "is" , "a" , foo[x]);
}
return 0;
}
用法
windbg app.exe
设置休息并运行
请记住,此脚本或任何使用别名的脚本都会失败
评估 char * vampire
之前的空条目
如果你想打破“吸血鬼”,你可能需要在不使用别名的情况下即兴发挥
0:000> bl
0:000> bp strbp!func "$$>a< strbpcond.txt"
0:000> bl
0 e 00171260 0001 (0001) 0:**** strbp!func "$$>a< strbpcond.txt"
0:000> g
ModLoad: 72670000 72673000 C:\Windows\system32\api-ms-win-core-synch-l1-2-0.DLL
0 goat
0 dog
0 sheep
0 cat
0 lion
1 tiger
eax=00000005 ebx=7ffd7000 ecx=00000005 edx=001ac1e0 esi=001b6678 edi=001b667c
eip=00171260 esp=002bfa54 ebp=002bfa90 iopl=0 nv up ei ng nz ac po cy
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000293
strbp!func:
00171260 55 push ebp
0:000> dv
h = 0x001ac1f8 "this"
i = 0x001ac1f4 "is"
j = 0x001ac1f0 "a"
k = 0x001ac1e0 "tiger"