You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
516B

  1. #pragma once
  2. class AbstractHookEngine {
  3. private:
  4. const char* name_;
  5. public:
  6. /* boolean for each hook test case, which are set by the hooks */
  7. struct {
  8. bool small_;
  9. bool branch;
  10. bool rip_relative;
  11. bool avx;
  12. bool rdrand;
  13. bool loop;
  14. bool tail_recursion;
  15. };
  16. public:
  17. AbstractHookEngine(const char* name) : name_(name) {
  18. }
  19. virtual bool hook_all() = 0;
  20. virtual bool unhook_all() = 0;
  21. bool all_hooked() {
  22. return small_ && branch && rip_relative;
  23. }
  24. const char* name() {
  25. return name_;
  26. }
  27. };