diff options
author | segfault <toni@impl.cc> | 2020-10-12 11:28:33 -0700 |
---|---|---|
committer | segfault <toni@impl.cc> | 2020-10-12 11:28:33 -0700 |
commit | ea105e2f9790ca7f3d1b7d604aaa5c7b5f29a184 (patch) | |
tree | 834dd656892941294afa4b5795e15b103ab91784 /KMemDriver/Crypto.h | |
parent | 639f1137e3f7e5ef845e3f69ad34b514749c87fc (diff) |
Added Crypto function bodies, renamed ASM fn to get next RIP after return and improved CRYPTO_* macros.
Diffstat (limited to 'KMemDriver/Crypto.h')
-rw-r--r-- | KMemDriver/Crypto.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/KMemDriver/Crypto.h b/KMemDriver/Crypto.h index 09413aa..2d81b3d 100644 --- a/KMemDriver/Crypto.h +++ b/KMemDriver/Crypto.h @@ -2,11 +2,16 @@ #include <ntddk.h> -void crypt_fn(void); +extern PVOID getNextRIP(void); + +void CryptoInit(PVOID fn, ...); +void CryptoDo(PVOID fn); + +#define CRYPTO_FNPTR(fn) ((PVOID)fn) #define CRYPT_PROLOGUE() \ do { \ - crypt_fn(); \ + CryptoDo(getNextRIP()); \ volatile UINT64 index_and_marker = { 0x11111111C0DEC0DE }; \ UNREFERENCED_PARAMETER(index_and_marker); \ } while (0) @@ -14,5 +19,5 @@ void crypt_fn(void); do { \ volatile UINT32 marker = 0xDEADDEAD;\ UNREFERENCED_PARAMETER(marker); \ - crypt_fn(); \ + CryptoDo(getNextRIP()); \ } while (0)
\ No newline at end of file |