亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? msrc4plugin.cpp

?? DSM Plugin.加密文件
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//  Copyright (C) 2005 Sean E. Covel All Rights Reserved.
//
//  Created by Sean E. Covel based on UltraVNC's excellent TestPlugin project.
//
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
//  USA.
//
// If the source code for the program is not available from the place from
// which you received this file, check 
// http://home.comcast.net/~msrc4plugin
// or
// mail: msrc4plugin@comcast.net
//
//
//
/////////////////////////////////////////////////////////////////////////////
//  Copyright (C) 2005 Ultr@Vnc All Rights Reserved.
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
//  USA.
//
// If the source code for the program is not available from the place from
// which you received this file, check 
// http://ultravnc.sourceforge.net/
//
////////////////////////////////////////////////////////////////////////////
// IF YOU USE THIS GPL SOURCE CODE TO MAKE YOUR DSM PLUGIN, PLEASE ADD YOUR
// COPYRIGHT TO THIS FILE AND SHORTLY DESCRIBE/EXPLAIN THE MODIFICATIONS
// YOU'VE MADE. THANKS.
//
// IF YOU DON'T USE THIS CODE AS A BASE FOR YOUR PLUGIN, THE HEADER ABOVE AND
// ULTR@VNC COPYRIGHT SHOULDN'T BE FOUND IN YOUR PLUGIN SOURCE CODE.
//


//#include "stdafx.h"
#define _WIN32_WINNT 0x0410     //must be defined for the crypto api
#define _WIN32_WINDOWS 0x0410
#define WINVER 0x0400

#include <stdio.h>
#include <windows.h>
#include <time.h>
#include <tchar.h>

#include <wincrypt.h>       //windows crypto api

#include "REGISTRY.h"
#include "MSRC4Plugin.h"
#include "crypto.h"
#include "utils.h"
#include "version.h"

static const TCHAR * INDEXVAL_LOG = _T("DebugLog");
static const TCHAR * INDEXVAL_KEYFILE = _T("KeyFile");

HINSTANCE hInstance = 0;
PLUGINSTRUCT* pPlugin = NULL;  // struct (or class instance) that handles all Plugin params.

char * sDefaultGenKey = "new_rc4.key";
char* sVariable = "msrc4pluginkey";
#define LOG_FILE  "msrc4.log"

//Salt flags
bool bSaltE = true;	//still need Salt/IV for Decryption
bool bSaltD = true; //still need Salt/IV for Encryption
bool bTransHeader = true;  //consider Salt/IV length in the calculation

int HeaderLen = SALT_SIZE + IV_SIZE; //length of additional header

// Plugin Description
// Please use the following format (with ',' (comma) as separator)
// Name,Version,Date,Author,FileName
// For the version, we recommend the following format: x.y.z
// The other fields (Name, Date, Authir, FileName) are format free (don't use ',' in them, of course)

#ifdef _WITH_REGISTRY
#define PLUGIN_FILE "MSRC4Plugin.dsm"
#define PLUGIN_DESCRIPTION  "MS RC4 Plugin,Sean E. Covel,Mar 12 2005," BUILD_NUMBER ",MSRC4Plugin.dsm"
#else
#define PLUGIN_FILE "MSRC4Plugin_noreg.dsm"
#define PLUGIN_DESCRIPTION  "MS RC4 NoReg Plugin,Sean E. Covel,Mar 12 2005," BUILD_NUMBER ",MSRC4Plugin_NoReg.dsm"
#endif

char getParams[BUFFER_SIZE];

// ----------------------------------------------------------------------
//
// A VNC DSM Plugin MUST export (extern "C" (__cdecl)) all the following
// functions (same names, same signatures)
//
// For return values, the rule is:
//    < 0, 0, and NULL pointer mean Error
//    > 0 and pointer != NULL mean Ok
//
// ----------------------------------------------------------------------
//

// Returns the ID string of the Plugin
//
PLUGIN_API char* Description(void)
{
    //PrintLog((DEST,"Plugin Description. %s",PLUGIN_DESCRIPTION));
    return PLUGIN_DESCRIPTION;
}


//
// Initialize the plugin and all its internals
// Return -1 if error
//

PLUGIN_API int Startup(void)
{
	char output[OUTPUT_BUFFER_SIZE];
    HANDLE      hKeyFile = 0;

#ifdef _WITH_REGISTRY
	char defaultKeyFile[BufSize];
	char defaultGenFile[BufSize];
	char sProgramFiles[KEYFILENAME_SIZE];
	char sLogit[BufSize];

		//get the local version of 'Program Files'
	GetEnvVar(PROGRAMFILES, sProgramFiles, BufSize);

		//add 'UltraVNC' to it.
	if (_snprintf(defaultKeyFile, sizeof(defaultKeyFile),"%s%s%s",sProgramFiles,sDefault,sDefaultKeyName) < 0)
		PrintLog((DEST,"_snprintf failed - defaultKeyFile too small"));
	if (_snprintf(defaultGenFile, sizeof(defaultGenFile),"%s%s%s",sProgramFiles,sDefault,sDefaultGenKey) < 0)
		PrintLog((DEST,"_snprintf failed - defaultGenFile too small"));

    char keyFile[KEYFILENAME_SIZE];

	//load some default values into the registry if the keys don't exist.
    REGISTRY *m_pREGISTRY;

    //HKLM Key
	m_pREGISTRY = new REGISTRY(HKEY_LOCAL_MACHINE, MSRC4_KEY_NAME_SERVER, true);
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYFILE, defaultKeyFile);	//key file
    m_pREGISTRY->ReadItem(sLogit, 2,INDEXVAL_LOG, sLogItDef);							//debuglog
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYGEN, defaultGenFile);	//GenKey
    delete m_pREGISTRY;
    
	//HKCU/Server
    m_pREGISTRY = new REGISTRY(HKEY_CURRENT_USER, MSRC4_KEY_NAME_SERVER, true);
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYFILE, defaultKeyFile);	//key file
    m_pREGISTRY->ReadItem(sLogit, 2,INDEXVAL_LOG, sLogItDef);							//debuglog
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYGEN, defaultGenFile);	//GenKey
    delete m_pREGISTRY;
	
	//HKCU/Viewer
    m_pREGISTRY = new REGISTRY(HKEY_CURRENT_USER, MSRC4_KEY_NAME_VIEWER, true);
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYFILE, defaultKeyFile);	//key file
    m_pREGISTRY->ReadItem(sLogit, 2,INDEXVAL_LOG, sLogItDef);							//debuglog
    m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYGEN, defaultGenFile);	//GenKey
    delete m_pREGISTRY;

	LOGIT = SetLogging(LOG_FILE, sLogit);
#else
	//set Logging based on an environment variable
	LOGIT = SetLogging(LOG_FILE);
#endif

    PrintLog((DEST,"StartUp"));
	//get some important info into the logs
#ifdef _WITH_REGISTRY
    PrintLog((DEST,"REGISTRY %s",PLUGIN_DESCRIPTION));
#else
    PrintLog((DEST,"NOREG %s",PLUGIN_DESCRIPTION));
#endif

    // Init everything
    memset(szExternalKey, 0, sizeof(szExternalKey));
    // Create threads if any

	if (FindKey(PLUGIN_FILE, sDefaultKeyName, sVariable, &hKeyFile, output))
		strcpy(getParams,"NothingNeeded");
	else
		strcpy(getParams,"VNCPasswordNeeded");

    return 1;
}


//
// Stop and Clean up the plugin 
// Return -1 if error
// 
PLUGIN_API int Shutdown(void)
{
    // Terminate Threads if any
    // Cleanup everything
	// Clean up: release handles, close files.
	
    //destroy the keys
    if (hKey) {
		CryptDestroyKey(hKey);
		CryptDestroyKey(hKey2);
    }
	
    if (hExchangeKey) {
		CryptDestroyKey(hExchangeKey);
		CryptDestroyKey(hExchangeKey2);
    }
	
	//We抮e finished using the CSP handle, so we must release it.
	if (hProvider) {
		CryptReleaseContext(hProvider, 0);
		CryptReleaseContext(hProvider2, 0);
	}

	PrintLog((DEST,"Shutting Down.\r\n"));
	
	return 1;
}


//
// Stop and Clean up the plugin 
// Return -1 if error
// 
PLUGIN_API int Reset(void)
{
int rc = 0;
	char output[OUTPUT_BUFFER_SIZE];
    HANDLE      hKeyFile = 0;

	//reset the salt flag so the password gets re-salted for the new session
	bSaltD = true;
	bSaltE = true;

	rc = ResetCrypto(hKey);
	rc = ResetCrypto(hKey2);

	PrintLog((DEST,"Reset Plugin."));

	if (FindKey(PLUGIN_FILE, sDefaultKeyName, sVariable, &hKeyFile, output))
		strcpy(getParams,"NothingNeeded");
	else
		strcpy(getParams,"VNCPasswordNeeded");

	CloseHandle(hKeyFile);


return 1;
}


//
// Set the plugin params (Key or password )
// If several params are needed, they can be transmitted separated with ',' (comma)
// then translated if necessary. They also can be taken from the internal Plugin config
// 
// WARNING: The plugin is responsible for implementing necessary GUI or File/Registry reading
// to acquire additionnal parameters and to ensure their persistence if necessary.
// Same thing for events/errors logging.
// 
// This function can be called 2 times, both from vncviewer and WinVNC:
// 
// 1.If the user clicks on the Plugin's "config" button in vncviewer and WinVNC dialog boxes
//   In this case this function is called with hVNC != 0 (CASE 1)
//
//   -> szParams is a string formatted as follow: "Part1,Part2"
//   Part1 = "NoPassword"
//   Part2 = type of application that has loaded the plugin
//     "viewer"     : for vncviewer
//     "server-svc" : for WinVNC run as a service
//     "server-app" : for WINVNC run as an application
//
//   -> The Plugin Config dialog box is displayed if any.
// 
// 2.When then plugin is Inited from VNC viewer or Server, right after Startup() call (CASE 2);
//   In this case, this function is called with hVNC = 0 and
//   szParams is a string formatted as follows: "part1,Part2"
//   Part1 = The VNC password, if required by the GetParams() function return value
//   Part2 = type of application that has loaded the plugin
//      "viewer"     : for vncviewer
//      "server-svc" : for WinVNC run as a service
//      "server-app" : for WINVNC run as an application
//   (this info can be used for application/environnement dependent
//    operations (config saving...))
//   
// 
PLUGIN_API int SetParams(HWND hVNC, char* szParams)
{
#ifdef _WITH_REGISTRY
    REGISTRY *m_pREGISTRY;
	int rc = 0;
#else
//	char sEnvVar[BufSize];
	DWORD rc = 0;
#endif

	char sLogit[BufSize];
	char output[OUTPUT_BUFFER_SIZE];
    HANDLE      hKeyFile = 0;
	//BYTE *		pbBuff;

	//BYTE		*pbBuffer = new BYTE[OUT_BUFFER_SIZE];
    //char        keyFile[KEYFILENAME_SIZE];
    PLUGINSTRUCT strPlugin;
	long iWinVer=0;
	long iCryptVer=0;
//	char *stop;
	char		sProgramFiles[KEYFILENAME_SIZE];
	char  CSPName[70];

	strPlugin.szHKLMServer[0] = '\0';
	strPlugin.szHKCUViewer[0] = '\0';
	strPlugin.szHKCUServer[0] = '\0';
	strPlugin.szHKCUGenKey[0] = '\0';

	//setup logging
#ifdef _WITH_REGISTRY
    m_pREGISTRY = new REGISTRY(HKEY_CURRENT_USER, MSRC4_KEY_NAME_VIEWER, false);
    m_pREGISTRY->ReadItem(sLogit, 2,INDEXVAL_LOG, sLogItDef);
    delete m_pREGISTRY;
	LOGIT = SetLogging(LOG_FILE, sLogit);
#else
	LOGIT = SetLogging(LOG_FILE);
#endif

//LOGIT = strtol( sLogit, &stop, 10 );

PrintLog((DEST,"Set Params"));

	//get some important info into the logs
#ifdef _WITH_REGISTRY
    PrintLog((DEST,"REGISTRY %s",PLUGIN_DESCRIPTION));
#else
    PrintLog((DEST,"NOREG %s",PLUGIN_DESCRIPTION));
#endif

	//figure out what OS, provider, CSP, yada yada, we are running on currently
	InitVars(CSPName, &iWinVer, &iCryptVer, &maxKeyLen);

	PrintLog((DEST,"Crypto Version = %d",iCryptVer));
	PrintLog((DEST,"OS is '%s'",WindowsName[iWinVer]));
	PrintLog((DEST,"Using provider '%s'",CSPName));
	PrintLog((DEST,"Max Key Length %d",(DWORD)(HIWORD(maxKeyLen))));

    // Get the environnement (szLoaderType) value that is always sent from 
    // VNC viewer or server
    MyStrToken(szLoaderType, szParams, 2, ',');

	GetEnvVar(PROGRAMFILES, sProgramFiles, BufSize);
	if (strlen(sProgramFiles)== 0)
		PrintLog((DEST,"ProgramFiles not found"));
    

// ***CASE 1 - CONFIG***
    // If hVNC != 0, display for instance the Plugin Config Dialog box 
    if (hVNC)
    {
        PrintLog((DEST,"SetParams. - Config."));
        
#ifdef _WITH_REGISTRY

		char defaultKeyFile[BufSize];
		char defaultGenFile[BufSize];

			//add 'UltraVNC' to it.
		if (_snprintf(defaultKeyFile, sizeof(defaultKeyFile),"%s%s%s",sProgramFiles,sDefault,sDefaultKeyName) < 0)
			PrintLog((DEST,"_snprintf failed - defaultKeyFile too small"));
		if (_snprintf(defaultGenFile, sizeof(defaultGenFile),"%s%s%s",sProgramFiles,sDefault,sDefaultGenKey) < 0)
			PrintLog((DEST,"_snprintf failed - defaultGenFile too small"));

		//load some default values into the registry if the keys don't exist.
		REGISTRY *m_pREGISTRY;

		//HKLM Key
		m_pREGISTRY = new REGISTRY(HKEY_LOCAL_MACHINE, MSRC4_KEY_NAME_SERVER, true);
		m_pREGISTRY->ReadItem(keyFile, KEYFILENAME_SIZE,INDEXVAL_KEYFILE, defaultKeyFile);	//key file
        strcpy(strPlugin.szHKLMServer,keyFile);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区电影| 一本一道综合狠狠老| 午夜精品久久久久久久久| 中文字幕一区二区三区蜜月| 久久综合色一综合色88| 337p日本欧洲亚洲大胆色噜噜| 91精品国产综合久久精品app | 国产欧美一区二区精品性色超碰| 欧美videofree性高清杂交| 欧美tickling网站挠脚心| 日韩欧美国产三级| 欧美精品一区二区三区一线天视频 | 婷婷丁香激情综合| 久久国产精品第一页| 国产综合色产在线精品| 国产在线视频精品一区| 日本欧美大码aⅴ在线播放| 肉肉av福利一精品导航| 蜜桃av一区二区在线观看| 久久99日本精品| 国产成人夜色高潮福利影视| 成人黄色av电影| 色综合一个色综合亚洲| 欧美日韩精品一区二区三区| 日韩午夜在线播放| 欧美激情艳妇裸体舞| 亚洲综合一区二区三区| 美腿丝袜亚洲三区| 成人av免费在线| 欧美在线视频不卡| 欧美va亚洲va香蕉在线| 国产精品久久久久久福利一牛影视| 一区二区三区国产豹纹内裤在线| 三级久久三级久久| 国产成人午夜精品5599| 色噜噜狠狠成人中文综合| 欧美成人性福生活免费看| 亚洲天天做日日做天天谢日日欢| 日韩制服丝袜av| 成人黄色777网| 欧美电视剧在线观看完整版| 中文字幕在线一区二区三区| 美女视频黄免费的久久| av色综合久久天堂av综合| 日韩午夜激情免费电影| 亚洲人成网站色在线观看| 日韩精品乱码免费| 色综合色综合色综合| 精品1区2区在线观看| 亚洲国产成人av| 国产成人亚洲精品狼色在线 | 欧洲色大大久久| 2023国产精华国产精品| 亚洲国产你懂的| 99精品热视频| 国产三级精品三级在线专区| 免费av网站大全久久| 色999日韩国产欧美一区二区| 精品国产不卡一区二区三区| 视频精品一区二区| 欧美午夜电影网| 亚洲男人的天堂在线观看| 成人在线综合网| 精品99一区二区三区| 免费成人美女在线观看| 3d动漫精品啪啪1区2区免费| 亚洲r级在线视频| 欧洲生活片亚洲生活在线观看| 亚洲天堂成人网| 不卡免费追剧大全电视剧网站| 国产日韩欧美激情| 国产成人综合网站| 国产日韩av一区二区| 高清不卡在线观看| 国产精品五月天| 成人午夜视频在线| 亚洲国产精品av| 不卡免费追剧大全电视剧网站| 国产精品理论片在线观看| 成人免费视频免费观看| 国产精品久久久久久久久久久免费看| 国内精品伊人久久久久影院对白| 欧美不卡视频一区| 蜜芽一区二区三区| 精品卡一卡二卡三卡四在线| 国产福利电影一区二区三区| 国产欧美日韩精品一区| 波多野洁衣一区| 亚洲欧美一区二区三区国产精品| 91黄色免费版| 免费国产亚洲视频| 国产日韩欧美电影| 97se狠狠狠综合亚洲狠狠| 亚洲美女在线一区| 欧美高清你懂得| 久草中文综合在线| 国产肉丝袜一区二区| 91亚洲精品久久久蜜桃网站| 一区2区3区在线看| 91精品国产一区二区三区香蕉| 激情丁香综合五月| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 在线观看日韩av先锋影音电影院| 亚洲视频图片小说| 91精品国产综合久久蜜臀| 国产白丝精品91爽爽久久| 亚洲激情图片一区| 欧美zozo另类异族| 91免费版pro下载短视频| 秋霞av亚洲一区二区三| 中文字幕乱码日本亚洲一区二区 | 欧美日韩一区高清| 蜜臀久久久久久久| 中文字幕第一区二区| 欧美日韩性生活| 成人综合在线视频| 天天色综合成人网| 中文字幕人成不卡一区| 欧美老肥妇做.爰bbww视频| 国产91精品露脸国语对白| 午夜一区二区三区在线观看| 欧美国产97人人爽人人喊| 欧美日韩成人综合| 99国产精品久久| 狠狠网亚洲精品| 午夜精品一区二区三区免费视频| 国产喷白浆一区二区三区| 欧美一卡二卡在线观看| 欧美中文字幕久久| av一二三不卡影片| 精彩视频一区二区| 免费一级欧美片在线观看| 一区二区三区小说| 国产精品丝袜在线| 精品久久久网站| 欧美另类变人与禽xxxxx| 在线视频你懂得一区| 成人18视频日本| 国产91精品一区二区麻豆亚洲| 乱中年女人伦av一区二区| 偷拍日韩校园综合在线| 亚洲美女屁股眼交3| 国产精品久久久久久久久久久免费看 | 久久久www成人免费无遮挡大片| 欧美精品视频www在线观看| av电影天堂一区二区在线| 成人小视频免费在线观看| 国产一区在线观看视频| 久热成人在线视频| 美女在线视频一区| 日韩av午夜在线观看| 午夜精品福利一区二区蜜股av| 一区二区在线观看视频| 亚洲免费视频中文字幕| 中文字幕一区二区三区蜜月| 国产精品久久久久aaaa| 国产精品萝li| 亚洲人成网站影音先锋播放| 亚洲黄色片在线观看| 一区二区视频在线看| 亚洲成人一区在线| 日韩成人免费电影| 精品一区二区影视| 国产**成人网毛片九色| caoporm超碰国产精品| 色妞www精品视频| 在线视频一区二区三区| 91麻豆精品国产自产在线观看一区| 精品视频999| 欧美一级久久久| 国产亚洲精品中文字幕| 亚洲欧美综合在线精品| 亚洲综合久久久| 经典三级视频一区| eeuss鲁一区二区三区| 欧美日韩你懂得| 久久亚洲精精品中文字幕早川悠里| 国产欧美日韩在线| 一级做a爱片久久| 美女免费视频一区二区| 国产精品白丝jk黑袜喷水| 91啦中文在线观看| 欧美一区二区三区在线| 久久精品在线免费观看| 亚洲一区二区视频在线观看| 麻豆91在线播放| 成人av电影免费观看| 69久久99精品久久久久婷婷| 久久久噜噜噜久久中文字幕色伊伊 | 久久福利视频一区二区| 成人丝袜视频网| 91精品欧美一区二区三区综合在| 国产欧美一区二区精品婷婷 | 蜜臀av一区二区| 成人在线视频一区二区| 欧美一区日韩一区| 中文字幕在线不卡一区| 久久99精品一区二区三区三区| 色一区在线观看| 久久精品亚洲麻豆av一区二区 |