Memory Scan
本帖最後由 kkmomo 於 2015-1-1 22:05 編輯 <br /><br /><div>為了找特殊值只好自己寫一個</div><div>偷懶就寫得很隨便~<br>這裡的直接寫死成找 DWORD 而已</div><div>需要找別的要自己改<br><br><span style="color: rgb(0, 0, 0); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace, serif; font-size: 11.818181991577148px; line-height: 21px;">找加密過的值在 getCryptValue 裡換成解密運算就可以</span></div><div><span style="color: rgb(0, 0, 0); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace, serif; font-size: 11.818181991577148px; line-height: 21px;">(像是找動態數據什麼的)</span><br><br>也可以參考google到的這篇<br>http://www.csdn123.com/html/mycsdn20140110/65/659154f3fcd53390cb5cc65945fc3cb7.html<br><br><ol style="padding-left: 5px; color: rgb(172, 172, 172); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace, serif; font-size: 12px; line-height: 21px; list-style: none; background-color: rgb(248, 248, 248);"><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);">DWORD getCryptValue<span class="br0" style="color: rgb(0, 128, 0);">(</span>DWORD ptr<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">return</span> <span class="sy2" style="color: rgb(0, 0, 64);">*</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>PDWORD<span class="br0" style="color: rgb(0, 128, 0);">)</span>ptr<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> </div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="kw4" style="color: rgb(0, 0, 255);">int</span> FirstMemScan<span class="br0" style="color: rgb(0, 128, 0);">(</span>HANDLE hProcess, DWORD start, DWORD end, DWORD value, DWORD <span class="sy2" style="color: rgb(0, 0, 64);">*</span>result, <span class="kw4" style="color: rgb(0, 0, 255);">int</span> size<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> MEMORY_BASIC_INFORMATION mbi<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> DWORD localStart<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> DWORD localEnd<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> DWORD totalsize<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw4" style="color: rgb(0, 0, 255);">int</span> count<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> </div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> VirtualQueryEx<span class="br0" style="color: rgb(0, 128, 0);">(</span>hProcess, <span class="br0" style="color: rgb(0, 128, 0);">(</span>PVOID<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>start<span class="br0" style="color: rgb(0, 128, 0);">)</span>, <span class="sy3" style="color: rgb(0, 0, 64);">&</span>mbi, <span class="kw3" style="color: rgb(0, 0, 221);">sizeof</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>MEMORY_BASIC_INFORMATION<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> localStart <span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>DWORD<span class="br0" style="color: rgb(0, 128, 0);">)</span>mbi.<span class="me1" style="color: rgb(0, 119, 136);">BaseAddress</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> count <span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="nu0" style="color: rgb(0, 0, 221);">0</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> </div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">while</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart <span class="sy1" style="color: rgb(0, 0, 128);"><</span> MEMORY_BOUNDARY <span class="sy3" style="color: rgb(0, 0, 64);">&&</span> localStart <span class="sy1" style="color: rgb(0, 0, 128);"><=</span> end<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span><span class="br0" style="color: rgb(0, 128, 0);">(</span> <span class="sy3" style="color: rgb(0, 0, 64);">!</span>IsValidMem<span class="br0" style="color: rgb(0, 128, 0);">(</span>mbi<span class="br0" style="color: rgb(0, 128, 0);">)</span> <span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> localStart <span class="sy2" style="color: rgb(0, 0, 64);">+</span><span class="sy1" style="color: rgb(0, 0, 128);">=</span> mbi.<span class="me1" style="color: rgb(0, 119, 136);">RegionSize</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> VirtualQueryEx<span class="br0" style="color: rgb(0, 128, 0);">(</span>hProcess, <span class="br0" style="color: rgb(0, 128, 0);">(</span>PVOID<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart<span class="br0" style="color: rgb(0, 128, 0);">)</span>, <span class="sy3" style="color: rgb(0, 0, 64);">&</span>mbi, <span class="kw3" style="color: rgb(0, 0, 221);">sizeof</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>MEMORY_BASIC_INFORMATION<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">continue</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> totalsize <span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="nu0" style="color: rgb(0, 0, 221);">0</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">while</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart <span class="sy2" style="color: rgb(0, 0, 64);">+</span> totalsize <span class="sy1" style="color: rgb(0, 0, 128);"><</span> MEMORY_BOUNDARY<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> VirtualQueryEx<span class="br0" style="color: rgb(0, 128, 0);">(</span>hProcess, <span class="br0" style="color: rgb(0, 128, 0);">(</span>PVOID<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart <span class="sy2" style="color: rgb(0, 0, 64);">+</span> totalsize<span class="br0" style="color: rgb(0, 128, 0);">)</span>, <span class="sy3" style="color: rgb(0, 0, 64);">&</span>mbi, <span class="kw3" style="color: rgb(0, 0, 221);">sizeof</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>MEMORY_BASIC_INFORMATION<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span><span class="br0" style="color: rgb(0, 128, 0);">(</span> <span class="sy3" style="color: rgb(0, 0, 64);">!</span>IsValidMem<span class="br0" style="color: rgb(0, 128, 0);">(</span>mbi<span class="br0" style="color: rgb(0, 128, 0);">)</span> <span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">break</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> totalsize <span class="sy2" style="color: rgb(0, 0, 64);">+</span><span class="sy1" style="color: rgb(0, 0, 128);">=</span> mbi.<span class="me1" style="color: rgb(0, 119, 136);">RegionSize</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> localEnd <span class="sy1" style="color: rgb(0, 0, 128);">=</span> min<span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart <span class="sy2" style="color: rgb(0, 0, 64);">+</span> totalsize, end<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">for</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>DWORD curr <span class="sy1" style="color: rgb(0, 0, 128);">=</span> max<span class="br0" style="color: rgb(0, 128, 0);">(</span>localStart , start<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span> curr <span class="sy1" style="color: rgb(0, 0, 128);"><</span> localEnd<span class="sy4" style="color: rgb(0, 128, 128);">;</span> curr <span class="sy2" style="color: rgb(0, 0, 64);">+</span><span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="nu0" style="color: rgb(0, 0, 221);">4</span><span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>getCryptValue<span class="br0" style="color: rgb(0, 128, 0);">(</span>curr<span class="br0" style="color: rgb(0, 128, 0);">)</span> <span class="sy1" style="color: rgb(0, 0, 128);">==</span> value<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> result<span class="br0" style="color: rgb(0, 128, 0);">[</span>count<span class="sy2" style="color: rgb(0, 0, 64);">++</span><span class="br0" style="color: rgb(0, 128, 0);">]</span> <span class="sy1" style="color: rgb(0, 0, 128);">=</span> curr<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> debug<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"[%4d] %08X<span class="es1" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>, count <span class="sy2" style="color: rgb(0, 0, 64);">-</span> <span class="nu0" style="color: rgb(0, 0, 221);">1</span>, result<span class="br0" style="color: rgb(0, 128, 0);">[</span>count <span class="sy2" style="color: rgb(0, 0, 64);">-</span> <span class="nu0" style="color: rgb(0, 0, 221);">1</span><span class="br0" style="color: rgb(0, 128, 0);">]</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>count <span class="sy1" style="color: rgb(0, 0, 128);">>=</span> size<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> debug<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"result arrive max size<span class="es1" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">break</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>count <span class="sy1" style="color: rgb(0, 0, 128);">>=</span> size<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">break</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> localStart <span class="sy2" style="color: rgb(0, 0, 64);">+</span><span class="sy1" style="color: rgb(0, 0, 128);">=</span> totalsize<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">return</span> count<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> </div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="kw4" style="color: rgb(0, 0, 255);">int</span> MemScan<span class="br0" style="color: rgb(0, 128, 0);">(</span>HANDLE hProcess, DWORD value, DWORD <span class="sy2" style="color: rgb(0, 0, 64);">*</span>oldResult, DWORD <span class="sy2" style="color: rgb(0, 0, 64);">*</span>newResult, <span class="kw4" style="color: rgb(0, 0, 255);">int</span> size<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> MEMORY_BASIC_INFORMATION mbi<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw4" style="color: rgb(0, 0, 255);">int</span> count <span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="nu0" style="color: rgb(0, 0, 221);">0</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>oldResult <span class="sy1" style="color: rgb(0, 0, 128);">==</span> nullptr <span class="sy3" style="color: rgb(0, 0, 64);">||</span> newResult <span class="sy1" style="color: rgb(0, 0, 128);">==</span> nullptr<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">return</span> <span class="sy2" style="color: rgb(0, 0, 64);">-</span><span class="nu0" style="color: rgb(0, 0, 221);">1</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> </div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">for</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="kw4" style="color: rgb(0, 0, 255);">int</span> index <span class="sy1" style="color: rgb(0, 0, 128);">=</span> <span class="nu0" style="color: rgb(0, 0, 221);">0</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span> index <span class="sy1" style="color: rgb(0, 0, 128);"><</span> size<span class="sy4" style="color: rgb(0, 128, 128);">;</span> index<span class="sy2" style="color: rgb(0, 0, 64);">++</span><span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">if</span> <span class="br0" style="color: rgb(0, 128, 0);">(</span>IsValidPtr<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>PVOID<span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">(</span>oldResult<span class="br0" style="color: rgb(0, 128, 0);">[</span>index<span class="br0" style="color: rgb(0, 128, 0);">]</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="br0" style="color: rgb(0, 128, 0);">)</span> <span class="sy3" style="color: rgb(0, 0, 64);">&&</span> getCryptValue<span class="br0" style="color: rgb(0, 128, 0);">(</span>oldResult<span class="br0" style="color: rgb(0, 128, 0);">[</span>index<span class="br0" style="color: rgb(0, 128, 0);">]</span><span class="br0" style="color: rgb(0, 128, 0);">)</span> <span class="sy1" style="color: rgb(0, 0, 128);">==</span> value<span class="br0" style="color: rgb(0, 128, 0);">)</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">{</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> newResult<span class="br0" style="color: rgb(0, 128, 0);">[</span>count<span class="sy2" style="color: rgb(0, 0, 64);">++</span><span class="br0" style="color: rgb(0, 128, 0);">]</span> <span class="sy1" style="color: rgb(0, 0, 128);">=</span> oldResult<span class="br0" style="color: rgb(0, 128, 0);">[</span>index<span class="br0" style="color: rgb(0, 128, 0);">]</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> debug<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"new[%4d] %08X<span class="es1" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>, count <span class="sy2" style="color: rgb(0, 0, 64);">-</span> <span class="nu0" style="color: rgb(0, 0, 221);">1</span>, newResult<span class="br0" style="color: rgb(0, 128, 0);">[</span>count <span class="sy2" style="color: rgb(0, 0, 64);">-</span> <span class="nu0" style="color: rgb(0, 0, 221);">1</span><span class="br0" style="color: rgb(0, 128, 0);">]</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li><li class="li2" style="-webkit-user-select: none;"><div class="de2" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"> <span class="kw1" style="color: rgb(0, 0, 255);">return</span> count<span class="sy4" style="color: rgb(0, 128, 128);">;</span></div></li><li class="li1" style="-webkit-user-select: none;"><div class="de1" style="-webkit-user-select: text; padding-right: 5px; padding-left: 5px; vertical-align: top; color: rgb(0, 0, 0); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-left: -7px; position: relative; background: rgb(255, 255, 255);"><span class="br0" style="color: rgb(0, 128, 0);">}</span></div></li></ol><br><br></div><p></p> 本帖最後由 nmasd1023 於 2015-2-5 09:15 編輯不客氣地收下了:)
頁:
[1]