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

Unified Diff: courgette/courgette.h

Issue 8344037: Start refactoring to reduce executable type knowledge. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Attempt to fix diffing weirdness with new file disassembler_win32_x86.cc. 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
Index: courgette/courgette.h
diff --git a/courgette/courgette.h b/courgette/courgette.h
index 521053e06550b5b5d2bcbd5bd40e9c90d698e2f8..70a6436ba2c4acfa4b821cfd266ae49839fe4296 100644
--- a/courgette/courgette.h
+++ b/courgette/courgette.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// 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.
@@ -50,6 +50,13 @@ enum Status {
C_ADJUSTMENT_FAILED = 27, //
};
+// What type of executable is something
+// Generally corresponds to CourgettePatchFile::TransformationMethodId
+enum ExecutableType {
+ UNKNOWN,
+ WIN32_X86
+};
+
class SinkStream;
class SinkStreamSet;
class SourceStream;
@@ -84,8 +91,14 @@ Status GenerateEnsemblePatch(SourceStream* old, SourceStream* target,
// storing the pointer to the AssemblyProgram in |*output|.
// Returns C_OK if successful, otherwise returns an error status and sets
// |*output| to NULL.
Michael Krebs 2011/10/21 02:44:36 I'm guessing the above comments should be deleted,
dgarrett 2011/10/21 18:24:59 Done.
-Status ParseWin32X86PE(const void* buffer, size_t length,
- AssemblyProgram** output);
+ExecutableType DetectExecutableType(const void* buffer, size_t length);
+
+// Attempts to detect the type of executable, and parse it with the
+// appropriate tools, storing the pointer to the AssemblyProgram in |*output|.
+// Returns C_OK if successful, otherwise returns an error status and sets
+// |*output| to NULL.
+Status ParseDetectedExecutable(const void* buffer, size_t length,
+ AssemblyProgram** output);
// Converts |program| into encoded form, returning it as |*output|.
// Returns C_OK if succeeded, otherwise returns an error status and
« no previous file with comments | « courgette/base_test_unittest.cc ('k') | courgette/courgette.gyp » ('j') | courgette/ensemble.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698