Skip to content

Commit 95bb582

Browse files
SinaKarvandigitbook-bot
authored andcommitted
GitBook: [#996] No subject
1 parent 44c3cbe commit 95bb582

24 files changed

+43
-40
lines changed

SUMMARY.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,30 @@
1717
* [Operation Modes](using-hyperdbg/prerequisites/operation-modes.md)
1818
* [How to create a condition?](using-hyperdbg/prerequisites/how-to-create-a-condition.md)
1919
* [How to create an action?](using-hyperdbg/prerequisites/how-to-create-an-action.md)
20-
* [User-mode Debugging](using-hyperdbg/user-mode-debugging.md)
21-
* [Kernel-mode Debugging](using-hyperdbg/kernel-mode-debugging.md)
22-
* [Examples](using-hyperdbg/examples/README.md)
23-
* [beginning](using-hyperdbg/examples/beginning/README.md)
24-
* [Connecting To HyperDbg](using-hyperdbg/examples/beginning/connecting-to-hyperdbg.md)
25-
* [Configuring Symbol Server/Path](using-hyperdbg/examples/beginning/configuring-symbol-server-path.md)
26-
* [basics](using-hyperdbg/examples/basics/README.md)
27-
* [Setting Breakpoints & Stepping Instructions](using-hyperdbg/examples/basics/setting-breakpoints-and-stepping-instructions.md)
28-
* [Displaying & Editing & Searching Memory](using-hyperdbg/examples/basics/displaying-and-editing-and-searching-memory.md)
29-
* [Showing & Modifying Registers and Flags](using-hyperdbg/examples/basics/showing-and-modifying-registers-and-flags.md)
30-
* [Switching to a Specific Process or Thread](using-hyperdbg/examples/basics/switching-to-a-specific-process-or-thread.md)
31-
* [events](using-hyperdbg/examples/events/README.md)
32-
* [Managing Events](using-hyperdbg/examples/events/managing-events.md)
33-
* [Hooking Any Function](using-hyperdbg/examples/events/hooking-any-function.md)
34-
* [Intercepting All SYSCALLs](using-hyperdbg/examples/events/intercepting-all-syscalls.md)
35-
* [Monitoring Accesses To Structures](using-hyperdbg/examples/events/monitoring-accesses-to-structures.md)
36-
* [Triggering Special Instructions](using-hyperdbg/examples/events/triggering-special-instructions.md)
37-
* [Identifying System Behavior](using-hyperdbg/examples/events/identifying-system-behavior.md)
38-
* [scripts](using-hyperdbg/examples/scripts/README.md)
39-
* [Running HyperDbg Script](using-hyperdbg/examples/misc/running-hyperdbg-script.md)
40-
* [misc](using-hyperdbg/examples/misc/README.md)
41-
* [Defeating Anti-Debug & Anti-Hypervisor Methods](using-hyperdbg/examples/misc/defeating-anti-debug-and-anti-hypervisor-methods.md)
42-
* [Scripting Language Examples](https://docs.hyperdbg.org/commands/scripting-language/examples)
20+
* [User-mode Debugging](using-hyperdbg/user-mode-debugging/README.md)
21+
* [Examples](using-hyperdbg/user-mode-debugging/examples.md)
22+
* [Kernel-mode Debugging](using-hyperdbg/kernel-mode-debugging/README.md)
23+
* [Examples](using-hyperdbg/kernel-mode-debugging/examples/README.md)
24+
* [beginning](using-hyperdbg/kernel-mode-debugging/examples/beginning/README.md)
25+
* [Connecting To HyperDbg](using-hyperdbg/kernel-mode-debugging/examples/beginning/connecting-to-hyperdbg.md)
26+
* [Configuring Symbol Server/Path](using-hyperdbg/kernel-mode-debugging/examples/beginning/configuring-symbol-server-path.md)
27+
* [basics](using-hyperdbg/kernel-mode-debugging/examples/basics/README.md)
28+
* [Setting Breakpoints & Stepping Instructions](using-hyperdbg/kernel-mode-debugging/examples/basics/setting-breakpoints-and-stepping-instructions.md)
29+
* [Displaying & Editing & Searching Memory](using-hyperdbg/kernel-mode-debugging/examples/basics/displaying-and-editing-and-searching-memory.md)
30+
* [Showing & Modifying Registers and Flags](using-hyperdbg/kernel-mode-debugging/examples/basics/showing-and-modifying-registers-and-flags.md)
31+
* [Switching to a Specific Process or Thread](using-hyperdbg/kernel-mode-debugging/examples/basics/switching-to-a-specific-process-or-thread.md)
32+
* [events](using-hyperdbg/kernel-mode-debugging/examples/events/README.md)
33+
* [Managing Events](using-hyperdbg/kernel-mode-debugging/examples/events/managing-events.md)
34+
* [Hooking Any Function](using-hyperdbg/kernel-mode-debugging/examples/events/hooking-any-function.md)
35+
* [Intercepting All SYSCALLs](using-hyperdbg/kernel-mode-debugging/examples/events/intercepting-all-syscalls.md)
36+
* [Monitoring Accesses To Structures](using-hyperdbg/kernel-mode-debugging/examples/events/monitoring-accesses-to-structures.md)
37+
* [Triggering Special Instructions](using-hyperdbg/kernel-mode-debugging/examples/events/triggering-special-instructions.md)
38+
* [Identifying System Behavior](using-hyperdbg/kernel-mode-debugging/examples/events/identifying-system-behavior.md)
39+
* [scripts](using-hyperdbg/kernel-mode-debugging/examples/scripts/README.md)
40+
* [Running HyperDbg Script](using-hyperdbg/kernel-mode-debugging/examples/scripts/running-hyperdbg-script.md)
41+
* [misc](using-hyperdbg/kernel-mode-debugging/examples/misc/README.md)
42+
* [Defeating Anti-Debug & Anti-Hypervisor Methods](using-hyperdbg/kernel-mode-debugging/examples/misc/defeating-anti-debug-and-anti-hypervisor-methods.md)
43+
* [Scripting Language Examples](https://docs.hyperdbg.org/commands/scripting-language/examples)
4344

4445
## Commands
4546

File renamed without changes.
File renamed without changes.
File renamed without changes.

using-hyperdbg/examples/basics/switching-to-a-specific-process-or-thread.md renamed to using-hyperdbg/kernel-mode-debugging/examples/basics/switching-to-a-specific-process-or-thread.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ After compiling and running the above code, we use the command shown in the pict
4141
3: kHyperDbg> .process list
4242
```
4343

44-
![View process list](../../../.gitbook/assets/1-process-list.png)
44+
![View process list](../../../../.gitbook/assets/1-process-list.png)
4545

4646
We find our target program which its name is "**Test.exe**". Then, we see a list of running threads based on this process. For this purpose, we used the process object address (`nt!_EPROCESS`).
4747

4848
```
4949
3: kHyperDbg> .thread list process ffff948cc16c3080
5050
```
5151

52-
![View list of threads of a process](../../../.gitbook/assets/2-find-threads-of-test-process.png)
52+
![View list of threads of a process](../../../../.gitbook/assets/2-find-threads-of-test-process.png)
5353

5454
Now, we can switch to the target thread and continue the debuggee. Whenever the system reaches the target thread, it will be halted again and run new commands.
5555

@@ -59,30 +59,30 @@ Note that it's a 32-bit program, so we use the '[u2](https://docs.hyperdbg.org/c
5959
3: kHyperDbg> .thread tid b10
6060
```
6161

62-
![Switch to a new thread](../../../.gitbook/assets/3-switch-to-the-target-thread.png)
62+
![Switch to a new thread](../../../../.gitbook/assets/3-switch-to-the-target-thread.png)
6363

6464
After analyzing the program, we find the jumps in the assembly code. You can also see the calls that are probably a link to the `printf` function.
6565

6666
```
6767
2: kHyperDbg> u2 00e249f6
6868
```
6969

70-
![Disassemble the target thread](../../../.gitbook/assets/4-disassembling-and-finding-jumps.png)
70+
![Disassemble the target thread](../../../../.gitbook/assets/4-disassembling-and-finding-jumps.png)
7171

7272
Then, we step through the instructions to better understand how this program works.
7373

74-
![Step through the instructions](../../../.gitbook/assets/5-stepping-and-investigate-the-test-program.png)
74+
![Step through the instructions](../../../../.gitbook/assets/5-stepping-and-investigate-the-test-program.png)
7575

7676
After some investigation, we can conclude that the guilty jump is located at `0xe24a31`, so we'll modify the memory and patch it by using nop instructions(0x90).
7777

7878
```
7979
2: kHyperDbg> eb 00e24a31 90 90
8080
```
8181

82-
![Patch the program's execution flow](../../../.gitbook/assets/6-patch-the-target-jump.png)
82+
![Patch the program's execution flow](../../../../.gitbook/assets/6-patch-the-target-jump.png)
8383

8484
If we continue the debuggee again, you can see that the patched program jumps out of the infinite loop and show the '**thread is closed!**' message.
8585

86-
![The result of patched program](../../../.gitbook/assets/7-result-of-patching-target-program.png)
86+
![The result of patched program](../../../../.gitbook/assets/7-result-of-patching-target-program.png)
8787

8888
It was a simple example of how to use thread and process switching commands in HyperDbg. You can think about different approaches that you can use to change the program's execution flow (like changing the RFLAGS, etc.) or analyze any other programs.
File renamed without changes.

0 commit comments

Comments
 (0)