| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) | 114 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) |
| 115 const WARN_UNUSED_RESULT = 0; | 115 const WARN_UNUSED_RESULT = 0; |
| 116 | 116 |
| 117 // Public for unittests only | 117 // Public for unittests only |
| 118 std::vector<RVA>& Abs32Locations() { return abs32_locations_; } | 118 std::vector<RVA>& Abs32Locations() { return abs32_locations_; } |
| 119 std::vector<std::unique_ptr<TypedRVA>>& Rel32Locations() { | 119 std::vector<std::unique_ptr<TypedRVA>>& Rel32Locations() { |
| 120 return rel32_locations_; | 120 return rel32_locations_; |
| 121 } | 121 } |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 static bool QuickDetects(const uint8_t* start, |
| 125 size_t length, |
| 126 e_machine_values elf_em); |
| 127 |
| 124 bool UpdateLength(); | 128 bool UpdateLength(); |
| 125 | 129 |
| 126 // Misc Section Helpers | 130 // Misc Section Helpers |
| 127 | 131 |
| 128 Elf32_Half SectionHeaderCount() const { | 132 Elf32_Half SectionHeaderCount() const { |
| 129 return section_header_table_size_; | 133 return section_header_table_size_; |
| 130 } | 134 } |
| 131 | 135 |
| 132 const Elf32_Shdr* SectionHeader(Elf32_Half id) const { | 136 const Elf32_Shdr* SectionHeader(Elf32_Half id) const { |
| 133 assert(id >= 0 && id < SectionHeaderCount()); | 137 assert(id >= 0 && id < SectionHeaderCount()); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 219 |
| 216 std::vector<RVA> abs32_locations_; | 220 std::vector<RVA> abs32_locations_; |
| 217 std::vector<std::unique_ptr<TypedRVA>> rel32_locations_; | 221 std::vector<std::unique_ptr<TypedRVA>> rel32_locations_; |
| 218 | 222 |
| 219 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32); | 223 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32); |
| 220 }; | 224 }; |
| 221 | 225 |
| 222 } // namespace courgette | 226 } // namespace courgette |
| 223 | 227 |
| 224 #endif // COURGETTE_DISASSEMBLER_ELF_32_H_ | 228 #endif // COURGETTE_DISASSEMBLER_ELF_32_H_ |
| OLD | NEW |