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 <assert.h> | 7 #include <assert.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 g_blocked_dlls[blocked_index] = true; | 324 g_blocked_dlls[blocked_index] = true; |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 bool Initialize(bool force) { | 328 bool Initialize(bool force) { |
329 // Check to see that we found the functions we need in ntdll. | 329 // Check to see that we found the functions we need in ntdll. |
330 if (!InitializeInterceptImports()) | 330 if (!InitializeInterceptImports()) |
331 return false; | 331 return false; |
332 | 332 |
333 // Check to see if this is a non-browser process, abort if so. | 333 // Check to see if this is a non-browser process, abort if so. |
334 if (install_static::IsNonBrowserProcess()) | 334 if (IsNonBrowserProcess()) |
335 return false; | 335 return false; |
336 | 336 |
337 // Check to see if the blacklist beacon is still set to running (indicating a | 337 // Check to see if the blacklist beacon is still set to running (indicating a |
338 // failure) or disabled, and abort if so. | 338 // failure) or disabled, and abort if so. |
339 if (!force && !LeaveSetupBeacon()) | 339 if (!force && !LeaveSetupBeacon()) |
340 return false; | 340 return false; |
341 | 341 |
342 // It is possible for other dlls to have already patched code by now and | 342 // It is possible for other dlls to have already patched code by now and |
343 // attempting to patch their code might result in crashes. | 343 // attempting to patch their code might result in crashes. |
344 const bool kRelaxed = false; | 344 const bool kRelaxed = false; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 break; | 448 break; |
449 value_buffer[value_len - 1] = L'\0'; | 449 value_buffer[value_len - 1] = L'\0'; |
450 AddDllToBlacklist(&value_buffer[0]); | 450 AddDllToBlacklist(&value_buffer[0]); |
451 } | 451 } |
452 | 452 |
453 ::RegCloseKey(key); | 453 ::RegCloseKey(key); |
454 return; | 454 return; |
455 } | 455 } |
456 | 456 |
457 } // namespace blacklist | 457 } // namespace blacklist |
OLD | NEW |