diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | example.c | 9 | ||||
-rw-r--r-- | funccrypt.c | 2 | ||||
-rw-r--r-- | funccrypt.h | 2 |
4 files changed, 17 insertions, 0 deletions
@@ -48,5 +48,9 @@ full: -$(MAKE) test -$(MAKE) test WIN32=1 WIN64=1 +full-clean: + -$(MAKE) clean + -$(MAKE) clean WIN32=1 WIN64=1 + clean: $(RM) -f example_x86$(SF32) example_x64$(SF64) @@ -47,12 +47,21 @@ int main(void) printHexBuf((uint8_t *)crypted_fn3, 160, 32); #endif printf("\nAfter Encryption:\n"); +#ifdef _DEBUG printf("crypted_fn return val: %s\n", crypt_strs[ crypt_func((void *)crypted_fn) ]); printf("crypted_fn2 return val: %s\n", crypt_strs[ crypt_func((void *)crypted_fn2) ]); printf("crypted_fn3 return val: %s\n", crypt_strs[ crypt_func((void *)crypted_fn3) ]); +#else + printf("crypted_fn return val: %d\n", + crypt_func((void *)crypted_fn)); + printf("crypted_fn2 return val: %d\n", + crypt_func((void *)crypted_fn2)); + printf("crypted_fn3 return val: %d\n", + crypt_func((void *)crypted_fn3)); +#endif printf("crypted_fn:\n"); printHexBuf((uint8_t *)crypted_fn, 160, 32); diff --git a/funccrypt.c b/funccrypt.c index bfb0b31..2c48192 100644 --- a/funccrypt.c +++ b/funccrypt.c @@ -8,9 +8,11 @@ #include "funccrypt.h" +#ifdef _DEBUG const char *crypt_strs[] = { "ERROR", "PROLOGUE", "EPILOGUE", "CHECK", "OK" }; +#endif void printHexBuf(uint8_t *buf, size_t siz, size_t chars_per_line) diff --git a/funccrypt.h b/funccrypt.h index 2e80340..e2ad45a 100644 --- a/funccrypt.h +++ b/funccrypt.h @@ -74,7 +74,9 @@ typedef enum crypt_return { CRYPT_EPILOGUE(name); \ } +#ifdef _DEBUG extern const char *crypt_strs[]; +#endif extern void printHexBuf(uint8_t *buf, size_t siz, size_t chars_per_line); extern crypt_return crypt_func(void *fn_start); |