Skip to content

Commit

Permalink
[FEATURE] Rearanged fields in thread scan report
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Feb 5, 2025
1 parent 8a9e8bb commit 9d2e770
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions scanners/thread_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace pesieve {
outs << ",\n";
OUT_PADDED(outs, level, "\"thread_id\" : ");
outs << std::dec << tid;

outs << ",\n";
OUT_PADDED(outs, level, "\"indicators\" : [");
for (auto itr = indicators.begin(); itr != indicators.end(); ++itr) {
Expand All @@ -71,21 +72,7 @@ namespace pesieve {
outs << "\"" << indicator_to_str(*itr) << "\"";
}
outs << "]";
if (susp_addr) {
outs << ",\n";
if (this->module && this->moduleSize) {
OUT_PADDED(outs, level, "\"susp_addr\" : ");
}
else {
OUT_PADDED(outs, level, "\"susp_return_addr\" : ");
}
outs << "\"" << std::hex << susp_addr << "\"";
}
if (stack_ptr) {
outs << ",\n";
OUT_PADDED(outs, level, "\"susp_callstack\" : ");
outs << "\"" << std::hex << stack_ptr << "\"";
}

if (frames_count) {
outs << ",\n";
OUT_PADDED(outs, level, "\"frames_count\" : ");
Expand All @@ -102,6 +89,21 @@ namespace pesieve {
outs << "\"" << translate_wait_reason(thread_wait_reason) << "\"";
}
}
if (stack_ptr) {
outs << ",\n";
OUT_PADDED(outs, level, "\"susp_callstack_ptr\" : ");
outs << "\"" << std::hex << stack_ptr << "\"";
}
if (susp_addr) {
outs << ",\n";
if (this->module && this->moduleSize) {
OUT_PADDED(outs, level, "\"susp_addr\" : ");
}
else {
OUT_PADDED(outs, level, "\"susp_return_addr\" : ");
}
outs << "\"" << std::hex << susp_addr << "\"";
}
if (susp_addr) {
outs << ",\n";
OUT_PADDED(outs, level, "\"protection\" : ");
Expand Down

0 comments on commit 9d2e770

Please sign in to comment.