-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for enumerating processes
- Loading branch information
Showing
6 changed files
with
263 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// Math utilities. | ||
/// | ||
/// Authors: dd86k <[email protected]> | ||
/// Copyright: © dd86k <[email protected]> | ||
/// License: BSD-3-Clause | ||
module adbg.utils.math; | ||
|
||
template MAX(size_t a, size_t b) { | ||
enum MAX = a >= b ? a : b; | ||
} | ||
template MIN(size_t a, size_t b) { | ||
enum MIN = a <= b ? a : b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
/// Utility function for reading and writing into a process' memory. | ||
/// | ||
/// Authors: dd86k <[email protected]> | ||
/// Copyright: © dd86k <[email protected]> | ||
/// License: BSD-3-Clause | ||
module adbg.v2.debugger.memory; | ||
|
||
import adbg.v2.debugger.process : adbg_process_t; | ||
|
@@ -207,7 +212,6 @@ L_OPT: | |
} | ||
|
||
DWORD modcount = needed / HMODULE.sizeof; | ||
|
||
adbg_memory_map_t *map = *mmaps = cast(adbg_memory_map_t*)malloc(modcount * adbg_memory_map_t.sizeof); | ||
if (map == null) { | ||
free(mods); | ||
|
@@ -612,7 +616,7 @@ L_OPT: | |
} | ||
|
||
// Make result list | ||
scanner.results = cast(adbg_scan_result_t*)calloc(capacity, adbg_scan_result_t.sizeof); | ||
scanner.results = cast(adbg_scan_result_t*)malloc(capacity * adbg_scan_result_t.sizeof); | ||
if (scanner.results == null) { | ||
adbg_memory_scan_close(scanner); | ||
adbg_oops(AdbgError.crt); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters