| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COURGETTE_DISASSEMBLER_ELF_32_H_ | 5 #ifndef COURGETTE_DISASSEMBLER_ELF_32_H_ |
| 6 #define COURGETTE_DISASSEMBLER_ELF_32_H_ | 6 #define COURGETTE_DISASSEMBLER_ELF_32_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 public: | 97 public: |
| 98 DisassemblerElf32(const uint8_t* start, size_t length); | 98 DisassemblerElf32(const uint8_t* start, size_t length); |
| 99 | 99 |
| 100 ~DisassemblerElf32() override { } | 100 ~DisassemblerElf32() override { } |
| 101 | 101 |
| 102 // Disassembler interfaces. | 102 // Disassembler interfaces. |
| 103 RVA FileOffsetToRVA(FileOffset file_offset) const override; | 103 RVA FileOffsetToRVA(FileOffset file_offset) const override; |
| 104 FileOffset RVAToFileOffset(RVA rva) const override; | 104 FileOffset RVAToFileOffset(RVA rva) const override; |
| 105 RVA PointerToTargetRVA(const uint8_t* p) const override; | 105 RVA PointerToTargetRVA(const uint8_t* p) const override; |
| 106 ExecutableType kind() const override = 0; | 106 ExecutableType kind() const override = 0; |
| 107 uint64_t image_base() const override { return 0; } |
| 107 bool ParseHeader() override; | 108 bool ParseHeader() override; |
| 108 bool Disassemble(AssemblyProgram* target) override; | 109 bool Disassemble(AssemblyProgram* program) override; |
| 109 | 110 |
| 110 virtual e_machine_values ElfEM() const = 0; | 111 virtual e_machine_values ElfEM() const = 0; |
| 111 | 112 |
| 112 CheckBool IsValidTargetRVA(RVA rva) const WARN_UNUSED_RESULT; | 113 CheckBool IsValidTargetRVA(RVA rva) const WARN_UNUSED_RESULT; |
| 113 | 114 |
| 114 // Converts an ELF relocation instruction into an RVA. | 115 // Converts an ELF relocation instruction into an RVA. |
| 115 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) | 116 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) |
| 116 const WARN_UNUSED_RESULT = 0; | 117 const WARN_UNUSED_RESULT = 0; |
| 117 | 118 |
| 118 // Public for unittests only | 119 // Public for unittests only |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 mutable std::vector<RVA> abs32_locations_; | 230 mutable std::vector<RVA> abs32_locations_; |
| 230 mutable std::vector<std::unique_ptr<TypedRVA>> rel32_locations_; | 231 mutable std::vector<std::unique_ptr<TypedRVA>> rel32_locations_; |
| 231 | 232 |
| 232 private: | 233 private: |
| 233 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32); | 234 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32); |
| 234 }; | 235 }; |
| 235 | 236 |
| 236 } // namespace courgette | 237 } // namespace courgette |
| 237 | 238 |
| 238 #endif // COURGETTE_DISASSEMBLER_ELF_32_H_ | 239 #endif // COURGETTE_DISASSEMBLER_ELF_32_H_ |
| OLD | NEW |