feet wet with the reg
This commit is contained in:
parent
f45642872c
commit
d38bd08be9
1 changed files with 34 additions and 2 deletions
36
src/main.cpp
36
src/main.cpp
|
|
@ -18,10 +18,18 @@ Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3 (3A, 3B
|
|||
|
||||
//TSC is incremented by the base multiplier once every reference clock, so on my Xeon E5-2680 (Sandy Bridge EP) this is an increment of 27 every 10 ns
|
||||
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
//#include <Windows.h>
|
||||
#include <synchapi.h>
|
||||
//#include <sysinfoapi.h>
|
||||
//#include <powerbase.h>
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WIN10 //0x0A00
|
||||
#include <Windows.h>
|
||||
#include <winreg.h>
|
||||
#include <synchapi.h>
|
||||
#endif
|
||||
#ifdef NOMESELDELINUS
|
||||
//hilitos y tal
|
||||
|
|
@ -153,6 +161,8 @@ uint64_t rdtscp(uint64_t* logicore = nullptr ) {
|
|||
return (rdxho << 32) + raxlo; //|
|
||||
}
|
||||
|
||||
|
||||
//labor encomiable, ahora muere
|
||||
uint64_t estimandoFreq(){
|
||||
uint64_t test = rdtsc();
|
||||
Sleep(1000);
|
||||
|
|
@ -160,14 +170,36 @@ uint64_t estimandoFreq(){
|
|||
return test;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
//https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getnativesysteminfo
|
||||
//https://learn.microsoft.com/en-us/windows/win32/api/powerbase/nf-powerbase-callntpowerinformation?redirectedfrom=MSDN
|
||||
/*
|
||||
* And this is why I'm reading the reg instead
|
||||
*/
|
||||
|
||||
uint64_t getFreqFromReg(){
|
||||
LSTATUS status;
|
||||
HKEY key;
|
||||
status = RegOpenKeyExW(HKEY_LOCAL_MACHINE, TEXT("System"), 0,
|
||||
KEY_QUERY_VALUE, &key);
|
||||
uint64_t retval = (status == ERROR_SUCCESS) ? 1 : 0;
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int main(int argc, char** argv){
|
||||
//AMD Momento
|
||||
char* opiniones = AMDMeCagoEnTusPutosMuertos();
|
||||
bool w11 = AMDJoderMET();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
uint64_t isItActually32GHz = estimandoFreq();
|
||||
log_debugcpp("ayo we found " << isItActually32GHz << " flash knuckle");
|
||||
}
|
||||
|
||||
uint64_t juas = getFreqFromReg();
|
||||
|
||||
//Cordura
|
||||
int16_t result;
|
||||
uint64_t tf = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue