Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Aug 1, 2024
1 parent 317e2bb commit ead365b
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 15 deletions.
75 changes: 75 additions & 0 deletions sysBug/Configuration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* @file Configuration.h
* @author Sina Karvandi ([email protected])
* @brief Global configuration that applies on compile time
* @details you can disable or enable the following features and compile the
* project Next time you used the project binary files these settings applied.
* @version 0.1
* @date 2020-04-10
*
* @copyright This project is released under the GNU Public License v3.
*
*/
#pragma once

/**
* @brief Configures whether to show the current system time in the output of
* debug messages or not (only available on usermode tracing messages)
*
*/
#define ShowSystemTimeOnDebugMessages TRUE

/**
* @brief Use WPP Tracing instead of all logging functions
*
*/
#define UseWPPTracing FALSE

/**
* @brief Configures whether to use DbgPrint or use the custom usermode message
* tracking
*
*/
#define UseDbgPrintInsteadOfUsermodeMessageTracking FALSE

/**
* @brief Show debug messages in both usermode app and debugger,
* it works only if you set UseDbgPrintInsteadOfUsermodeMessageTracking to FALSE
* @details Should be FALSE, I realized that if we enable this flag, we end up
* in a situation that DbgPrint halts the system because it is executing in
* Dispatch-level in a DPC routine, I left it to FALSE for future attention
*/
#define ShowMessagesOnDebugger FALSE

/**
* @brief Use immediate messaging (means that it sends each message when they
* received and do not accumulate them) it works only if you set
* UseDbgPrintInsteadOfUsermodeMessageTracking to FALSE
*/
#define UseImmediateMessaging TRUE

/**
* @brief Use immediate messaging (means that it sends each message when they
* received and do not accumulate them) its the default value on events,
* a user can change this behavior by selecting 'imm yes' or 'imm no' in the
* case of events
*/
#define UseImmediateMessagingByDefaultOnEvents TRUE

/**
* @brief Shows whether to show or not show the drivers debugging information
* and also enters debugger in debugging section to break the debugger in the
* case of errors
*/
#define DebugMode FALSE

/**
* @brief Activates the user-mode debugger
*/
#define ActivateUserModeDebugger FALSE

/**
* @brief Enable or disable the instant event mechanism
* @details for more information: https://docs.hyperdbg.org/tips-and-tricks/misc/instant-events
*/
#define EnableInstantEventMechanism TRUE
26 changes: 11 additions & 15 deletions sysBug/HyperDbgHyperLogIntrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*
*/
#pragma once
//#include "Constants.h"

//////////////////////////////////////////////////
// Enums //
Expand Down Expand Up @@ -71,8 +70,8 @@ typedef enum _LOG_TYPE
*/
# define LogInfo(format, ...) \
LogCallbackPrepareAndSendMessageToQueue(OPERATION_LOG_INFO_MESSAGE, \
TRUE, \
TRUE, \
UseImmediateMessaging, \
ShowSystemTimeOnDebugMessages, \
FALSE, \
"[+] Information (%s:%d) | " format "\n", \
__func__, \
Expand All @@ -86,7 +85,7 @@ typedef enum _LOG_TYPE
# define LogInfoPriority(format, ...) \
LogCallbackPrepareAndSendMessageToQueue(OPERATION_LOG_INFO_MESSAGE, \
TRUE, \
TRUE, \
ShowSystemTimeOnDebugMessages, \
TRUE, \
"[+] Information (%s:%d) | " format "\n", \
__func__, \
Expand All @@ -99,8 +98,8 @@ typedef enum _LOG_TYPE
*/
# define LogWarning(format, ...) \
LogCallbackPrepareAndSendMessageToQueue(OPERATION_LOG_WARNING_MESSAGE, \
TRUE, \
TRUE, \
UseImmediateMessaging, \
ShowSystemTimeOnDebugMessages, \
TRUE, \
"[-] Warning (%s:%d) | " format "\n", \
__func__, \
Expand All @@ -113,8 +112,8 @@ typedef enum _LOG_TYPE
*/
# define LogError(format, ...) \
LogCallbackPrepareAndSendMessageToQueue(OPERATION_LOG_ERROR_MESSAGE, \
TRUE, \
TRUE, \
UseImmediateMessaging, \
ShowSystemTimeOnDebugMessages, \
TRUE, \
"[!] Error (%s:%d) | " format "\n", \
__func__, \
Expand Down Expand Up @@ -156,8 +155,8 @@ typedef enum _LOG_TYPE
#define LogDebugInfo(format, ...) \
if (DebugMode) \
LogCallbackPrepareAndSendMessageToQueue(OPERATION_LOG_INFO_MESSAGE, \
TRUE, \
TRUE, \
UseImmediateMessaging, \
ShowSystemTimeOnDebugMessages, \
FALSE, \
"[+] Information (%s:%d) | " format "\n", \
__func__, \
Expand All @@ -171,9 +170,6 @@ LogCallbackPrepareAndSendMessageToQueue(UINT32 OperationCode,
BOOLEAN ShowCurrentSystemTime,
BOOLEAN Priority,
const char * Fmt,
...)
{
va_list ArgList;
BOOLEAN Result=FALSE;
return Result;
...) {
return TRUE;
}
1 change: 1 addition & 0 deletions sysBug/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <intrin.h>
#include "HyperDbgHyperLogIntrinsics.h"
#include "Constants.h"
#include "Configuration.h"


VOID DriverUnload(PDRIVER_OBJECT DriverObject) {
Expand Down

0 comments on commit ead365b

Please sign in to comment.