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

Side by Side Diff: chrome/browser/safe_browsing/module_integrity_verifier.h

Issue 406043003: Adding the VerifyModule function (and helpers) to safe browsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: greg's fixes Created 6 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MODULE_INTEGRITY_VERIFIER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_MODULE_INTEGRITY_VERIFIER_H_
7
8 #include <stdint.h>
9
10 namespace base { namespace win {
csharp 2014/07/30 15:22:08 Each namespace needs to go on its own line
krstnmnlsn 2014/07/30 18:36:07 Okay I'll switch. I was following a couple of exam
csharp 2014/07/30 19:29:42 It is in the Google C++ guide (http://google-style
krstnmnlsn 2014/07/30 21:03:58 Yeah I saw that, I just meant specific to namespac
11 class PEImage;
12 class PEImageAsData;
13 } }
14
15 namespace safe_browsing {
16
17 // This enum defines the possible module states VerifyModule can return.
18 enum ModuleState {
19 MODULE_STATE_UNKNOWN,
20 MODULE_STATE_UNMODIFIED,
21 MODULE_STATE_MODIFIED,
22 };
23
24 // Helper to grab the addresses and size of the code section of a PEImage.
25 // Returns two addresses: one for the dll loaded as a library, the other for the
26 // dll loaded as data.
27 bool GetCodeAddrsAndSize(const base::win::PEImage& mem_peimage,
28 const base::win::PEImageAsData& disk_peimage,
29 uint8_t** mem_code_addr,
30 uint8_t** disk_code_addr,
31 uint32_t* code_size);
32
33 // Helper to count the number of bytes differing between two pointers.
34 int CountBytesDiffInPtr(uintptr_t num_a, uintptr_t num_b);
35
36 // Examines the code section of the given module in memory and on disk, looking
37 // for unexpected differences.
38 ModuleState VerifyModule(const wchar_t* module_name);
39
40 } // namespace safe_browsing
41
42 #endif // CHROME_BROWSER_SAFE_BROWSING_MODULE_INTEGRITY_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698