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_WIN32_X64_H_ | 5 #ifndef COURGETTE_DISASSEMBLER_WIN32_X64_H_ |
6 #define COURGETTE_DISASSEMBLER_WIN32_X64_H_ | 6 #define COURGETTE_DISASSEMBLER_WIN32_X64_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Returns Section containing the relative virtual address, or null if none. | 47 // Returns Section containing the relative virtual address, or null if none. |
48 const Section* RVAToSection(RVA rva) const; | 48 const Section* RVAToSection(RVA rva) const; |
49 | 49 |
50 // (4) -> (5) (see AddressTranslator comment): Returns the RVA of the VA | 50 // (4) -> (5) (see AddressTranslator comment): Returns the RVA of the VA |
51 // specified by |address|, or kNoRVA if |address| lies outside of the image. | 51 // specified by |address|, or kNoRVA if |address| lies outside of the image. |
52 RVA Address64ToRVA(uint64_t address) const; | 52 RVA Address64ToRVA(uint64_t address) const; |
53 | 53 |
54 static std::string SectionName(const Section* section); | 54 static std::string SectionName(const Section* section); |
55 | 55 |
56 protected: | 56 protected: |
| 57 // Disassembler interfaces. |
| 58 RvaVisitor* CreateAbs32TargetRvaVisitor() override; |
| 59 RvaVisitor* CreateRel32TargetRvaVisitor() override; |
| 60 void RemoveUnusedRel32Locations(AssemblyProgram* program) override; |
| 61 |
57 CheckBool ParseFile(AssemblyProgram* target) WARN_UNUSED_RESULT; | 62 CheckBool ParseFile(AssemblyProgram* target) WARN_UNUSED_RESULT; |
58 bool ParseAbs32Relocs(); | 63 bool ParseAbs32Relocs(); |
59 void ParseRel32RelocsFromSections(); | 64 void ParseRel32RelocsFromSections(); |
60 void ParseRel32RelocsFromSection(const Section* section); | 65 void ParseRel32RelocsFromSection(const Section* section); |
61 | 66 |
62 CheckBool ParseNonSectionFileRegion(FileOffset start_file_offset, | 67 CheckBool ParseNonSectionFileRegion(FileOffset start_file_offset, |
63 FileOffset end_file_offset, | 68 FileOffset end_file_offset, |
64 AssemblyProgram* program) | 69 AssemblyProgram* program) |
65 WARN_UNUSED_RESULT; | 70 WARN_UNUSED_RESULT; |
66 CheckBool ParseFileRegion(const Section* section, | 71 CheckBool ParseFileRegion(const Section* section, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 std::map<RVA, int> abs32_target_rvas_; | 139 std::map<RVA, int> abs32_target_rvas_; |
135 std::map<RVA, int> rel32_target_rvas_; | 140 std::map<RVA, int> rel32_target_rvas_; |
136 #endif | 141 #endif |
137 | 142 |
138 DISALLOW_COPY_AND_ASSIGN(DisassemblerWin32X64); | 143 DISALLOW_COPY_AND_ASSIGN(DisassemblerWin32X64); |
139 }; | 144 }; |
140 | 145 |
141 } // namespace courgette | 146 } // namespace courgette |
142 | 147 |
143 #endif // COURGETTE_DISASSEMBLER_WIN32_X64_H_ | 148 #endif // COURGETTE_DISASSEMBLER_WIN32_X64_H_ |
OLD | NEW |