You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: contribution/style-guide/coding-style.md
+2-5
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ All global variables should start with `g_` for example `g_GuestState`.
37
37
38
38
For drivers, file names start with a capital case character.
39
39
40
-
For user-mode codes, file names start with lower case characters.
40
+
For user-mode codes, file names start with lower case characters.
41
41
42
42
### Directory Names
43
43
@@ -51,9 +51,6 @@ In HyperDbg, in most cases, if the printed message came from kernel-mode or vmx-
51
51
52
52
Exactly, like the above conventions for "Printing Messages", errors follow the same rule.
53
53
54
-
In HyperDbg, errors might come from either user-mode codes, kernel-mode, or vmx-root mode. Because we want to know the root cause of the error, we follow the rule of **"`Err,` "** and **"`err,` "**.
54
+
In HyperDbg, errors might come from either user-mode codes, kernel-mode, or vmx-root mode. Because we want to know the root cause of the error, we follow the rule of "`Err,` " and "`err,` ".
55
55
56
56
If the error starts with `err,` then, it means that the user-mode code generated this error. If the error started with `Err,` it means that it was either kernel-mode or vmx-root mode that encountered this error.
If you want to use the debugger features, you should connect the `CommandsEventList` to the list of user-mode commands.
102
102
103
-
**OptionalParamX** is different in the case of each command. For example, in **!epthook2**, you should send the address of where you want to hook to the kernel as **OptionalParam1**. ****You have to check each command's manual to see what are its specific **OptionalParam**\(s\).
103
+
**OptionalParamX** is different in the case of each command. For example, in **!epthook2**, you should send the address of where you want to hook to the kernel as **OptionalParam1**. You have to check each command's manual to see what are its specific **OptionalParam**(s).
104
104
105
-
**Tag** is an ID that you can use later in action.
105
+
**Tag** is an ID that you can use later in action.
106
106
107
107
**IsEnabled** has a user-mode usage to trace whether the event is enabled or not.
108
108
109
109
**CommandStringBuffer** is the string of the command. You can ignore it.
110
110
111
-
If your event contains a condition buffer \(`ConditionBufferSize != 0`\), you can use set the size if `ConditionBufferSize` and append the buffer to the end of the above structure, and when you send the buffer to the kernel, you should send the `sizeof(DEBUGGER_GENERAL_EVENT_DETAIL)+ ConditionBufferSize (if any)`.
111
+
If your event contains a condition buffer (`ConditionBufferSize != 0`), you can use set the size if `ConditionBufferSize` and append the buffer to the end of the above structure, and when you send the buffer to the kernel, you should send the `sizeof(DEBUGGER_GENERAL_EVENT_DETAIL)+ ConditionBufferSize (if any)`.
112
112
113
113
Finally, you can send it to the kernel by using the following function.
If you want to send it directly using IOCTL, you can use the following IOCTL :
124
+
If you want to send it directly using IOCTL, you can use the following IOCTL :
125
125
126
126
```c
127
127
#define IOCTL_DEBUGGER_REGISTER_EVENT \
@@ -132,7 +132,7 @@ After sending the above event to the kernel, you should chain an action or multi
132
132
133
133
You should fill the following structure to send a "**Break**", "**Script**", and "**Custom Code**" to the kernel. For example, you can append the custom code buffer after this structure and send them together to the kernel.
134
134
135
-
Also, **EventTag** is the unique ID that we sent previously in the event.
135
+
Also, **EventTag** is the unique ID that we sent previously in the event.
136
136
137
137
```c
138
138
//
@@ -167,4 +167,3 @@ If you want to register the action to the event directly using `DeviceIoControl`
Copy file name to clipboardexpand all lines: tips-and-tricks/misc/customize-build.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ By default, **HyperDbg** sends the current time of the system with each message
21
21
#defineShowSystemTimeOnDebugMessages TRUE
22
22
```
23
23
24
-
If you want to use **WPP Tracing** instead of **HyperDbg'**s message tracing, then set `UseWPPTracing` to `TRUE`. After that, you no longer see any message in **HyperDbg**, and instead, you can see the messages in a **WPP Tracing** compatible app.
24
+
If you want to use **WPP Tracing** instead of **HyperDbg**'s message tracing, then set `UseWPPTracing` to `TRUE`. After that, you no longer see any message in **HyperDbg**, and instead, you can see the messages in a **WPP Tracing** compatible app.
25
25
26
26
```c
27
27
/**
@@ -65,7 +65,7 @@ This is one of the **important** options for **HyperDng**. By default, **HyperDb
65
65
66
66
If you need to see messages immediately after each one message, then set this option to `TRUE`. However, it kills the performance as sending buffers to the user-mode involves various and heavy functions.
67
67
68
-
If you set this option to `FALSE` \(**default**\), then **HyperDbg** accumulates \(**~5** or more\) messages, and when the buffer is full, it sends the buffer to the user-mode **CLI** or **GUI**.
68
+
If you set this option to `FALSE` (**default**), then **HyperDbg** accumulates (**\~5** or more) messages, and when the buffer is full, it sends the buffer to the user-mode **CLI** or **GUI**.
69
69
70
70
```c
71
71
/**
@@ -157,7 +157,7 @@ The seeds that user-mode codes use as the starter of their output source tag.
157
157
#defineDebuggerOutputSourceTagStartSeed 0x1
158
158
```
159
159
160
-
The following option changes the maximum number of breakpoints \('[bp](https://docs.hyperdbg.org/commands/debugging-commands/bp)' command\) that the user can put into the entire system before continuing the debuggee. If you continue the debuggee and send an IOCTL, HyperDbg will reset this number.
160
+
The following option changes the maximum number of breakpoints ('[bp](https://docs.hyperdbg.org/commands/debugging-commands/bp)' command) that the user can put into the entire system before continuing the debuggee. If you continue the debuggee and send an IOCTL, HyperDbg will reset this number.
161
161
162
162
```c
163
163
#define MAXIMUM_BREAKPOINTS_WITHOUT_CONTINUE 50
@@ -174,4 +174,3 @@ The following option changes the speed at which HyperDbg reads kernel messages i
Event forwarding is a feature designed to make HyperDbg a tool for log gathering and analyzing system behavior. This way, you can use HyperDbg for [\#DFIR](https://twitter.com/search?q=%23dfir) purposes.
7
+
Event forwarding is a feature designed to make HyperDbg a tool for log gathering and analyzing system behavior. This way, you can use HyperDbg for [#DFIR](https://twitter.com/search?q=%23dfir) purposes.
8
8
9
9
You can use event forwarding to forward the event monitoring result from your internal system to an external source, e.g., **File**, **NamedPipe**, or **TCP Socket**.
10
10
@@ -38,23 +38,22 @@ Check the [output ](https://docs.hyperdbg.org/commands/debugging-commands/output
38
38
39
39
Event forwarding is a one-way mechanism. This means you can just see the client's logs, and you cannot make changes to the logs or send commands to the target client. If you want t,o control the debugger from a remote system, you can use [.listen](https://docs.hyperdbg.org/commands/meta-commands/.listen) and [.connect](https://docs.hyperdbg.org/commands/meta-commands/.connect) commands.
40
40
41
-
## Format \(plain-text and JSON\)
41
+
## Format (plain-text and JSON)
42
42
43
-
Event forwarding is only applied to the script, which means that you can use the [**print**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/print)and the [**printf**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/printf)_\*\*_function to generate results that will be passed to the target output source.
43
+
Event forwarding is only applied to the script, which means that you can use the [**print**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/print)and the [**printf**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/printf)function to generate results that will be passed to the target output source.
44
44
45
-
It's possible to create JSON results using the [**printf**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/printf)_\*\*_function.
45
+
It's possible to create JSON results using the [**printf**](https://docs.hyperdbg.org/commands/scripting-language/functions/exports/printf)function.
46
46
47
47
### Examples
48
48
49
49
The following repository contains some examples of listening on a named pipe as a server or listening on TCP sockets to use event forwarding.
Assume that we want to send the results of syscall \(syscall numbers in `rax`\) to several sources. The following video shows how to redirect these events to the **file**, **TCP Socket**, **named pipe**.
53
+
Assume that we want to send the results of syscall (syscall numbers in `rax`) to several sources. The following video shows how to redirect these events to the **file**, **TCP Socket**, **named pipe**.
Kernel buffers for transferring data safely to the user-mode \(debugger\) can be filled. If the debugger doesn't find time to transfer all messages, then the new messages will replace the previous messages, and as a result, you lose your messages, which are not yet transferred to the user-mode.
7
+
Kernel buffers for transferring data safely to the user-mode (debugger) can be filled. If the debugger doesn't find time to transfer all messages, then the new messages will replace the previous messages, and as a result, you lose your messages, which are not yet transferred to the user-mode.
8
8
9
9
In the rest of this document, you will learn the important factors that can decrease such scenarios. Take a look at [Customize Build](https://docs.hyperdbg.org/tips-and-tricks/misc/customize-build) for more information.
10
10
11
11
## Use Conditions
12
12
13
-
[Condition code](https://docs.hyperdbg.org/using-hyperdbg/prerequisites/how-to-create-a-condition) buffers are one of the most important parts of **HyperDbg**. You can use this feature to avoid triggering unnecessary events \(actions\) by creating conditions that filter the results for you in assembly form in both kernel-mode and vmx-root mode.
13
+
[Condition code](https://docs.hyperdbg.org/using-hyperdbg/prerequisites/how-to-create-a-condition) buffers are one of the most important parts of **HyperDbg**. You can use this feature to avoid triggering unnecessary events (actions) by creating conditions that filter the results for you in assembly form in both kernel-mode and vmx-root mode.
14
14
15
15
## Change Reading Delay
16
16
17
-
You can change `hprdbgctrl.cpp` file's **ReadIrpBasedBuffer\(\)** method to decrease the delay between reading each message from the kernel. You can change `Sleep(200);` to a lower time \(ms\), so you can read messages faster.
17
+
You can change `hprdbgctrl.cpp` file's **ReadIrpBasedBuffer()** method to decrease the delay between reading each message from the kernel. You can change `Sleep(200);` to a lower time (ms), so you can read messages faster.
18
18
19
19
```c
20
20
...
@@ -46,7 +46,7 @@ You can change `hprdbgctrl.cpp` file's **ReadIrpBasedBuffer\(\)** method to decr
46
46
47
47
If you need to see messages immediately after each one message, then set this option to `TRUE`. However, it kills the performance as sending buffers to the user-mode involves various and heavy functions.
48
48
49
-
If you set this option to `FALSE`, **HyperDbg** accumulates \(**~5** or more based on message length and chunk size\) messages, and when the buffer is full, it sends the buffer to the user-mode **CLI** or **GUI**.
49
+
If you set this option to `FALSE`, **HyperDbg** accumulates (**\~5** or more based on message length and chunk size) messages, and when the buffer is full, it sends the buffer to the user-mode **CLI** or **GUI**.
50
50
51
51
You can change the following options in the **Configuration.h** file.
52
52
@@ -63,7 +63,7 @@ You can change the following options in the **Configuration.h** file.
63
63
64
64
This is the most important factor in message tracing, if you increase the following value, then more messages will be stored in **HyperDbg** buffers; thus, they won't be replaced until the buffer is full, for example, if set this value to **1000**, then if you produce **1000** messages that are not delivered to the user-mode, **HyperDbg** replaces new messages with older messages, and in the case, if you set this value to **2000** then you have more capacity; thus, the buffers will have the capacity to hold twice more messages.
65
65
66
-
However, keep in mind that **HyperDbg** occupies more non-paged pools \(RAM\) by increasing the following value, so you need to balance your message capacity with your memory \(RAM\).
66
+
However, keep in mind that **HyperDbg** occupies more non-paged pools (RAM) by increasing the following value, so you need to balance your message capacity with your memory (RAM).
67
67
68
68
```c
69
69
/* Default buffer size */
@@ -74,12 +74,9 @@ However, keep in mind that **HyperDbg** occupies more non-paged pools \(RAM\) by
74
74
75
75
The following option shows the capacity of each packet in **HyperDbg**'s message tracing. If you have long messages or buffers, then you can increase this value.
76
76
77
-
If you increased it, then **HyperDbg** accumulates more messages and won't send them immediately to the user-mode \(as described in **Not Use Immediate Messaging** above\). This will lead to better performance; however, messages will be delivered by a delay \(for accumulation\).
77
+
If you increased it, then **HyperDbg** accumulates more messages and won't send them immediately to the user-mode (as described in **Not Use Immediate Messaging** above). This will lead to better performance; however, messages will be delivered by a delay (for accumulation).
78
78
79
79
```c
80
80
#define PacketChunkSize \
81
81
1000 // NOTE : REMEMBER TO CHANGE IT IN USER-MODE APP TOO
0 commit comments