Skip to content

Commit

Permalink
[BUGFIX] Fixed variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Jun 9, 2024
1 parent f85cc3e commit 4ee66e4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions etw_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void runHHScan(std::uint32_t pid)
}
if (!shouldScan) {
#ifdef _DEBUG
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::cout << std::dec << pid << " : " << now << ": Skipping the scan...\n";
#endif
return;
Expand All @@ -285,8 +285,10 @@ void runHHScan(std::uint32_t pid)
procStats[pid].cleanupThread();
procStats[pid].thread = new std::thread(runHHinNewThread, args);
#ifdef _DEBUG
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
std::cout << std::dec << pid << " : Running a new thread: " << procStats[pid].thread->get_id() << std::endl;
{
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::cout << std::dec << pid << " : Running a new thread: " << procStats[pid].thread->get_id() << std::endl;
}
#endif
}

Expand Down Expand Up @@ -329,7 +331,7 @@ bool ETWstart()
procStats[pid].init();
procStats[pid].setProcessStart();
if (!g_hh_args.quiet) {
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::cout << std::dec << time(NULL) << " : New Process: " << filename << " (" << pid << ") Parent: " << parentPid << std::endl;
}
runHHScan(pid);
Expand All @@ -353,13 +355,13 @@ bool ETWstart()
std::wstring filename = parser.parse<std::wstring>(L"FileName");
if (!isDelayedLoad(pid)) {
#ifdef _DEBUG
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::wcout << " LOADING " << std::dec << pid << " : " << time(NULL) << " : IMAGE:" << filename << std::endl;
#endif
return;
}
if (!g_hh_args.quiet) {
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::wcout << std::dec << pid << " : " << time(NULL) << " : IMAGE:" << filename << std::endl;
}
runHHScan(pid);
Expand All @@ -373,7 +375,7 @@ bool ETWstart()
std::uint32_t pid = parser.parse<std::uint32_t>(L"PID");
if (!isWatchedPid(pid)) return;
if (!g_hh_args.quiet) {
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::wcout << std::dec << pid << " : " << schema.task_name() << " : " << schema.opcode_name() << "\n";
}
runHHScan(pid);
Expand All @@ -389,7 +391,7 @@ bool ETWstart()
if (!isWatchedPid(pid)) return;

if (!g_hh_args.quiet) {
const std::lock_guard<std::mutex> lock(g_stdOutMutex);
const std::lock_guard<std::mutex> stdOutlock(g_stdOutMutex);
std::wcout << std::dec << pid << " : " << schema.task_name() << " : " << schema.opcode_name() << "\n";
}
runHHScan(pid);
Expand Down

0 comments on commit 4ee66e4

Please sign in to comment.