Esempio n. 1
0
unsigned int __stdcall CleanRegThread(void* parm)
{
    VEC_REGINFO vec_regInfo = *((VEC_REGINFO*)parm);
    CRegOpt regOpt;

    if(vec_regInfo.GetSize()<=0)
        return 0;

    g_fnScanRegError(g_pMainError,BEGINPROC(vec_regInfo[0].iType),NULL,NULL);
    int iType =  vec_regInfo[0].iType;

    int i=0;
    for (i=0; i<vec_regInfo.GetSize(); i++)
    {

        if (iType != vec_regInfo[i].iType)
        {
            //如果与上次类型不同则结束上次类型,开启新类型
            g_fnScanRegError(g_pMainError,ENDPROC(iType),NULL,NULL);

            g_fnScanRegError(g_pMainError,BEGINPROC(vec_regInfo[i].iType),NULL,NULL);
            iType =  vec_regInfo[i].iType;
        }

        if (FALSE==CleanReg(vec_regInfo[i].iType,vec_regInfo[i].strKeyFullPath,vec_regInfo[i].strValueName))
        {
            KCLEAR_LOG(LOG_LEVEL_TRACKCLEAN) << "Clean Failed:"
                                             << UnicodeToAnsi(vec_regInfo[i].strKeyFullPath.GetBuffer())
                                             << "--"
                                             << UnicodeToAnsi(vec_regInfo[i].strValueName.GetBuffer());
            g_fnScanRegError(g_pMainError,vec_regInfo[i].iType,vec_regInfo[i].strKeyFullPath,vec_regInfo[i].strValueName);
        }
        else
        {
            KCLEAR_LOG(LOG_LEVEL_TRACKCLEAN) << "Clean Successed:"
                                             << UnicodeToAnsi(vec_regInfo[i].strKeyFullPath.GetBuffer())
                                             << "--"
                                             << UnicodeToAnsi(vec_regInfo[i].strValueName.GetBuffer());
        }

    }
    g_fnScanRegError(g_pMainError,ENDPROC(vec_regInfo[i-1].iType),NULL,NULL);


//	g_regBack.RegisterExport(NULL);
//	g_regBack.RestRegister(NULL);

    OutputDebugString(_T("Reg清理完成"));
    g_fnScanRegError(g_pMainError,0000,_T(""),0);

    _endthreadex(0);
    return 0;
}
Esempio n. 2
0
unsigned int __stdcall BageThread(void* parm)
{
    OutputDebugString(_T("垃圾线程开始......\n"));

    GARBAINFO_IN vec_typeInfo = *((GARBAINFO_IN*)parm);

    g_fnScanFile(g_pMain,BEGINPROC(FILEGARBAGE_EXTS),0,0,0);

    for (int i=0; i< vec_typeInfo.vec_scanPathInfo.GetSize() ; i++)
    {

        g_garbageClean.ScanGarbageFile(
            vec_typeInfo.vec_scanPathInfo[i].strScanFile.GetBuffer(),
            vec_typeInfo.vec_fileExtsInfo
        );
        vec_typeInfo.vec_scanPathInfo[i].strScanFile.ReleaseBuffer();
    }

    g_fnScanFile(g_pMain,ENDPROC(FILEGARBAGE_EXTS),0,0,0);

    g_fnScanFile(g_pMain,0000,_T(""),0,0);
    g_fnScanReg(g_pMain,0000,_T(""),0,0);

    _endthreadex(0);
    return 0;
}
Esempio n. 3
0
BOOL CSpecialApp::ScanXunleiSearch(int iType)
{
	KSearchSoftwareStruct sss;
	std::vector<std::wstring>::iterator it;
	WCHAR szPath[MAX_PATH] = {0};
	sss.pszMainFileName      = TEXT( "Program\\thunder.exe" );
	sss.hRegRootKey          = HKEY_LOCAL_MACHINE;
	sss.pszRegSubKey         = TEXT( "SOFTWARE\\Thunder Network\\ThunderOem\\thunder_backwnd" );
	sss.pszPathValue      	 = TEXT( "dir" );
	sss.bFolder              = TRUE;
	BOOL bRet = FALSE;
	std::wstring str;
	std::wstring strPath;
	std::wstring strTemp;
	bRet = SearchSoftwarePath( &sss, strPath);
	wcscpy_s(szPath, MAX_PATH - 1, strPath.c_str());
	PathRemoveFileSpec(szPath);
	PathRemoveFileSpec(szPath);
	PathAppend(szPath, L"Profiles\\GougouSearch\\history.history");
	strPath  = szPath;
	if (GetFileAttributes(strPath.c_str()) == INVALID_FILE_ATTRIBUTES)
	{
		WCHAR* pEnv = NULL;
		WCHAR  szPath[MAX_PATH] = {0};
		pEnv = _wgetenv(_T("public"));
		if (pEnv != NULL)
		{
			wcscpy(szPath, pEnv);
			PathAppend(szPath, L"Documents\\Thunder Network\\Thunder\\Profiles\\GougouSearch\\history.history");
			strPath = szPath;
		}
		else
		{
			return TRUE;
		}
	}

	g_fnScanFile(g_pMain, BEGINPROC(XUNLEI7_DOWNLOADER), 0, 0, 0);
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"thunder.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";
	if (m_bScan)
	{
		ModifyTxtData(iType, strPath.c_str());
//		m_appHistory.CommfunFile(KUWOMUSIC_PLAYER, strPath.c_str(), vec_file);
	}
clean0:
	g_fnScanFile(g_pMain, ENDPROC(XUNLEI7_DOWNLOADER), str.c_str(), 0, 0);

	return TRUE;
}
Esempio n. 4
0
BOOL CKSogoClean::ScanSogoAdvForm()
{
	if (!_CheckSogouExist())
	{
		g_vsNoinstallapp.Add(SOGO_ADVFORM);
		return TRUE;
	}

	BOOL bRet = FALSE;
	WCHAR szSogoAppPath[MAX_PATH] = {0};
	std::wstring strTemp;
	SHGetSpecialFolderPath(NULL, szSogoAppPath, CSIDL_APPDATA, FALSE);
	PathAppend(szSogoAppPath, L"SogouExplorer");
	strTemp = szSogoAppPath;
	PathAppend(szSogoAppPath, L"FormData.dat");
	g_fnScanFile(g_pMain,BEGINPROC(SOGO_ADVFORM),0,0,0);

	std::wstring str;

	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"sogouexplorer.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";

	if (m_bScan)
	{
		ScanDbTable(szSogoAppPath, L"IndexPrecise", SOGO_ADVFORM);
		ScanDbTable(szSogoAppPath, L"PreciseData", SOGO_ADVFORM);
		std::vector<std::wstring> vec_userInfo;
		std::vector<std::wstring>::iterator it;
		if (GetUserInfo(vec_userInfo))
		{
			for (it = vec_userInfo.begin(); it != vec_userInfo.end(); it++)
			{
				std::wstring strUserPath;
				strUserPath = strTemp;
				strUserPath += L"\\";
				strUserPath += *it;
				strUserPath += L"\\FormData.dat";
				ScanDbTable(strUserPath, L"IndexPrecise", SOGO_ADVFORM);
				ScanDbTable(strUserPath, L"PreciseData", SOGO_ADVFORM);
			}
		}
	}
clean0:
	g_fnScanFile(g_pMain,ENDPROC(SOGO_ADVFORM),str.c_str(),0,0);

	return bRet;
}
Esempio n. 5
0
BOOL CSpecialApp::CleanMyIE2() //
{	

	g_fnScanFile(g_pMain,BEGINPROC(BROWSERSCLEAN_MYIE2),0,0,0);

	if (m_bScan ==TRUE)
	{
		CString strRegPath = _T("HKEY_CURRENT_USER\\Software\\MYIE2");

		HKEY	hRootKey;
		CString strSubKey;
		m_regOpt.CrackRegKey(strRegPath,hRootKey,strSubKey);

		CString strValueName = _T("Folder");
		CString strValueData;
		m_regOpt.GetDefValue(hRootKey,strSubKey,strValueName,strValueData);


		int iLen = strValueData.GetLength();

		if(iLen <= 0)
			goto Exit;

		if (strValueData.GetAt(iLen-1) != _T('\\'))
		{
			strValueData.Append(_T("\\"));
		}

		if (strValueData!=_T(""))
		{

			CString strFileFullPath;
			WIN32_FIND_DATA fd;
			HANDLE hFindFile;

			strFileFullPath = strValueData;
			
			strFileFullPath.Append(_T("Config\\myie.ini"));
			hFindFile = FindFirstFile(strFileFullPath.GetBuffer(), &fd);
			strFileFullPath.ReleaseBuffer();
			if(hFindFile != INVALID_HANDLE_VALUE)
			{	
				//找到文件
				ScanSection(BROWSERSCLEAN_MYIE2,_T("UndoUrl"),strFileFullPath);	
				::FindClose(hFindFile); 
			}
		}
	}

Exit:

	g_fnScanFile(g_pMain,ENDPROC(BROWSERSCLEAN_MYIE2),0,0,0);
	return TRUE;
}
Esempio n. 6
0
BOOL CKSogoClean::ScanSogoHistory()
{
	if (!_CheckSogouExist())
	{
		g_vsNoinstallapp.Add(BROWSERSCLEAN_SOGO);
		return TRUE;
	}
	BOOL bRet = FALSE;
	WCHAR strPath[MAX_PATH] = {0};
	std::wstring strDbPath;
	std::wstring strDbTemp;
	std::wstring str;
	str = L"";
	SHGetSpecialFolderPath(NULL, strPath, CSIDL_APPDATA, FALSE);
	g_fnScanFile(g_pMain, BEGINPROC(BROWSERSCLEAN_SOGO), 0, 0, 0);
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"sogouexplorer.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";
	if (m_bScan)
	{
		PathAppend(strPath, L"SogouExplorer");
		strDbTemp = strPath;
		strDbPath = strPath;
		strDbPath += L"\\uhistory.db";
		ScanDbTable(strDbPath, L"tb_urlhistory", BROWSERSCLEAN_SOGO);
		ScanDbTable(strDbPath, L"tb_urlinfo", BROWSERSCLEAN_SOGO);

		strDbPath = strDbTemp;
		strDbPath += L"\\HistoryUrl.db";
		ScanDbTable(strDbPath, L"UserRankUrl", BROWSERSCLEAN_SOGO);
		ScanDbTable(strDbPath, L"often", BROWSERSCLEAN_SOGO);
		ScanDbTable(strDbPath, L"UndoUrl", BROWSERSCLEAN_SOGO);
		EnumUserInfo(BROWSERSCLEAN_SOGO);

		strDbPath = strDbTemp;
		strDbPath += L"\\Webkit\\Cache";
		CSimpleArray<CString> vec_file;
		m_appHistory.CommfunFile(BROWSERSCLEAN_SOGO, strDbPath.c_str(), vec_file);
	}
clean0:
	g_fnScanFile(g_pMain, ENDPROC(BROWSERSCLEAN_SOGO), str.c_str(), 0, 0);
	return bRet;
}
Esempio n. 7
0
BOOL CKSogoClean::ScanSogoCookies()
{
	if (!_CheckSogouExist())
	{
		g_vsNoinstallapp.Add(SOGO_COOKIES);
		return TRUE;
	}
	BOOL bRet = FALSE;
	WCHAR szCookiesPath[MAX_PATH] = {0};
	WCHAR szSogoAppPath[MAX_PATH] = {0};
	std::wstring strFilePath;
	CSimpleArray<CString> vec_file;
	SHGetSpecialFolderPath(NULL, szCookiesPath, CSIDL_COOKIES, FALSE);
	SHGetSpecialFolderPath(NULL, szSogoAppPath, CSIDL_APPDATA, FALSE);
	PathAppend(szSogoAppPath, L"SogouExplorer\\Webkit\\Cookies");
	strFilePath = szSogoAppPath;
	g_fnScanFile(g_pMain, BEGINPROC(SOGO_COOKIES), 0, 0, 0);
	std::wstring str;
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"sogouexplorer.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";
	if (m_bScan)
	{
		m_appHistory.CommfunFile(SOGO_COOKIES, szCookiesPath, vec_file);
		ScanDbTable(strFilePath, L"cookies", SOGO_COOKIES);
	}
clean0:

	g_fnScanFile(g_pMain, ENDPROC(SOGO_COOKIES), str.c_str(), 0, 0);
	return bRet;
}
Esempio n. 8
0
BOOL CKSogoClean::ScanSogoPass()
{
	if (!_CheckSogouExist())
	{
		g_vsNoinstallapp.Add(SOGO_PASS);
		return TRUE;
	}

	BOOL bRet = FALSE;
	static BOOL bFlag = FALSE;
	std::wstring str;

	g_fnScanFile(g_pMain,BEGINPROC(SOGO_PASS),0,0,0);
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"sogouexplorer.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";

	if (!bFlag)
	{
		str = L"可以清理";
		bFlag = TRUE;
	}
clean0:
	g_fnScanFile(g_pMain,ENDPROC(SOGO_PASS),str.c_str(),0,0);

	return bRet;
}
Esempio n. 9
0
unsigned int __stdcall CleanFileThread(void* parm)
{

    VEC_FILEINFO vec_fileInfo = *((VEC_FILEINFO*)parm);

    if(vec_fileInfo.GetSize()<=0)
        return 0;

    g_fnScanFileError(g_pMainError,BEGINPROC(vec_fileInfo[0].iType),NULL,NULL,NULL);
    int iType =  vec_fileInfo[0].iType;

    int i;
    for (i=0; i<vec_fileInfo.GetSize(); i++)
    {
        if (iType != vec_fileInfo[i].iType)
        {
            //如果与上次类型不同则结束上次类型,开启新类型
            g_fnScanFileError(g_pMainError,ENDPROC(iType),NULL,NULL,NULL);

            g_fnScanFileError(g_pMainError,BEGINPROC(vec_fileInfo[i].iType),NULL,NULL,NULL);
            iType =  vec_fileInfo[i].iType;
        }


        if(FALSE==CleanFile(vec_fileInfo[i].iType,vec_fileInfo[i].strFileFullPath))
        {
            KCLEAR_LOG(LOG_LEVEL_TRACKCLEAN) << "Clean Failed :" << UnicodeToAnsi(vec_fileInfo[i].strFileFullPath.GetBuffer());

            MoveFileEx (vec_fileInfo[i].strFileFullPath,  NULL,  MOVEFILE_DELAY_UNTIL_REBOOT);

            WIN32_FIND_DATA fd;
            HANDLE hFindFile = FindFirstFile(vec_fileInfo[i].strFileFullPath.GetBuffer(), &fd);
            vec_fileInfo[i].strFileFullPath.ReleaseBuffer();
            if(hFindFile == INVALID_HANDLE_VALUE)
            {
                OutputDebugString(_T("文件不存在"));
                ::FindClose(hFindFile);
                continue;
            }
            ::FindClose(hFindFile);

            g_fnScanFileError(g_pMainError,
                              vec_fileInfo[i].iType,
                              vec_fileInfo[i].strFileFullPath,
                              fd.nFileSizeLow,fd.nFileSizeHigh
                             );
        }
        else
        {
            KCLEAR_LOG(LOG_LEVEL_TRACKCLEAN) << "Clean Successed:" << UnicodeToAnsi(vec_fileInfo[i].strFileFullPath.GetBuffer());
        }

    }
    g_fnScanFileError(g_pMainError,ENDPROC(vec_fileInfo[i-1].iType),NULL,NULL,NULL);


    //删除空文件夹
    //WCHAR* pEnv;
    //pEnv = _wgetenv(_T("USERPROFILE"));
    //if (pEnv !=NULL)
    //{
    //	g_fileOpt.DeleteEmptyDirectories(pEnv);
    //}


    g_fnScanFileError(g_pMainError,0,_T(""),0,0);

    OutputDebugString(_T("File清理完成"));
    _endthreadex(0);
    return 0;
}
Esempio n. 10
0
BOOL __stdcall _ScanRegCallBack(void* pMain,int iType,LPCTSTR lpcszKeyFullPath,LPCTSTR lpcszValueName,LPCTSTR lpcszValueData)
{
    OutputDebugString(_T("\n开始\n"));
    g_fnOutScanReg(pMain,iType,lpcszKeyFullPath,lpcszValueName,lpcszValueData);

    if (FALSE == g_bIsClean)
        return TRUE;


    //对无效类信息,ActriveX,及无效上下文进行特殊处理,保证先完全删除 类信息..然后是 Activex 最后为上下文

    static VEC_REGINFO vec_speci_regInfo;
    if(iType == BEGINPROC(REGCLEAN_FAILCLASS)||
            iType == BEGINPROC(REGCLEAN_FAILACTIVEX)||
            iType == BEGINPROC(REGCLEAN_FAILAFILEASS)
      )
    {
        return TRUE;
    }
    else if (iType == REGCLEAN_FAILCLASS||
             iType == REGCLEAN_FAILACTIVEX||
             iType == REGCLEAN_FAILAFILEASS
            )
    {
        RegInfo_in regInfo;
        regInfo.iType = iType;
        regInfo.strKeyFullPath = lpcszKeyFullPath;
        if(wcscmp(lpcszValueName,_T("默认值"))==0)
            regInfo.strValueName = _T("");
        else
            regInfo.strValueName = lpcszValueName;

        vec_speci_regInfo.Add(regInfo);
        return TRUE;
    }
    else if (iType == ENDPROC(REGCLEAN_FAILCLASS)||
             iType == ENDPROC(REGCLEAN_FAILACTIVEX)||
             iType == ENDPROC(REGCLEAN_FAILAFILEASS)
            )
    {
        for (int i=0; i<vec_speci_regInfo.GetSize(); i++)
        {
            //清除值
            CString strRegFullPath = vec_speci_regInfo[i].strKeyFullPath;
            CString strValueName= vec_speci_regInfo[i].strValueName;
            if (FALSE==CleanReg(iType,strRegFullPath,strValueName))
            {
                g_fnScanRegError(g_pMainError,vec_speci_regInfo[i].iType,
                                 vec_speci_regInfo[i].strKeyFullPath,
                                 vec_speci_regInfo[i].strValueName
                                );
            }

        }
        vec_speci_regInfo.RemoveAll();

        return TRUE;
    }


    //通用处理
    static VEC_REGINFO vec_regInfo;

    if (((iType/100)-((iType/1000)*10)) == 1)	//开始标记
    {
        return TRUE;
    }
    else if (((iType/100)-((iType/1000)*10)) == 2||
             iType == 0
            ) //结束标记
    {
        for (int i=0; i<vec_regInfo.GetSize(); i++)
        {
            //清除值
            CString strRegFullPath = vec_regInfo[i].strKeyFullPath;
            CString strValueName= vec_regInfo[i].strValueName;
            if (FALSE==CleanReg(iType,strRegFullPath,strValueName))
            {
                g_fnScanRegError(g_pMainError,vec_regInfo[i].iType,
                                 vec_regInfo[i].strKeyFullPath,
                                 vec_regInfo[i].strValueName
                                );
            }

        }

        vec_regInfo.RemoveAll();
    }
    else
    {
        RegInfo_in regInfo;
        regInfo.iType = iType;
        regInfo.strKeyFullPath = lpcszKeyFullPath;
        if(wcscmp(lpcszValueName,_T("默认值"))==0)
            regInfo.strValueName = _T("");
        else
            regInfo.strValueName = lpcszValueName;
        vec_regInfo.Add(regInfo);
    }

    OutputDebugString(_T("\n结束\n"));

    return TRUE;
}
Esempio n. 11
0
BOOL CChromClean::ScanChormCookies()
{
	BOOL bRet = FALSE;
	WCHAR szPath[MAX_PATH] = {0};
	CString strPath;
	sqlite3* pDb = NULL;
	sqlite3_stmt* sspStart = NULL;
	string strFullPath;
	char* szError = NULL;
	char szSql[MAX_PATH] = {0};
	int nResult = -1;
	if (!_CheckChromeExist())
	{
		g_vsNoinstallapp.Add(CHROME_COOKIES);
		return TRUE;
	}
	g_fnScanFile(g_pMain, BEGINPROC(CHROME_COOKIES), 0, 0, 0);

	std::wstring str;
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"chrome.exe")
		{
			str = L"正在运行,跳过";
			goto clean0;
		}
	}
	str = L"";
	if(m_bScan)
	{

		SHGetSpecialFolderPath(NULL, szPath, CSIDL_LOCAL_APPDATA, FALSE);
		strPath = szPath;
		if (strPath.ReverseFind(L'\\') != strPath.GetLength() - 1)
		{
			strPath += L"\\";
		}
		strPath += L"Google\\Chrome\\User Data\\Default\\Cookies";
		strFullPath = UnicodeToUtf8(strPath.GetBuffer());
		nResult = sqlite3_open(strFullPath.c_str(), &pDb);
		if (nResult != SQLITE_OK)
		{
			bRet = FALSE;
			goto clean0;
		}
		nResult = sqlite3_prepare(pDb, "select * from cookies", -1, &sspStart, 0);
		if (nResult != SQLITE_OK)
		{
			bRet = FALSE;
			goto clean0;
		}

		nResult = sqlite3_step(sspStart);
		if (nResult == SQLITE_ROW)
		{
			CString strOutput;
			strOutput = Utf8ToUnicode(strFullPath).c_str();
			strOutput += L"|";
			strOutput += L"cookies";
			g_fnScanFile(g_pMain, CHROME_COOKIES, strOutput, 0, 0);
		}

	}
clean0:

	g_fnScanFile(g_pMain, ENDPROC(CHROME_COOKIES), str.c_str(), 0, 0);
	if(sspStart != NULL)
	{
		sqlite3_finalize(sspStart);
		sspStart = NULL;
	}
	if(pDb != NULL)
	{
		sqlite3_close(pDb);
		pDb = NULL;
	}
	return bRet;
}
Esempio n. 12
0
BOOL CChromClean::ScanChromePass()
{	
	if (!_CheckChromeExist())
	{
		g_vsNoinstallapp.Add(CHROME_PASSWORD);
		return TRUE;
	}
	CSimpleArray<CString> vec_file;
	CString strPath; 

	g_fnScanFile(g_pMain,BEGINPROC(CHROME_PASSWORD),0,0,0);

	std::wstring str;
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"chrome.exe")
		{
			str = L"正在运行,跳过";
			goto _exit_;
		}
	}
	str = L"";
	if (m_bScan ==TRUE)
	{
        TCHAR szBuffer[MAX_PATH] = {0};

        ::SHGetSpecialFolderPath( NULL, szBuffer, CSIDL_LOCAL_APPDATA, FALSE);

        strPath = szBuffer;
        strPath += _T("\\Google\\Chrome\\User Data\\Default");
        sqlite3* pDB = NULL;
        sqlite3_stmt* sspStart = NULL;

        CString strDbPath = L"";
        strPath += L"\\";
        FindFileInDirectory(strPath.GetBuffer(),strDbPath,_T("Web Data"));
		strPath.ReleaseBuffer();

        if (strDbPath.GetLength()>=0)
        {
            KW2UTF8  szDataPath(strDbPath.GetBuffer());
            int nResult = sqlite3_open(szDataPath, &pDB);
            if (nResult != SQLITE_OK)
            {
                goto _exit_1;
            }
            nResult = sqlite3_prepare(pDB, "select * from logins", -1, &sspStart, 0);
            if (nResult != SQLITE_OK)
            {
                goto _exit_1;
            }

            nResult = sqlite3_step(sspStart);

            if(nResult == SQLITE_ROW)
            {
                CString strOutPut = strDbPath;
                strOutPut += L"|logins";
                g_fnScanFile(g_pMain, CHROME_PASSWORD, strOutPut, 0, 0);

            }
_exit_1:
            
            if (sspStart)
            {
                sqlite3_finalize(sspStart);
                sspStart = NULL;
            }

            if (pDB)
            {
                sqlite3_close(pDB);
                pDB = NULL;
            }

        }   

		strDbPath = L"";
		FindFileInDirectory(strPath.GetBuffer(),strDbPath,_T("Login Data"));
		strPath.ReleaseBuffer();

		if (strDbPath.GetLength()>=0)
		{
			KW2UTF8  szDataPath(strDbPath.GetBuffer());
			strDbPath.ReleaseBuffer();
			int nResult = sqlite3_open(szDataPath, &pDB);
			if (nResult != SQLITE_OK)
			{
				goto _exit_2;
			}
			nResult = sqlite3_prepare(pDB, "select * from logins", -1, &sspStart, 0);
			if (nResult != SQLITE_OK)
			{
				goto _exit_2;
			}

			nResult = sqlite3_step(sspStart);

			if(nResult == SQLITE_ROW)
			{
				CString strOutPut = strDbPath;
				strOutPut += L"|logins";
				g_fnScanFile(g_pMain, CHROME_PASSWORD, strOutPut, 0, 0);

			}
_exit_2:

			if (sspStart)
			{
				sqlite3_finalize(sspStart);
				sspStart = NULL;
			}

			if (pDB)
			{
				sqlite3_close(pDB);
				pDB = NULL;
			}

		}   
	}
_exit_:
	g_fnScanFile(g_pMain,ENDPROC(CHROME_PASSWORD),str.c_str(),0,0);

	return TRUE;		
}
Esempio n. 13
0
BOOL CChromClean::ScanChrome()
{	
	//文件部分
	if (!_CheckChromeExist())
	{
		g_vsNoinstallapp.Add(BROWSERSCLEAN_CHROME);
		return TRUE;
	}
	CSimpleArray<CString> vec_file;
	CString strPath; 
	std::wstring str;
	g_fnScanFile(g_pMain,BEGINPROC(BROWSERSCLEAN_CHROME),0,0,0);
	
	std::vector<std::wstring>::iterator it;
	for (it = g_listProcessName.begin(); it != g_listProcessName.end(); it++ )
	{
		str = *it;
		transform(str.begin(), str.end(), str.begin(), towlower);
		if (str == L"chrome.exe")
		{
			str = L"正在运行,跳过";
			goto _exit_;
		}
	}
	str = L"";
	if (m_bScan ==TRUE)
	{
        TCHAR szBuffer[MAX_PATH] = {0};
		
        ::SHGetSpecialFolderPath( NULL, szBuffer, CSIDL_LOCAL_APPDATA, FALSE);

        strPath = szBuffer;
        strPath += _T("\\Google\\Chrome\\User Data\\Default\\Cache");
		m_appHistory.CommfunFile(BROWSERSCLEAN_CHROME,strPath,vec_file);
		
        strPath = szBuffer;
		strPath += _T("\\Google\\Chrome\\User Data\\Default\\Media Cache");
		m_appHistory.CommfunFile(BROWSERSCLEAN_CHROME,strPath,vec_file);

		//vec_file.Add(_T("Cookies"));
		//vec_file.Add(_T("Extension Cookies"));
		vec_file.Add(_T("Archived History"));
		//vec_file.Add(_T("History"));
		//vec_file.Add(_T("History-journal"));
		//vec_file.Add(_T("Thumbnails"));
		//vec_file.Add(_T("Thumbnails-journal"));
		vec_file.Add(_T("Current Tabs"));
		vec_file.Add(_T("Current Session"));
		vec_file.Add(_T("Last Tabs"));
		vec_file.Add(_T("Last Session"));
		vec_file.Add(_T("Safe Browsing Bloom"));
		vec_file.Add(_T("History Index*"));
		vec_file.Add(_T("Visited Links"));

		//vec_file.Add(_T("Extension Cookies"));
        strPath = szBuffer;
		strPath += _T("\\Google\\Chrome\\User Data\\Default");
		m_appHistory.CommfunFile(BROWSERSCLEAN_CHROME,strPath,vec_file);
		vec_file.RemoveAll();

        sqlite3* pDB = NULL;
        sqlite3_stmt* sspStart = NULL;

        CString strDbPath = L"";
        strPath += L"\\";
        FindFileInDirectory(strPath.GetBuffer(),strDbPath,_T("History"));
		strPath.ReleaseBuffer();

        if (strDbPath.GetLength()>=0)
        {
            KW2UTF8  szDataPath(strDbPath.GetBuffer());
			strDbPath.ReleaseBuffer();
            int nResult = sqlite3_open(szDataPath, &pDB);
            if (nResult != SQLITE_OK)
            {
                goto _exit_1;
            }
            nResult = sqlite3_prepare(pDB, "select * from segments", -1, &sspStart, 0);
            if (nResult != SQLITE_OK)
            {
                goto _exit_1;
            }

            nResult = sqlite3_step(sspStart);

            if(nResult == SQLITE_ROW)
            {
                CString strOutPut = strDbPath;
                strOutPut += L"|segments";
                g_fnScanFile(g_pMain, BROWSERSCLEAN_CHROME, strOutPut, 0, 0);
            }
        _exit_1:
			if (sspStart)
			{
				sqlite3_finalize(sspStart);
				sspStart = NULL;
			}

			if (pDB)
			{
				sqlite3_close(pDB);
				pDB = NULL;
			}

			nResult = sqlite3_open(szDataPath, &pDB);
			if (nResult != SQLITE_OK)
			{
				goto _exit_2;
			}

            nResult = sqlite3_prepare(pDB, "select * from visits", -1, &sspStart, 0);
            if (nResult != SQLITE_OK)
            {
                goto _exit_2;
            }

            nResult = sqlite3_step(sspStart);

            if(nResult == SQLITE_ROW)
            {
                CString strOutPut = strDbPath;
                strOutPut += L"|visits";
                g_fnScanFile(g_pMain, BROWSERSCLEAN_CHROME, strOutPut, 0, 0);

            }

        _exit_2:
            if (sspStart)
            {
                sqlite3_finalize(sspStart);
                sspStart = NULL;
            }
            if (pDB)
            {
                sqlite3_close(pDB);
                pDB = NULL;
            }

        }   

	}
	
_exit_:
	g_fnScanFile(g_pMain,ENDPROC(BROWSERSCLEAN_CHROME),str.c_str(),0,0);
	
	return TRUE;
}