Skip to content

Commit b6796a5

Browse files
Expose pointer size & version (#124)
I find it useful to log the pointer size / version detected after attaching to the game (Cuphead has versions that use 32bit and 64 bit, and varying mono versions). It's a good sanity check. These fields are hidden on the Module.
1 parent 52bbcb1 commit b6796a5

File tree

1 file changed

+10
-0
lines changed
  • src/game_engine/unity/mono

1 file changed

+10
-0
lines changed

src/game_engine/unity/mono/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ impl Module {
122122
})
123123
}
124124

125+
/// Retrieve the [Mono version](Version) of the module.
126+
pub fn get_version(&self) -> Version {
127+
self.version
128+
}
129+
130+
/// Retrieve the [pointer size](PointerSize) of the process/module.
131+
pub fn get_pointer_size(&self) -> PointerSize {
132+
self.pointer_size
133+
}
134+
125135
fn assemblies<'a>(&'a self, process: &'a Process) -> impl FusedIterator<Item = Assembly> + 'a {
126136
let mut assembly = process
127137
.read_pointer(self.assemblies, self.pointer_size)

0 commit comments

Comments
 (0)