Skip to content

Commit 693bba8

Browse files
authored
Implement the dump_process_memory action.
1 parent 23f8c34 commit 693bba8

File tree

7 files changed

+1026
-1
lines changed

7 files changed

+1026
-1
lines changed

crates/rrg-proto/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const PROTOS: &'static [&'static str] = &[
3030
"../../proto/rrg/action/list_winreg_keys.proto",
3131
"../../proto/rrg/action/list_winreg_values.proto",
3232
"../../proto/rrg/action/query_wmi.proto",
33+
"../../proto/rrg/action/dump_process_memory.proto",
3334
];
3435

3536
fn main() {

crates/rrg/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ default = [
2525
"action-list_winreg_keys",
2626
"action-query_wmi",
2727
"action-execute_signed_command",
28+
"action-dump_process_memory",
2829
]
2930

3031
action-get_system_metadata = []
@@ -51,6 +52,7 @@ action-execute_signed_command = []
5152
# in most RRG builds. Once that mechanism is no longer needed, this should be
5253
# deleted.
5354
action-execute_signed_command-preverified = ["action-execute_signed_command"]
55+
action-dump_process_memory = []
5456

5557
test-setfattr = []
5658
test-chattr = []

crates/rrg/src/action.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ pub mod query_wmi;
6060
#[cfg(feature = "action-execute_signed_command")]
6161
pub mod execute_signed_command;
6262

63+
#[cfg(feature = "action-dump_process_memory")]
64+
pub mod dump_process_memory;
65+
6366
use log::info;
6467

6568
/// Dispatches the given `request` to an appropriate action handler.
@@ -146,12 +149,16 @@ where
146149
ExecuteSignedCommand => {
147150
handle(session, request, self::execute_signed_command::handle)
148151
}
152+
#[cfg(feature = "action-dump_process_memory")]
153+
DumpProcessMemory => {
154+
handle(session, request, self::dump_process_memory::handle)
155+
}
149156
// We allow `unreachable_patterns` because otherwise we get a warning if
150157
// we compile with all the actions enabled.
151158
#[allow(unreachable_patterns)]
152159
action => {
153160
return Err(crate::session::Error::unsupported_action(action));
154-
},
161+
}
155162
};
156163

157164
info!("finished dispatching request '{request_id}'");

0 commit comments

Comments
 (0)