OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef COURGETTE_DISASSEMBLER_H_ |
6 #define COURGETTE_DISASSEMBLER_H_ | 6 #define COURGETTE_DISASSEMBLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace courgette { | 10 namespace courgette { |
11 | 11 |
12 class AssemblyProgram; | 12 class AssemblyProgram; |
13 class PEInfo; | 13 class PEInfo; |
14 | 14 |
15 class Disassembler { | 15 class Disassembler { |
16 public: | 16 public: |
17 // Factory methods for making disassemblers for various kinds of executables. | 17 virtual ~Disassembler() {} |
18 // We have only one so far. | |
19 | |
20 static Disassembler* MakeDisassemberWin32X86(PEInfo* pe_info); | |
21 | 18 |
22 // Disassembles the item passed to the factory method into the output | 19 // Disassembles the item passed to the factory method into the output |
23 // parameter 'program'. | 20 // parameter 'program'. |
24 virtual bool Disassemble(AssemblyProgram* program) = 0; | 21 virtual bool Disassemble(AssemblyProgram* program) = 0; |
25 | 22 |
26 // Deletes 'this' disassembler. | |
27 virtual void Destroy() = 0; | |
28 | |
29 protected: | 23 protected: |
30 Disassembler() {} | 24 Disassembler() {} |
31 virtual ~Disassembler() {} | |
32 | 25 |
33 private: | 26 private: |
34 DISALLOW_COPY_AND_ASSIGN(Disassembler); | 27 DISALLOW_COPY_AND_ASSIGN(Disassembler); |
35 }; | 28 }; |
36 | 29 |
37 } // namespace courgette | 30 } // namespace courgette |
38 #endif // COURGETTE_DISASSEMBLER_H_ | 31 #endif // COURGETTE_DISASSEMBLER_H_ |
OLD | NEW |