summaryrefslogtreecommitdiffstats
path: root/courgette/courgette.h
diff options
context:
space:
mode:
authordgarrett@chromium.org <dgarrett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 00:50:20 +0000
committerdgarrett@chromium.org <dgarrett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 00:50:20 +0000
commit423a381f4fd3efd99dfd7bc932777ea596cf7b17 (patch)
treefdbf4a4bc5f2b8d73b90020da470c40a22f4cc2a /courgette/courgette.h
parentda1543a1a526aefd1114853cf737846eb5c29640 (diff)
downloadchromium_src-423a381f4fd3efd99dfd7bc932777ea596cf7b17.zip
chromium_src-423a381f4fd3efd99dfd7bc932777ea596cf7b17.tar.gz
chromium_src-423a381f4fd3efd99dfd7bc932777ea596cf7b17.tar.bz2
Further refactoring, move ImageInfo into Disassembler/DisassemblerWin32X86.
This means that all PE specific knowledge is now contained in a single class which leaves us in pretty good shape for supporting ELF 32. There are still widespread assumptions about being 32 bit, but those can be addressed at a much later date. BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/8166013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/courgette.h')
-rw-r--r--courgette/courgette.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/courgette/courgette.h b/courgette/courgette.h
index 127a150..2970a3f 100644
--- a/courgette/courgette.h
+++ b/courgette/courgette.h
@@ -87,9 +87,17 @@ Status ApplyEnsemblePatch(const FilePath::CharType* old_file_name,
Status GenerateEnsemblePatch(SourceStream* old, SourceStream* target,
SinkStream* patch);
-// Detects the type of an executable, and returns UNKNOWN if it cannot
-// be parsed.
-ExecutableType DetectExecutableType(const void* buffer, size_t length);
+// Detects the type of an executable file, and it's length. The length
+// may be slightly smaller than some executables (like ELF), but will include
+// all bytes the courgette algorithm has special benefit for.
+// On sucess:
+// Fill in type and detected_length, and return C_OK.
+// On failure:
+// Fill in type with UNKNOWN, detected_length with 0, and
+// return C_INPUT_NOT_RECOGNIZED
+Status DetectExecutableType(const void* buffer, size_t length,
+ ExecutableType* type,
+ size_t* detected_length);
// Attempts to detect the type of executable, and parse it with the
// appropriate tools, storing the pointer to the AssemblyProgram in |*output|.