rel32_finder_x86.h 922 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COURGETTE_REL32_FINDER_X86_H_
  5. #define COURGETTE_REL32_FINDER_X86_H_
  6. #include <stdint.h>
  7. #include <vector>
  8. #include "courgette/image_utils.h"
  9. #include "courgette/rel32_finder.h"
  10. namespace courgette {
  11. // This implementation performs naive scan for opcodes having rel32 as
  12. // arguments, disregarding instruction alignment.
  13. class Rel32FinderX86 : public Rel32Finder {
  14. public:
  15. Rel32FinderX86(RVA relocs_start_rva, RVA relocs_end_rva);
  16. ~Rel32FinderX86() override = default;
  17. void Find(const uint8_t* start_pointer,
  18. const uint8_t* end_pointer,
  19. RVA start_rva,
  20. RVA end_rva,
  21. const std::vector<RVA>& abs32_locations) override;
  22. };
  23. } // namespace courgette
  24. #endif // COURGETTE_REL32_FINDER_X86_H_