Skip to content

Commit

Permalink
deploy: 64a3b8b
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Sep 1, 2024
1 parent 464098f commit 5e56fce
Showing 1 changed file with 46 additions and 44 deletions.
90 changes: 46 additions & 44 deletions scanner_8cpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -597,52 +597,54 @@
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"><a class="line" href="classpesieve_1_1_process_scanner.html#a2ef0c51dd3e22c63fda5473f5b329d42"> 471</a></span><span class="keywordtype">size_t</span> <a class="code hl_function" href="classpesieve_1_1_process_scanner.html#a2ef0c51dd3e22c63fda5473f5b329d42">pesieve::ProcessScanner::scanThreads</a>(<a class="code hl_class" href="classpesieve_1_1_process_scan_report.html">ProcessScanReport</a>&amp; pReport) <span class="comment">//throws exceptions</span></div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno"> 472</span>{</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno"> 473</span> <span class="keywordflow">if</span> (!this-&gt;symbols.IsInitialized()) {</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;Failed to initialize symbols!\n&quot;</span>;</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> }</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> </div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <span class="keyword">const</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> pid = pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a4ff2814953f08eb5a0850a2584bfd465">pid</a>; <span class="comment">//original PID, not a reflection!</span></div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;[-] Failed to initialize symbols!\n&quot;</span>;</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> }</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> }</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> </div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> is_64bit = <a class="code hl_function" href="namespacepesieve_1_1util.html#a015be6a0937814caf43586043817d922">pesieve::util::is_process_64bit</a>(this-&gt;processHandle);</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span><span class="preprocessor">#ifndef _WIN64</span></div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> <span class="keywordflow">if</span> (is_64bit) <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Scanning threads.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> }</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> start_tick = GetTickCount();</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span> </div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> std::map&lt;DWORD, thread_info&gt; threads_info;</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#aef9d6cd060d349c27721f679bc2e2824">pesieve::util::fetch_threads_info</a>(pid, threads_info)) { <span class="comment">//extended info, but doesn&#39;t work on old Windows...</span></div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> </div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#a1274c2cd0b2ebfc7fac5ecc87330a579">pesieve::util::fetch_threads_by_snapshot</a>(pid, threads_info)) { <span class="comment">// works on old Windows, but gives less data..</span></div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> <span class="keyword">const</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> pid = pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a4ff2814953f08eb5a0850a2584bfd465">pid</a>; <span class="comment">//original PID, not a reflection!</span></div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span> </div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> is_64bit = <a class="code hl_function" href="namespacepesieve_1_1util.html#a015be6a0937814caf43586043817d922">pesieve::util::is_process_64bit</a>(this-&gt;processHandle);</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span><span class="preprocessor">#ifndef _WIN64</span></div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> <span class="keywordflow">if</span> (is_64bit) <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span> </div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Scanning threads.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span> }</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> start_tick = GetTickCount();</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> </div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> std::map&lt;DWORD, thread_info&gt; threads_info;</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#aef9d6cd060d349c27721f679bc2e2824">pesieve::util::fetch_threads_info</a>(pid, threads_info)) { <span class="comment">//extended info, but doesn&#39;t work on old Windows...</span></div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> </div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> std::cout &lt;&lt; <span class="stringliteral">&quot;[-] Failed enumerating threads.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span> }</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"> 498</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> }</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> }</div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#a5258d6e6ebd34e2239fdb335abc7cdad">pesieve::util::query_threads_details</a>(threads_info)) {</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno"> 502</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</span> std::cout &lt;&lt; <span class="stringliteral">&quot;[-] Failed quering thread details.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> }</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span> }</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> </div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> itr = threads_info.begin(); itr != threads_info.end(); ++itr) {</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</span> <span class="keyword">const</span> <a class="code hl_struct" href="structpesieve_1_1util_1_1__thread__info.html">thread_info</a> &amp;<a class="code hl_function" href="namespacepesieve.html#ac299ba917fb6598dc9de71516cf71c84">info</a> = itr-&gt;second;</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> </div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span> <a class="code hl_class" href="classpesieve_1_1_thread_scanner.html">ThreadScanner</a> scanner(this-&gt;processHandle, this-&gt;isReflection, <a class="code hl_function" href="namespacepesieve.html#ac299ba917fb6598dc9de71516cf71c84">info</a>, pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a86f176fae060ac8d4383722e8cda6bc8">modulesInfo</a>, pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a4f395a9b2f05200683c08886fb81e992">exportsMap</a>, &amp;symbols);</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span> <a class="code hl_class" href="classpesieve_1_1_thread_scan_report.html">ThreadScanReport</a>* <a class="code hl_struct" href="structreport.html">report</a> = scanner.<a class="code hl_function" href="classpesieve_1_1_thread_scanner.html#a23839353374eedcda7c92b0c7ce6b3bf">scanRemote</a>();</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> pReport.<a class="code hl_function" href="classpesieve_1_1_process_scan_report.html#a3c0957c36cf674677e5b6610db8703ea">appendReport</a>(<a class="code hl_struct" href="structreport.html">report</a>);</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span> }</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno"> 514</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> <span class="keyword">const</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> total_time = GetTickCount() - start_tick;</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno"> 516</span> <a class="code hl_function" href="namespacepesieve.html#a56f68849d06a2630a2c87ed53f17193b">print_scan_time</a>(<span class="stringliteral">&quot;Threads&quot;</span>, total_time);</div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno"> 517</span> }</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"> 519</span>}</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#a1274c2cd0b2ebfc7fac5ecc87330a579">pesieve::util::fetch_threads_by_snapshot</a>(pid, threads_info)) { <span class="comment">// works on old Windows, but gives less data..</span></div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> </div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"> 498</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;[-] Failed enumerating threads.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> }</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span> }</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno"> 502</span> }</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="namespacepesieve_1_1util.html#a5258d6e6ebd34e2239fdb335abc7cdad">pesieve::util::query_threads_details</a>(threads_info)) {</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span> std::cout &lt;&lt; <span class="stringliteral">&quot;[-] Failed quering thread details.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> }</div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</span> }</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</span> </div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> itr = threads_info.begin(); itr != threads_info.end(); ++itr) {</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span> <span class="keyword">const</span> <a class="code hl_struct" href="structpesieve_1_1util_1_1__thread__info.html">thread_info</a> &amp;<a class="code hl_function" href="namespacepesieve.html#ac299ba917fb6598dc9de71516cf71c84">info</a> = itr-&gt;second;</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span> </div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> <a class="code hl_class" href="classpesieve_1_1_thread_scanner.html">ThreadScanner</a> scanner(this-&gt;processHandle, this-&gt;isReflection, <a class="code hl_function" href="namespacepesieve.html#ac299ba917fb6598dc9de71516cf71c84">info</a>, pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a86f176fae060ac8d4383722e8cda6bc8">modulesInfo</a>, pReport.<a class="code hl_variable" href="classpesieve_1_1_process_scan_report.html#a4f395a9b2f05200683c08886fb81e992">exportsMap</a>, &amp;symbols);</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span> <a class="code hl_class" href="classpesieve_1_1_thread_scan_report.html">ThreadScanReport</a>* <a class="code hl_struct" href="structreport.html">report</a> = scanner.<a class="code hl_function" href="classpesieve_1_1_thread_scanner.html#a23839353374eedcda7c92b0c7ce6b3bf">scanRemote</a>();</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno"> 514</span> pReport.<a class="code hl_function" href="classpesieve_1_1_process_scan_report.html#a3c0957c36cf674677e5b6610db8703ea">appendReport</a>(<a class="code hl_struct" href="structreport.html">report</a>);</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> }</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno"> 516</span> <span class="keywordflow">if</span> (!args.quiet) {</div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno"> 517</span> <span class="keyword">const</span> <a class="code hl_function" href="namespacepesieve_1_1util.html#ac533b9c8a18228f62223a0042c40f5ae">DWORD</a> total_time = GetTickCount() - start_tick;</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> <a class="code hl_function" href="namespacepesieve.html#a56f68849d06a2630a2c87ed53f17193b">print_scan_time</a>(<span class="stringliteral">&quot;Threads&quot;</span>, total_time);</div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"> 519</span> }</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span>}</div>
</div>
<div class="ttc" id="aclass_process_symbols_manager_html_a99ac137d11b68b281f8efc84fb1681da"><div class="ttname"><a href="class_process_symbols_manager.html#a99ac137d11b68b281f8efc84fb1681da">ProcessSymbolsManager::InitSymbols</a></div><div class="ttdeci">bool InitSymbols(HANDLE _hProcess)</div><div class="ttdef"><b>Definition</b> <a href="process__symbols_8h_source.html#l00020">process_symbols.h:20</a></div></div>
<div class="ttc" id="aclasspesieve_1_1_code_scan_report_html"><div class="ttname"><a href="classpesieve_1_1_code_scan_report.html">pesieve::CodeScanReport</a></div><div class="ttdoc">A report from the code scan, generated by CodeScanner.</div><div class="ttdef"><b>Definition</b> <a href="code__scanner_8h_source.html#l00013">code_scanner.h:14</a></div></div>
Expand Down

0 comments on commit 5e56fce

Please sign in to comment.