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

Side by Side Diff: courgette/win32_x86_patcher.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « courgette/win32_x86_generator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 // This is the transformation for Windows X86 executables. 5 // This is the transformation for Windows X86 executables.
6 6
7 #ifndef COURGETTE_WIN32_X86_PATCHER_H_ 7 #ifndef COURGETTE_WIN32_X86_PATCHER_H_
8 #define COURGETTE_WIN32_X86_PATCHER_H_ 8 #define COURGETTE_WIN32_X86_PATCHER_H_
9 9
10 #include "courgette/ensemble.h" 10 #include "courgette/ensemble.h"
(...skipping 28 matching lines...) Expand all
39 return C_OK; 39 return C_OK;
40 } 40 }
41 41
42 Status Transform(SourceStreamSet* corrected_parameters, 42 Status Transform(SourceStreamSet* corrected_parameters,
43 SinkStreamSet* transformed_element) { 43 SinkStreamSet* transformed_element) {
44 Status status; 44 Status status;
45 if (!corrected_parameters->Empty()) 45 if (!corrected_parameters->Empty())
46 return C_GENERAL_ERROR; // Don't expect any corrected parameters. 46 return C_GENERAL_ERROR; // Don't expect any corrected parameters.
47 47
48 AssemblyProgram* program = NULL; 48 AssemblyProgram* program = NULL;
49 status = ParseWin32X86PE(ensemble_region_.start() + base_offset_, 49 status = ParseDetectedExecutable(ensemble_region_.start() + base_offset_,
50 base_length_, 50 base_length_,
51 &program); 51 &program);
52 if (status != C_OK) 52 if (status != C_OK)
53 return status; 53 return status;
54 54
55 EncodedProgram* encoded = NULL; 55 EncodedProgram* encoded = NULL;
56 status = Encode(program, &encoded); 56 status = Encode(program, &encoded);
57 DeleteAssemblyProgram(program); 57 DeleteAssemblyProgram(program);
58 if (status != C_OK) 58 if (status != C_OK)
59 return status; 59 return status;
60 60
61 status = WriteEncodedProgram(encoded, transformed_element); 61 status = WriteEncodedProgram(encoded, transformed_element);
(...skipping 22 matching lines...) Expand all
84 Region ensemble_region_; 84 Region ensemble_region_;
85 85
86 uint32 base_offset_; 86 uint32 base_offset_;
87 uint32 base_length_; 87 uint32 base_length_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(CourgetteWin32X86Patcher); 89 DISALLOW_COPY_AND_ASSIGN(CourgetteWin32X86Patcher);
90 }; 90 };
91 91
92 } // namespace 92 } // namespace
93 #endif // COURGETTE_WIN32_X86_PATCHER_H_ 93 #endif // COURGETTE_WIN32_X86_PATCHER_H_
OLDNEW
« no previous file with comments | « courgette/win32_x86_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698