Skip to content

Commit

Permalink
[FEATURE] Updated pe-sieve to use the new sig_finder. Show scan time …
Browse files Browse the repository at this point in the history
…in seconds and minutes
  • Loading branch information
hasherezade committed Feb 12, 2024
1 parent 162e8ec commit a89581e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion hh_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,30 @@ std::string HHScanReport::toJSON(const t_hh_params &params)
return stream.str();
}


void print_scantime(std::stringstream &stream, size_t timeInMs)
{
float seconds = ((float)timeInMs / 1000);
float minutes = ((float)timeInMs / 60000);
stream << std::dec << timeInMs << " ms.";
if (seconds > 0.5) {
stream << " = " << seconds << " sec.";
}
if (minutes > 0.5) {
stream << " = " << minutes << " min.";
}
}

std::string HHScanReport::toString()
{
std::stringstream stream;
//summary:
stream << "--------" << std::endl;
stream << "SUMMARY:\n";
stream << "Scan at: " << util::strtime(this->startTime) << " (" << std::dec << startTime << ")\n";
stream << "Finished scan in: " << std::dec << getScanTime() << " milliseconds\n";
stream << "Finished scan in: ";
print_scantime(stream, getScanTime());
stream << "\n";
stream << "[*] Total scanned: " << std::dec << countTotal() << "\n";
stream << "[*] Total suspicious: " << std::dec << countSuspicious() << "\n";
if (countSuspicious() > 0) {
Expand Down
2 changes: 1 addition & 1 deletion pe-sieve

0 comments on commit a89581e

Please sign in to comment.