File tree Expand file tree Collapse file tree 2 files changed +30
-38
lines changed
Expand file tree Collapse file tree 2 files changed +30
-38
lines changed Original file line number Diff line number Diff line change 1+ use vmprotect_sys:: VMProtectIsDebuggerPresent ;
2+ use vmprotect_sys:: VMProtectIsProtected ;
3+ use vmprotect_sys:: VMProtectIsValidImageCRC ;
4+ use vmprotect_sys:: VMProtectIsVirtualMachinePresent ;
5+
6+ /// Check if currently running application is protected by vmprotect
7+ ///
8+ /// Dead code will not be elminated
9+ #[ inline( always) ]
10+ pub fn is_protected ( ) -> bool {
11+ unsafe { VMProtectIsProtected ( ) == 1 }
12+ }
13+
14+ /// Check presence of debugger
15+ #[ inline( always) ]
16+ pub fn is_debugger_present ( check_kernel_mode : bool ) -> bool {
17+ unsafe { VMProtectIsDebuggerPresent ( if check_kernel_mode { 1 } else { 0 } ) == 1 }
18+ }
19+
20+ /// Returns true if running inside virtual machine
21+ #[ inline( always) ]
22+ pub fn is_virtual_machine ( ) -> bool {
23+ unsafe { VMProtectIsVirtualMachinePresent ( ) == 1 }
24+ }
25+
26+ /// Check if process memory is not damaged/edited
27+ #[ inline( always) ]
28+ pub fn is_valid_image_crc ( ) -> bool {
29+ unsafe { VMProtectIsValidImageCRC ( ) == 1 }
30+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments