that appears to be an antidebugging trick using rdtsc.
(read date time stamp counter) it is a monitonically increasing counter
when the process is executing without any external interference like a debugger the difference between two successive readings will be small
the loops look like junk interspersed in between
this code block supposedly checks for that
I am not an expert, but have you hear about fuzzing??
"Fuzz testing or Fuzzing is a Black Box software testing technique, which basically consists in finding implementation bugs using malformed/semi-malformed data injection in an automated fashion." [link]:https://owasp.org/www-community/Fuzzing
Since this is obviously a pain to do statically or by hand in a dynamic fashion, I would suggest trying another approach.
I personally would try to do it by writing a small emulator.
Since it is mostly 'stack arithmetic' and junk code, this would be perfect. Take a look at the emulation framework named 'Unicorn'.
With this option, you don't have to re-...
I am Not sure what you are looking for
if you execute in say wmic
C:\WINDOWS\system32>wmic os get Name
you get back
Microsoft Windows 10 Pro|C:\WINDOWS|\Device\Harddisk0\Partition4
this is executed with your select *from sql or wql query
here is a call stack and relevent info