Skip to content

Commit

Permalink
[BUGFIX] Fixed for compatibility with MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Oct 31, 2024
1 parent 915235a commit 48178af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions etw_listener.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "etw_listener.h"
#include "hh_scanner.h"
#include <winmeta.h>

#include <string>
#include <thread>
#include <mutex>
Expand Down Expand Up @@ -297,13 +297,15 @@ bool ETWstart(ETWProfile& settings)
// Process Start Trigger
processProvider.add_on_event_callback([](const EVENT_RECORD& record, const krabs::trace_context& trace_context)
{
const int OPCODE_START = 0x1;
const int OPCODE_STOP = 0x2;
krabs::schema schema(record, trace_context.schema_locator);
if (schema.event_opcode() == WINEVENT_OPCODE_STOP) {
if (schema.event_opcode() == OPCODE_STOP) {
krabs::parser parser(schema);
std::uint32_t pid = parser.parse<std::uint32_t>(L"ProcessId");
procStats[pid].cleanupThread();
}
if (schema.event_opcode() == WINEVENT_OPCODE_START)
if (schema.event_opcode() == OPCODE_START)
{
krabs::parser parser(schema);
std::uint32_t parentPid = parser.parse<std::uint32_t>(L"ParentId");
Expand Down
2 changes: 1 addition & 1 deletion etw_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>

#include <sstream>
#include <WinSock2.h>
#include <winsock2.h>
#include <windows.h>
#include <time.h>

Expand Down
3 changes: 1 addition & 2 deletions hh_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ namespace util {
{
std::wstringstream stream;

std::set<TYPE_T>::iterator itr;
for (itr = list.begin(); itr != list.end(); ) {
for (auto itr = list.begin(); itr != list.end(); ) {
stream << *itr;
++itr;
if (itr != list.end()) {
Expand Down
2 changes: 1 addition & 1 deletion pe-sieve

0 comments on commit 48178af

Please sign in to comment.