-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extremely fast & unsafe physmem resolver
- Loading branch information
Showing
10 changed files
with
352 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
namespace Pte { | ||
namespace Pte | ||
{ | ||
struct PAGE_TABLES_INFO { | ||
PML4E* Pml4e; | ||
PDPE* Pdpe; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "Stopwatch.h" | ||
|
||
#include <ntifs.h> | ||
|
||
Stopwatch::Stopwatch() | ||
: m_begin(0) | ||
, m_end(0) | ||
, m_freq(0) | ||
{ | ||
KeQueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&m_freq)); | ||
} | ||
|
||
Stopwatch::Stopwatch(bool init) | ||
: m_begin(0) | ||
, m_end(0) | ||
, m_freq(0) | ||
{ | ||
if (init) | ||
{ | ||
start(); | ||
} | ||
} | ||
|
||
void Stopwatch::reset() | ||
{ | ||
m_begin = 0; | ||
m_end = 0; | ||
KeQueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&m_freq)); | ||
} | ||
|
||
void Stopwatch::start() | ||
{ | ||
m_begin = KeQueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&m_freq)).QuadPart; | ||
m_end = m_begin; | ||
} | ||
|
||
float Stopwatch::stop() | ||
{ | ||
m_end = KeQueryPerformanceCounter(NULL).QuadPart; | ||
return delta(); | ||
} | ||
|
||
float Stopwatch::delta() | ||
{ | ||
return static_cast<float>(m_end - m_begin) / m_freq; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
class Stopwatch | ||
{ | ||
protected: | ||
unsigned long long m_begin, m_end; | ||
unsigned long long m_freq; | ||
|
||
public: | ||
Stopwatch(); | ||
Stopwatch(bool init); | ||
|
||
void reset(); | ||
|
||
void start(); | ||
float stop(); | ||
|
||
float delta(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters