<commit_before>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome_elf/blacklist/blacklist.h"

#include <assert.h>
#include <string.h>

#include <vector>

#include "base/basictypes.h"
#include "chrome_elf/blacklist/blacklist_interceptions.h"
#include "chrome_elf/chrome_elf_constants.h"
#include "chrome_elf/chrome_elf_util.h"
#include "chrome_elf/thunk_getter.h"
#include "sandbox/win/src/interception_internal.h"
#include "sandbox/win/src/internal_types.h"
#include "sandbox/win/src/service_resolver.h"

// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
extern "C" IMAGE_DOS_HEADER __ImageBase;

namespace blacklist{

// The DLLs listed here are known (or under strong suspicion) of causing crashes
// when they are loaded in the browser. DLLs should only be added to this list
// if there is nothing else Chrome can do to prevent those crashes.
// For more information about how this list is generated, and how to get off
// of it, see:
// https://sites.google.com/a/chromium.org/dev/Home/third-party-developers
// NOTE: Please remember to update the DllHash enum in histograms.xml when
//       adding a new value to the blacklist.
const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount] = {
  L"activedetect32.dll",                // Lenovo One Key Theater.
                                        // See crbug.com/379218.
  L"activedetect64.dll",                // Lenovo One Key Theater.
  L"bitguard.dll",                      // Unknown (suspected malware).
  L"chrmxtn.dll",                       // Unknown (keystroke logger).
  L"cplushook.dll",                     // Unknown (suspected malware).
  L"datamngr.dll",                      // Unknown (suspected adware).
  L"hk.dll",                            // Unknown (keystroke logger).
  L"libapi2hook.dll",                   // V-Bates.
  L"libinject.dll",                     // V-Bates.
  L"libinject2.dll",                    // V-Bates.
  L"libredir2.dll",                     // V-Bates.
  L"libsvn_tsvn32.dll",                 // TortoiseSVN.
  L"libwinhook.dll",                    // V-Bates.
  L"lmrn.dll",                          // Unknown.
  L"minisp.dll",                        // Unknown (suspected malware).
  L"safetynut.dll",                     // Unknown (suspected adware).
  L"systemk.dll",                       // Unknown (suspected adware).
  L"wajam_goblin_64.dll",               // Wajam Internet Technologies.
  L"wajam_goblin.dll",                  // Wajam Internet Technologies.
  L"windowsapihookdll32.dll",           // Lenovo One Key Theater.
                                        // See crbug.com/379218.
  L"windowsapihookdll64.dll",           // Lenovo One Key Theater.
  // Keep this null pointer here to mark the end of the list.
  NULL,
};

bool g_blocked_dlls[kTroublesomeDllsMaxCount] = {};
int g_num_blocked_dlls = 0;

}  // namespace blacklist

// Allocate storage for thunks in a page of this module to save on doing
// an extra allocation at run time.
#pragma section(".crthunk",read,execute)
__declspec(allocate(".crthunk")) sandbox::ThunkData g_thunk_storage;

namespace {

// Record if the blacklist was successfully initialized so processes can easily
// determine if the blacklist is enabled for them.
bool g_blacklist_initialized = false;
<commit_msg>Add YCWebCameraSource.ax to Chrome blacklist<commit_after>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome_elf/blacklist/blacklist.h"

#include <assert.h>
#include <string.h>

#include <vector>

#include "base/basictypes.h"
#include "chrome_elf/blacklist/blacklist_interceptions.h"
#include "chrome_elf/chrome_elf_constants.h"
#include "chrome_elf/chrome_elf_util.h"
#include "chrome_elf/thunk_getter.h"
#include "sandbox/win/src/interception_internal.h"
#include "sandbox/win/src/internal_types.h"
#include "sandbox/win/src/service_resolver.h"

// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
extern "C" IMAGE_DOS_HEADER __ImageBase;

namespace blacklist{

// The DLLs listed here are known (or under strong suspicion) of causing crashes
// when they are loaded in the browser. DLLs should only be added to this list
// if there is nothing else Chrome can do to prevent those crashes.
// For more information about how this list is generated, and how to get off
// of it, see:
// https://sites.google.com/a/chromium.org/dev/Home/third-party-developers
// NOTE: Please remember to update the DllHash enum in histograms.xml when
//       adding a new value to the blacklist.
const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount] = {
  L"activedetect32.dll",                // Lenovo One Key Theater.
                                        // See crbug.com/379218.
  L"activedetect64.dll",                // Lenovo One Key Theater.
  L"bitguard.dll",                      // Unknown (suspected malware).
  L"chrmxtn.dll",                       // Unknown (keystroke logger).
  L"cplushook.dll",                     // Unknown (suspected malware).
  L"datamngr.dll",                      // Unknown (suspected adware).
  L"hk.dll",                            // Unknown (keystroke logger).
  L"libapi2hook.dll",                   // V-Bates.
  L"libinject.dll",                     // V-Bates.
  L"libinject2.dll",                    // V-Bates.
  L"libredir2.dll",                     // V-Bates.
  L"libsvn_tsvn32.dll",                 // TortoiseSVN.
  L"libwinhook.dll",                    // V-Bates.
  L"lmrn.dll",                          // Unknown.
  L"minisp.dll",                        // Unknown (suspected malware).
  L"safetynut.dll",                     // Unknown (suspected adware).
  L"systemk.dll",                       // Unknown (suspected adware).
  L"wajam_goblin_64.dll",               // Wajam Internet Technologies.
  L"wajam_goblin.dll",                  // Wajam Internet Technologies.
  L"windowsapihookdll32.dll",           // Lenovo One Key Theater.
                                        // See crbug.com/379218.
  L"windowsapihookdll64.dll",           // Lenovo One Key Theater.
  L"YCWebCameraSource.ax",              // CyberLink Youcam, crbug.com/424159
  // Keep this null pointer here to mark the end of the list.
  NULL,
};

bool g_blocked_dlls[kTroublesomeDllsMaxCount] = {};
int g_num_blocked_dlls = 0;

}  // namespace blacklist

// Allocate storage for thunks in a page of this module to save on doing
// an extra allocation at run time.
#pragma section(".crthunk",read,execute)
__declspec(allocate(".crthunk")) sandbox::ThunkData g_thunk_storage;

namespace {

// Record if the blacklist was successfully initialized so processes can easily
// determine if the blacklist is enabled for them.
bool g_blacklist_initialized = false;

{'fraction_non_alphanumeric': 0.10630656514868553, 'fraction_numerical': 0.014078437006177273, 'mean_word_length': 2.203865623561896, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3082844', 'n_tokens_mistral': 2321, 'n_tokens_neox': 2097, 'n_words': 576}