OLD | NEW |
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 #include "chrome_elf/blacklist/blacklist.h" | 5 #include "chrome_elf/blacklist/blacklist.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome_elf/blacklist/blacklist_interceptions.h" | 10 #include "chrome_elf/blacklist/blacklist_interceptions.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 return false; | 275 return false; |
276 } | 276 } |
277 | 277 |
278 bool Initialize(bool force) { | 278 bool Initialize(bool force) { |
279 #if defined(_WIN64) | 279 #if defined(_WIN64) |
280 // TODO(robertshield): Implement 64-bit support by providing 64-bit | 280 // TODO(robertshield): Implement 64-bit support by providing 64-bit |
281 // interceptors. | 281 // interceptors. |
282 return false; | 282 return false; |
283 #endif | 283 #endif |
284 | |
285 // Check to see that we found the functions we need in ntdll. | 284 // Check to see that we found the functions we need in ntdll. |
286 if (!InitializeInterceptImports()) | 285 if (!InitializeInterceptImports()) |
287 return false; | 286 return false; |
288 | 287 |
289 // Check to see if this is a non-browser process, abort if so. | 288 // Check to see if this is a non-browser process, abort if so. |
290 if (IsNonBrowserProcess()) | 289 if (IsNonBrowserProcess()) |
291 return false; | 290 return false; |
292 | 291 |
293 // Check to see if a beacon is present, abort if so. | 292 // Check to see if a beacon is present, abort if so. |
294 if (!force && !LeaveSetupBeacon()) | 293 if (!force && !LeaveSetupBeacon()) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 sizeof(sandbox::ThunkData), | 345 sizeof(sandbox::ThunkData), |
347 NULL); | 346 NULL); |
348 | 347 |
349 delete thunk; | 348 delete thunk; |
350 | 349 |
351 // Mark the thunk storage as executable and prevent any future writes to it. | 350 // Mark the thunk storage as executable and prevent any future writes to it. |
352 BOOL page_executable = VirtualProtect(&g_thunk_storage, | 351 BOOL page_executable = VirtualProtect(&g_thunk_storage, |
353 sizeof(g_thunk_storage), | 352 sizeof(g_thunk_storage), |
354 PAGE_EXECUTE_READ, | 353 PAGE_EXECUTE_READ, |
355 &old_protect); | 354 &old_protect); |
356 | |
357 return NT_SUCCESS(ret) && page_executable; | 355 return NT_SUCCESS(ret) && page_executable; |
358 } | 356 } |
359 | 357 |
360 } // namespace blacklist | 358 } // namespace blacklist |
OLD | NEW |