18 lines
450 B
C++
18 lines
450 B
C++
#include <intrin.h>
|
|
|
|
extern "C" {
|
|
|
|
__declspec(dllexport) void raw_cpuid(int leaf, int subleaf, unsigned int* out) {
|
|
int regs[4];
|
|
__cpuidex(regs, leaf, subleaf);
|
|
out[0] = static_cast<unsigned int>(regs[0]);
|
|
out[1] = static_cast<unsigned int>(regs[1]);
|
|
out[2] = static_cast<unsigned int>(regs[2]);
|
|
out[3] = static_cast<unsigned int>(regs[3]);
|
|
}
|
|
|
|
__declspec(dllexport) unsigned long long raw_rdtsc() {
|
|
return __rdtsc();
|
|
}
|
|
|
|
}
|