summaryrefslogtreecommitdiffstats
path: root/courgette/courgette_tool.cc
diff options
context:
space:
mode:
authorlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-11 18:35:37 +0000
committerlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-11 18:35:37 +0000
commitd244fdff5fbbda333ea904b7833b81dddc14ba3b (patch)
tree761ff3d72f842d729fb135aef08b7d686488c107 /courgette/courgette_tool.cc
parent3bbf1ca56cbc84e9dbe08c20ad62521655e12cd1 (diff)
downloadchromium_src-d244fdff5fbbda333ea904b7833b81dddc14ba3b.zip
chromium_src-d244fdff5fbbda333ea904b7833b81dddc14ba3b.tar.gz
chromium_src-d244fdff5fbbda333ea904b7833b81dddc14ba3b.tar.bz2
Revert 103879 - Start refactoring to reduce executable type knowledge.
This creates executable detection functions, a globally shared enum for describing an executable type, and reduces the number of classes and locations with executable specific knowledge. These changes, along with moving architecture specific classes into their own files should make it easier to produce special purpose clients that only contain the code required to apply their own form of patch. DisassemblerWin32EXE, ImagePE, CourgetteWin32X86PatchGenerator, and CourgetteWin32X86Patcher, and ensemble handling are all heavily affected here. This should have no effect on the behavior of the system yet, and is instead all prep-work. BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/7920004 TBR=dgarrett@chromium.org Review URL: http://codereview.chromium.org/8234012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/courgette_tool.cc')
-rw-r--r--courgette/courgette_tool.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/courgette/courgette_tool.cc b/courgette/courgette_tool.cc
index 6b2e14e..d36f4f1 100644
--- a/courgette/courgette_tool.cc
+++ b/courgette/courgette_tool.cc
@@ -85,8 +85,7 @@ void Disassemble(const std::wstring& input_file,
courgette::AssemblyProgram* program = NULL;
const courgette::Status parse_status =
- courgette::ParseDetectedExecutable(buffer.c_str(), buffer.length(),
- &program);
+ courgette::ParseWin32X86PE(buffer.c_str(), buffer.length(), &program);
if (parse_status != courgette::C_OK)
Problem("Can't parse input.");
@@ -123,17 +122,17 @@ void DisassembleAndAdjust(const std::wstring& program_file,
courgette::AssemblyProgram* program = NULL;
const courgette::Status parse_program_status =
- courgette::ParseDetectedExecutable(program_buffer.c_str(),
- program_buffer.length(),
- &program);
+ courgette::ParseWin32X86PE(program_buffer.c_str(),
+ program_buffer.length(),
+ &program);
if (parse_program_status != courgette::C_OK)
Problem("Can't parse program input.");
courgette::AssemblyProgram* model = NULL;
const courgette::Status parse_model_status =
- courgette::ParseDetectedExecutable(model_buffer.c_str(),
- model_buffer.length(),
- &model);
+ courgette::ParseWin32X86PE(model_buffer.c_str(),
+ model_buffer.length(),
+ &model);
if (parse_model_status != courgette::C_OK)
Problem("Can't parse model input.");
@@ -179,17 +178,17 @@ void DisassembleAdjustDiff(const std::wstring& model_file,
courgette::AssemblyProgram* model = NULL;
const courgette::Status parse_model_status =
- courgette::ParseDetectedExecutable(model_buffer.c_str(),
- model_buffer.length(),
- &model);
+ courgette::ParseWin32X86PE(model_buffer.c_str(),
+ model_buffer.length(),
+ &model);
if (parse_model_status != courgette::C_OK)
Problem("Can't parse model input.");
courgette::AssemblyProgram* program = NULL;
const courgette::Status parse_program_status =
- courgette::ParseDetectedExecutable(program_buffer.c_str(),
- program_buffer.length(),
- &program);
+ courgette::ParseWin32X86PE(program_buffer.c_str(),
+ program_buffer.length(),
+ &program);
if (parse_program_status != courgette::C_OK)
Problem("Can't parse program input.");