Skip to content

Commit

Permalink
[REFACT] Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Oct 31, 2024
1 parent 70acb66 commit 8c5f325
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions etw_listener.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "etw_listener.h"
#ifdef __USE_ETW__

#include "hh_scanner.h"

#include <string>
Expand All @@ -8,8 +10,6 @@
#include "util/process_util.h"
#include "term_util.h"

#if (_MSC_VER >= 1900)

#define EXECUTABLE_FLAGS (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)
#define MAX_PROCESSES 65536

Expand Down Expand Up @@ -438,4 +438,4 @@ bool ETWstart(ETWProfile& settings)
return isOk;
}

#endif //(_MSC_VER >= 1900)
#endif // __USE_ETW__
6 changes: 4 additions & 2 deletions util/process_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

namespace process_util {


inline bool is_wow_64(HANDLE process)
{
FARPROC procPtr = GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process");
HMODULE kernel32 = GetModuleHandleA("kernel32");
if (!kernel32) return false; // should not happen

FARPROC procPtr = GetProcAddress(kernel32, "IsWow64Process");
if (!procPtr) {
//this system does not have a function IsWow64Process
return false;
Expand Down

0 comments on commit 8c5f325

Please sign in to comment.