OLD | NEW |
(Empty) | |
| 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 |
| 5 #ifndef COURGETTE_REL32_FINDER_X86_H_ |
| 6 #define COURGETTE_REL32_FINDER_X86_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <map> |
| 11 #include <vector> |
| 12 |
| 13 #include "courgette/image_utils.h" |
| 14 #include "courgette/rel32_finder.h" |
| 15 |
| 16 namespace courgette { |
| 17 |
| 18 // The basic implementation performs naive scan for rel32 JMP and Jcc opcodes |
| 19 // (excluding JPO/JPE) disregarding instruction alignment. |
| 20 class Rel32FinderX86 : public Rel32Finder { |
| 21 public: |
| 22 Rel32FinderX86() = default; |
| 23 Rel32FinderX86(RVA relocs_start_rva, RVA relocs_end_rva); |
| 24 ~Rel32FinderX86() override = default; |
| 25 |
| 26 void Find(const uint8_t* start_pointer, |
| 27 const uint8_t* end_pointer, |
| 28 RVA start_rva, |
| 29 RVA end_rva, |
| 30 uint32_t size_of_image, |
| 31 const std::vector<RVA>& abs32_locations) override; |
| 32 }; |
| 33 |
| 34 } // namespace courgette |
| 35 |
| 36 #endif // COURGETTE_REL32_FINDER_X86_H_ |
OLD | NEW |