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.
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_INTEGRITY_VERIFIER_WIN_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_INTEGRITY_VERIFIER_WIN_H_
20 namespace safe_browsing
{
22 // This enum defines the possible module states VerifyModule can return.
25 MODULE_STATE_UNMODIFIED
,
26 MODULE_STATE_MODIFIED
,
29 // Helper to grab the addresses and size of the code section of a PEImage.
30 // Returns two addresses: one for the dll loaded as a library, the other for the
31 // dll loaded as data.
32 bool GetCodeAddrsAndSize(const base::win::PEImage
& mem_peimage
,
33 const base::win::PEImageAsData
& disk_peimage
,
34 uint8_t** mem_code_addr
,
35 uint8_t** disk_code_addr
,
38 // Examines the code section of the given module in memory and on disk, looking
39 // for unexpected differences. Returns a ModuleState and and a set of the
40 // possibly modified exports.
41 ModuleState
VerifyModule(const wchar_t* module_name
,
42 std::set
<std::string
>* modified_exports
);
44 } // namespace safe_browsing
46 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_INTEGRITY_VERIFIER_WIN_H_