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

Issue 8344037: Start refactoring to reduce executable type knowledge. (Closed)

Created:
9 years, 2 months ago by dgarrett
Modified:
9 years, 2 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., adlr
Visibility:
Public.

Description

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. This is the same as an earlier CL, except that ParseHeader will now return an error for 64 bit PE executables, and resource only DLLs. This is because the detection factories depend on ParseHeader to decide if a given file is supported. BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/7920004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103879 0039d316-1c4b-4281-b951-d872f2087c98 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=106793

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased on other changes. #

Total comments: 2

Patch Set 3 : Attempt to fix diffing weirdness with new file disassembler_win32_x86.cc. #

Total comments: 4

Patch Set 4 : Switch DCHECK to ASSERT_TRUE. #

Patch Set 5 : Fix comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -600 lines) Patch
M courgette/base_test_unittest.h View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M courgette/base_test_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M courgette/courgette.h View 1 2 3 4 3 chunks +16 lines, -5 lines 0 comments Download
M courgette/courgette.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M courgette/courgette_tool.cc View 3 chunks +14 lines, -13 lines 0 comments Download
M courgette/disassembler.h View 2 chunks +2 lines, -9 lines 0 comments Download
M courgette/disassembler.cc View 3 chunks +16 lines, -392 lines 0 comments Download
A courgette/disassembler_win32_x86.h View 1 chunk +56 lines, -0 lines 0 comments Download
A + courgette/disassembler_win32_x86.cc View 3 chunks +5 lines, -79 lines 0 comments Download
M courgette/encode_decode_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M courgette/encoded_program_fuzz_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M courgette/ensemble.h View 4 chunks +13 lines, -11 lines 0 comments Download
M courgette/ensemble.cc View 3 chunks +43 lines, -56 lines 0 comments Download
M courgette/ensemble_apply.cc View 1 chunk +11 lines, -5 lines 0 comments Download
M courgette/ensemble_create.cc View 1 chunk +14 lines, -10 lines 0 comments Download
M courgette/image_info.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M courgette/image_info_unittest.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M courgette/versioning_unittest.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M courgette/win32_x86_generator.h View 2 chunks +6 lines, -6 lines 0 comments Download
M courgette/win32_x86_patcher.h View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
dgarrett
http://codereview.chromium.org/8344037/diff/1/courgette/image_info.cc File courgette/image_info.cc (right): http://codereview.chromium.org/8344037/diff/1/courgette/image_info.cc#newcode311 courgette/image_info.cc:311: } These are the changes that are new from ...
9 years, 2 months ago (2011-10-19 02:01:38 UTC) #1
dgarrett
9 years, 2 months ago (2011-10-19 18:56:30 UTC) #2
dgarrett
9 years, 2 months ago (2011-10-20 19:17:50 UTC) #3
dgarrett
9 years, 2 months ago (2011-10-21 00:21:14 UTC) #4
Chris Masone
http://codereview.chromium.org/8344037/diff/2001/courgette/ensemble_create.cc File courgette/ensemble_create.cc (right): http://codereview.chromium.org/8344037/diff/2001/courgette/ensemble_create.cc#newcode73 courgette/ensemble_create.cc:73: new CourgetteWin32X86PatchGenerator( Hm. Why not just return the allocated ...
9 years, 2 months ago (2011-10-21 01:18:08 UTC) #5
dgarrett
http://codereview.chromium.org/8344037/diff/2001/courgette/ensemble_create.cc File courgette/ensemble_create.cc (right): http://codereview.chromium.org/8344037/diff/2001/courgette/ensemble_create.cc#newcode73 courgette/ensemble_create.cc:73: new CourgetteWin32X86PatchGenerator( Probably because the block that does real ...
9 years, 2 months ago (2011-10-21 01:22:38 UTC) #6
Chris Masone
This looks OK to me, except that the diff doesn't seem to be right. I ...
9 years, 2 months ago (2011-10-21 01:23:24 UTC) #7
Michael Krebs
Build failure notwithstanding, LGTM with a nit. http://codereview.chromium.org/8344037/diff/8001/courgette/courgette.h File courgette/courgette.h (right): http://codereview.chromium.org/8344037/diff/8001/courgette/courgette.h#newcode93 courgette/courgette.h:93: // |*output| ...
9 years, 2 months ago (2011-10-21 02:44:36 UTC) #8
dgarrett
http://codereview.chromium.org/8344037/diff/8001/courgette/courgette.h File courgette/courgette.h (right): http://codereview.chromium.org/8344037/diff/8001/courgette/courgette.h#newcode93 courgette/courgette.h:93: // |*output| to NULL. On 2011/10/21 02:44:36, Michael Krebs ...
9 years, 2 months ago (2011-10-21 18:24:59 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgarrett@chromium.org/8344037/13002
9 years, 2 months ago (2011-10-21 20:24:43 UTC) #10
commit-bot: I haz the power
9 years, 2 months ago (2011-10-21 22:24:21 UTC) #11
Change committed as 106793

Powered by Google App Engine
This is Rietveld 408576698