Iterating through !DumpHeap output to read value at memory offset

江枫思渺然 提交于 2019-12-01 20:53:16
xxbbcc

After further searching, I found that I was using the wrong syntax. According to question and to MSDN, variable names must be surrounded by spaces or must be enclosed in ${...} to work. After I used the ${} enclosure, my script started working.

For future reference, here's how to run the script (keep it on one line in WinDbg):

.foreach(myaddress {!dumpheap -short -mt 000007fe998adea8})
{r @$t0=poi(${myaddress}+0x8);!do @$t0;.echo ************* myaddress}

yes you need space around the aliases

.foreach ( place { .shell -ci "!DumpHeap -stat" sed 1,3d | awk "{print $1 }" } ) { .foreach (plays { !DumpHeap -short -mt place } ) { r $t0 = poi( plays + 8 ) ; !do @$t0 ; .echo ========================================= } }

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!