direct syscalls independent of the underlying bit width

This commit is contained in:
Geert Ijewski
2019-11-10 16:14:02 +01:00
commit 2129994ceb
9 changed files with 1353 additions and 0 deletions

38
misc.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef MISC_H
#define MISC_H
/**
\brief Checks if the page at addr is executable
*/
BOOL is_executable(LPVOID addr);
/**
\brief Checks if the process is running on WOW64 by examing Heaven's Gate
*/
BOOL is_WOW64();
/**
\brief Computes the djb2 hash of the input string
\param str The data to be hashed
\return The value.
*/
DWORD hash(const char* str);
/**
\brief Computes the djb2 hash of the input
\param buf The data to be hashed
\param sz The size of the data
\return The value.
*/
DWORD hash(const unsigned char* buf, const size_t sz);
/**
\brief Prints a small summarization of the current OS
*/
VOID print_os_info();
BOOL is_Win8();
#define GET_KUSER_SHARED_DATA() ((_KUSER_SHARED_DATA*)0x7FFE0000)
#endif