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

Side by Side Diff: chrome_elf/blacklist/blacklist_interceptions.cc

Issue 138903022: Cleanup browser blacklist code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Work when blacklist is length 0 Created 6 years, 11 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
« no previous file with comments | « chrome_elf/blacklist/blacklist.cc ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Implementation of NtMapViewOfSection intercept for 32 bit builds. 5 // Implementation of NtMapViewOfSection intercept for 32 bit builds.
6 // 6 //
7 // TODO(robertshield): Implement the 64 bit intercept. 7 // TODO(robertshield): Implement the 64 bit intercept.
8 8
9 #include "chrome_elf/blacklist/blacklist_interceptions.h" 9 #include "chrome_elf/blacklist/blacklist_interceptions.h"
10 10
(...skipping 17 matching lines...) Expand all
28 NtQueryVirtualMemoryFunction g_nt_query_virtual_memory_func = NULL; 28 NtQueryVirtualMemoryFunction g_nt_query_virtual_memory_func = NULL;
29 NtUnmapViewOfSectionFunction g_nt_unmap_view_of_section_func = NULL; 29 NtUnmapViewOfSectionFunction g_nt_unmap_view_of_section_func = NULL;
30 30
31 // TODO(robertshield): Merge with ntdll exports cache. 31 // TODO(robertshield): Merge with ntdll exports cache.
32 FARPROC GetNtDllExportByName(const char* export_name) { 32 FARPROC GetNtDllExportByName(const char* export_name) {
33 HMODULE ntdll = ::GetModuleHandle(sandbox::kNtdllName); 33 HMODULE ntdll = ::GetModuleHandle(sandbox::kNtdllName);
34 return ::GetProcAddress(ntdll, export_name); 34 return ::GetProcAddress(ntdll, export_name);
35 } 35 }
36 36
37 bool DllMatch(const base::string16& module_name) { 37 bool DllMatch(const base::string16& module_name) {
38 for (int i = 0; i < blacklist::g_troublesome_dlls_cur_index; ++i) { 38 for (int i = 0; blacklist::g_troublesome_dlls[i] != NULL; ++i) {
39 if (module_name == blacklist::g_troublesome_dlls[i]) 39 if (_wcsicmp(module_name.c_str(), blacklist::g_troublesome_dlls[i]) == 0)
40 return true; 40 return true;
41 } 41 }
42 return false; 42 return false;
43 } 43 }
44 44
45 // TODO(robertshield): Some of the helper functions below overlap somewhat with 45 // TODO(robertshield): Some of the helper functions below overlap somewhat with
46 // code in sandbox_nt_util.cc. See if they can be unified. 46 // code in sandbox_nt_util.cc. See if they can be unified.
47 47
48 // Native reimplementation of PSAPIs GetMappedFileName. 48 // Native reimplementation of PSAPIs GetMappedFileName.
49 base::string16 GetBackingModuleFilePath(PVOID address) { 49 base::string16 GetBackingModuleFilePath(PVOID address) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 DCHECK_NT(g_nt_unmap_view_of_section_func); 223 DCHECK_NT(g_nt_unmap_view_of_section_func);
224 g_nt_unmap_view_of_section_func(process, *base); 224 g_nt_unmap_view_of_section_func(process, *base);
225 ret = STATUS_UNSUCCESSFUL; 225 ret = STATUS_UNSUCCESSFUL;
226 } 226 }
227 227
228 } 228 }
229 return ret; 229 return ret;
230 } 230 }
231 231
232 } // namespace blacklist 232 } // namespace blacklist
OLDNEW
« no previous file with comments | « chrome_elf/blacklist/blacklist.cc ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698