JimmahDean
How can I detect if my app is being run on a VM?
I have an app for gathering various system information from hardware to event logs to assist in troubleshooting for the Reddit /r/TechSupport discord server. Occasionally, people run it on a VM which gives unreliable information and it is not immediately recognizable it's a VM. Is there a way to determine if the app is being run on a virtual machine?
8 replies
❔ P/Invoked DeviceIoControl() works in C++ but does nothing in C#.
Code is attached.
I have scoured this for hours upon hours and cross checked the pointers with the working C++ version and everything matches. The call doesn't error, checking LastWin32Error, LastSystemError and LastPInvokeError all return "The operation completed successfully." and the return length of the data retrieved is the same in C# as it is in C++, even checked in ProcMon that both apps were making the same system calls and they are. The call happens successfully as it should, but zero data is retrieved in the C# version.
I'm at my wits end here.
117 replies
❔ Connecting to the system resource usage monitor database
Hello! 👋
I am attempting to read and parse the SRU db found at
C:\Windows\System32\sru\srudb.dat
- From what I'm found, it's an Extensible Storage Engine database, however I haven't been able to find code that actually works to connect to it. The OleDb answers all except saying I don't have the right provider installed, so maybe I just need to change the connection string to something more current, and the Isam answers I've found all fail because the page size does not match the page size of the database for all legal page sizes.
I'm hoping someone more knowledgeable than I can point me in the right direction on how I might parse this. Here's the most recent failed attempt3 replies