From ea105e2f9790ca7f3d1b7d604aaa5c7b5f29a184 Mon Sep 17 00:00:00 2001 From: segfault Date: Mon, 12 Oct 2020 11:28:33 -0700 Subject: Added Crypto function bodies, renamed ASM fn to get next RIP after return and improved CRYPTO_* macros. --- KMemDriver/Crypto.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'KMemDriver/Crypto.h') 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 -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 -- cgit v1.2.3