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

Side by Side Diff: chrome/browser/safe_browsing/module_integrity_verifier_win.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: Copying over changes so that modified exported functions are returned by VerifyModule 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_WIN_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_MODULE_INTEGRITY_VERIFIER_WIN_H_
7
8 #include <stdint.h>
9
10 #include <set>
grt (UTC plus 2) 2014/08/05 15:51:56 #include <string>
krstnmnlsn 2014/08/05 19:17:49 Done.
11
12 namespace base {
13 namespace win {
14 class PEImage;
15 class PEImageAsData;
16 } // namespace win
17 } // namespace base
18
19 namespace safe_browsing {
20
21 // This enum defines the possible module states VerifyModule can return.
22 enum ModuleState {
23 MODULE_STATE_UNKNOWN,
24 MODULE_STATE_UNMODIFIED,
25 MODULE_STATE_MODIFIED,
26 };
27
28 // Helper to grab the addresses and size of the code section of a PEImage.
29 // Returns two addresses: one for the dll loaded as a library, the other for the
30 // dll loaded as data.
31 bool GetCodeAddrsAndSize(const base::win::PEImage& mem_peimage,
32 const base::win::PEImageAsData& disk_peimage,
33 uint8_t** mem_code_addr,
34 uint8_t** disk_code_addr,
35 uint32_t* code_size);
36
37 // Examines the code section of the given module in memory and on disk, looking
38 // for unexpected differences. Returns a ModuleState and and a set of the
39 // possibly modified exports.
40 ModuleState VerifyModule(const wchar_t* module_name,
41 std::set<std::string>* modified_exports);
42
43 } // namespace safe_browsing
44
45 #endif // CHROME_BROWSER_SAFE_BROWSING_MODULE_INTEGRITY_VERIFIER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698