Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: courgette/disassembler_win32_x86.h

Issue 7920004: Start refactoring to reduce executable type knowledge. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix windows compile warning. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/disassembler.cc ('k') | courgette/disassembler_win32_x86.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_win32_x86.h
diff --git a/courgette/disassembler_win32_x86.h b/courgette/disassembler_win32_x86.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe00b6d85143dfe4064aa17b7d02139185b00f6d
--- /dev/null
+++ b/courgette/disassembler_win32_x86.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COURGETTE_DISASSEMBLER_WIN32_X86_H_
+#define COURGETTE_DISASSEMBLER_WIN32_X86_H_
+
+#include "base/basictypes.h"
+#include "courgette/disassembler.h"
+#include "courgette/image_info.h"
+#include "courgette/memory_allocator.h"
+
+namespace courgette {
+
+class AssemblyProgram;
+
+class DisassemblerWin32X86 : public Disassembler {
+ public:
+ explicit DisassemblerWin32X86(PEInfo* pe_info);
+
+ virtual bool Disassemble(AssemblyProgram* target);
+
+ protected:
+ PEInfo& pe_info() { return *pe_info_; }
+
+ CheckBool ParseFile(AssemblyProgram* target) WARN_UNUSED_RESULT;
+ bool ParseAbs32Relocs();
+ void ParseRel32RelocsFromSections();
+ void ParseRel32RelocsFromSection(const Section* section);
+
+ CheckBool ParseNonSectionFileRegion(uint32 start_file_offset,
+ uint32 end_file_offset, AssemblyProgram* program) WARN_UNUSED_RESULT;
+ CheckBool ParseFileRegion(const Section* section,
+ uint32 start_file_offset, uint32 end_file_offset,
+ AssemblyProgram* program) WARN_UNUSED_RESULT;
+
+#if COURGETTE_HISTOGRAM_TARGETS
+ void HistogramTargets(const char* kind, const std::map<RVA, int>& map);
+#endif
+
+ PEInfo* pe_info_;
+ bool incomplete_disassembly_; // 'true' if can leave out 'uninteresting' bits
+
+ std::vector<RVA> abs32_locations_;
+ std::vector<RVA> rel32_locations_;
+
+#if COURGETTE_HISTOGRAM_TARGETS
+ std::map<RVA, int> abs32_target_rvas_;
+ std::map<RVA, int> rel32_target_rvas_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(DisassemblerWin32X86);
+};
+
+} // namespace courgette
+#endif // COURGETTE_DISASSEMBLER_WIN32_X86_H_
« no previous file with comments | « courgette/disassembler.cc ('k') | courgette/disassembler_win32_x86.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698