//确定函数
VOID CDlgProxyConfig::OnOK()
{
	//获取信息
	if (GetInformation()==false) return;

	__super::OnOK();
}
Exemple #2
0
void CEditDOF::OnOK()
{
	if(	m_strFocalDistance.IsEmpty() || m_strFocalRange.IsEmpty() )
			MessageBox( "Please enter the valid data for all the required fields", "Vanda Engine Error", MB_OK | MB_ICONERROR );
	else
	{
		GetInformation();
		g_dofProperties.m_dofFocalDistance = m_focalDistance;
		g_dofProperties.m_dofFocalRange = m_focalRange;

		CInt checkState;
		checkState = m_checkBoxEnableDOF.GetCheck();
		if( checkState == BST_CHECKED )
			g_dofProperties.m_enable = CTrue;
		else
			g_dofProperties.m_enable = CFalse;

		checkState = m_checkBoxDebug.GetCheck();
		if( checkState == BST_CHECKED )
			g_dofProperties.m_debug = CTrue;
		else
			g_dofProperties.m_debug = CFalse;

		CDialog::OnOK();
	}
}
	XnVector3D OpenNIMotorController::GetAccelerometer() const
	{
		int iA;
		MOTOR_STATUS eStatus;
		XnVector3D vVec;
		GetInformation( iA, eStatus, vVec );
		return vVec;
	}
	MOTOR_STATUS OpenNIMotorController::GetMotorStatus() const
	{
		int iA;
		MOTOR_STATUS eStatus;
		XnVector3D vVec;
		GetInformation( iA, eStatus, vVec );
		return eStatus;
	}
Exemple #5
0
TEST_F(ArrayChangeInformationFilter_test, DoSetUnit)
{
    inDs->GetPointData()->SetScalars(inAttr);

    filter->EnableSetUnitOn();
    filter->SetArrayUnit("someUnit");
    filter->Update();

    auto outAttr = getScalars();

    ASSERT_STREQ("someUnit", outAttr->GetInformation()->Get(vtkDataArray::UNITS_LABEL()));
}
wxString CppCheckSettings::GetOptions() const
{
	wxString options;
	if (GetStyle()) {
		options << wxT(" --enable=style ");
	}
	if (GetPerformance()) {
		options << wxT(" --enable=performance ");
	}
	if (GetPortability()) {
		options << wxT(" --enable=portability ");
	}
	if (GetUnusedFunctions()) {
		options << wxT(" --enable=unusedFunction ");
	}
	if (GetMissingIncludes()) {
		options << wxT(" --enable=missingInclude ");
	}
	if (GetInformation()) {
		options << wxT(" --enable=information ");
	}
	if (GetPosixStandards()) {
		options << wxT(" --std=posix ");
	}
	if (GetC99Standards()) {
		options << wxT(" --std=c99 ");
	}
	if (GetCpp11Standards()) {
		options << wxT(" --std=c++11 ");
	}
	if (GetForce()) {
		options << wxT("--force ");
	}

	// Now add any ticked suppressedwarnings
	std::map<wxString, wxString>::const_iterator iter = m_SuppressedWarnings1.begin();
	for (; iter != m_SuppressedWarnings1.end(); ++iter) {
		options << wxT(" --suppress=") << (*iter).first;
	}

	options << wxT(" --template gcc ");
	return options;
}
Exemple #7
0
void CEditBloom::OnOK()
{
	if(	m_strBloomIntensity.IsEmpty() )
			MessageBox( "Please enter the valid data for all the required fields", "Vanda Engine Error", MB_OK | MB_ICONERROR );
	else
	{
		GetInformation();
		g_bloomProperties.m_bloomIntensity = m_bloomIntensity;

		CInt checkState;
		checkState = m_checkBoxEnableBloom.GetCheck();
		if( checkState == BST_CHECKED )
			g_bloomProperties.m_enable = CTrue;
		else
			g_bloomProperties.m_enable = CFalse;

		for( CInt i = 0; i < 3; i++ )
			g_bloomProperties.m_bloomColor[i] = m_fBloomColor[i];

		CDialog::OnOK();
	}
}
Exemple #8
0
void CEditShadow::OnOK()
{
	if( g_vandaDemo )
	{
		MessageBox( "This feature is not available in RTI demo Edition", "Vanda Engine Error", MB_OK | MB_ICONINFORMATION );
		return;
	}

	// TODO: Add your specialized code here and/or call the base class
	if(	m_strSplitWeight.IsEmpty() || m_strNearClipPlane.IsEmpty() || m_strFarClipPlane.IsEmpty())
			MessageBox( "Please enter the valid data for all the required fields", "Vanda Engine Error", MB_OK | MB_ICONERROR );
	else
	{
		GetInformation();
		g_shadowProperties.m_shadowSplitWeight = m_splitWeight;
		g_shadowProperties.m_shadowFarClipPlane = m_farClipPlane;
		g_shadowProperties.m_shadowNearClipPlane = m_nearClipPlane;
		g_shadowProperties.m_shadowType = (CShadowType)m_shadowType;
		g_shadowProperties.m_shadowSplits = (CShadowSplits)m_shadowSplits;
		g_shadowProperties.m_shadowResolution = (CShadowResolution)m_shadowResolution;
		g_shadowProperties.m_intensity = m_intensity;

		switch( g_shadowProperties.m_shadowResolution )
		{
		case eSHADOW_1024:
			g_dynamicShadowMap->depth_size = 1024;
				break;
		case eSHADOW_2048:
			g_dynamicShadowMap->depth_size = 2048;
			break;
		case eSHADOW_4096:
			g_dynamicShadowMap->depth_size = 4096;
			break;
		default:
			break;
		}
		g_dynamicShadowMap->RegenerateDepthTex( g_dynamicShadowMap->depth_size );

		switch( g_shadowProperties.m_shadowSplits )
		{
		case eSHADOW_1_SPLIT:
			g_dynamicShadowMap->cur_num_splits = 1;
			break;
		case eSHADOW_2_SPLITS:
			g_dynamicShadowMap->cur_num_splits = 2;
			break;
		case eSHADOW_3_SPLITS:
			g_dynamicShadowMap->cur_num_splits = 3;
			break;
		case eSHADOW_4_SPLITS:
			g_dynamicShadowMap->cur_num_splits = 4;
			break;
		default:
			break;
		}

		g_dynamicShadowMap->split_weight = g_shadowProperties.m_shadowSplitWeight;
		Cpy( g_shadowProperties.m_directionalLightName,(LPCSTR)m_currentLightName);

		CInt checkState;
		checkState = m_checkBoxEnableShadow.GetCheck();
		if( checkState == BST_CHECKED && !g_vandaDemo)
			g_shadowProperties.m_enable = CTrue;
		else
			g_shadowProperties.m_enable = CFalse;

		CDialog::OnOK();
	}
}
 void Analyze(ControlCenter* Data)
 {
     while(!Library.empty())
     {
         Information Tem=GetInformation();
         bool Reflesh=false;
         if(Tem.Target==RegeditID)
         {
             switch(Tem.Category1)
             {
                 case VIEWLOCATION:
                     Location.X=Tem.Data1.f;
                     Location.Y=Tem.Data2.f;
                     Location.Z=Tem.Data3.f;
                     Reflesh=true;
                     break;
                 case VIEWANGLE:
                     AngleUp=Tem.Data1;
                     AngleRight=Tem.Data2;
                     Front.Set(cos(AngleUp)*sin(AngleRight),sin(AngleUp),-cos(AngleUp)*cos(AngleRight));
                     Up.Set(-sin(AngleUp)*sin(AngleRight),cos(AngleUp),sin(AngleUp)*cos(AngleRight));
                     Reflesh=true;
                     break;
             }
             if(Reflesh)
             {
                 Information Tr=Tem;
                 Tr.Target=Tem.Resource;
                 Tr.Resource=Tem.Target;
                 Out(Tr);
             }
         }
         if(OwnKey)
         {
             if(Tem.Target==INFALL&&Tem.Category1==INFEVENT)
             {
                 if(Tem.Category2==INFKEY)
                 {
                     if(Tem.Category3==INFKEYDOWN)
                     {
                         if(Key.count(Tem.Data1)>0)
                         {
                             Key[Tem.Data1]=true;
                         }
                     }else if(Tem.Category3==INFKEYUP)
                     {
                         if(Key.count(Tem.Data1)>0)
                         {
                             Key[Tem.Data1]=false;
                         }
                     }
                 }
             }
         }
     }
     if(Key['w'])
     {
         Location=Location+Front.Uint(MOVESPEED);
     }
     if(Key['s'])
     {
         Location=Location-Front.Uint(MOVESPEED);
     }
     if(Key['a'])
     {
         AngleRight-=MOVESPEEDANGLE;
         Front.Set(cos(AngleUp)*sin(AngleRight),sin(AngleUp),-cos(AngleUp)*cos(AngleRight));
     }
     if(Key['d'])
     {
         AngleRight+=MOVESPEEDANGLE;
         Front.Set(cos(AngleUp)*sin(AngleRight),sin(AngleUp),-cos(AngleUp)*cos(AngleRight));
     }
     if(Key['q'])
     {
         Location=Location+(Up&Front).Uint(MOVESPEED);
     }
     if(Key['e'])
     {
         Location=Location-(Up&Front).Uint(MOVESPEED);
     }
     if(Key['r'])
     {
         Location=Location+Up.Uint(MOVESPEED);
     }
     if(Key['f'])
     {
         Location=Location-Up.Uint(MOVESPEED);
     }
 }
wxString CppCheckSettings::GetOptions() const
{
    wxString options;
    if(GetStyle()) {
        options << wxT(" --enable=style ");
    }
    if(GetPerformance()) {
        options << wxT(" --enable=performance ");
    }
    if(GetPortability()) {
        options << wxT(" --enable=portability ");
    }
    if(GetUnusedFunctions()) {
        options << wxT(" --enable=unusedFunction ");
    }
    if(GetMissingIncludes()) {
        options << wxT(" --enable=missingInclude ");
    }
    if(GetInformation()) {
        options << wxT(" --enable=information ");
    }
    if(GetPosixStandards()) {
        options << wxT(" --std=posix ");
    }
    if(GetC99Standards()) {
        options << wxT(" --std=c99 ");
    }
    if(GetCpp11Standards()) {
        options << wxT(" --std=c++11 ");
    }
    if(GetForce()) {
        options << wxT("--force ");
    }
    if(GetJobs() > 1) {
        options << wxT("-j") << GetJobs() << " ";
    }
    if(GetCheckConfig()) {
        options << wxT("--check-config "); // Though this turns off other checks, afaict it does not harm to emit them
    }

    // Now add any ticked suppressedwarnings
    std::map<wxString, wxString>::const_iterator iter = m_SuppressedWarnings1.begin();
    for(; iter != m_SuppressedWarnings1.end(); ++iter) {
        options << wxT(" --suppress=") << (*iter).first << " ";
    }

    // IncludeDirs
    for(size_t n = 0; n < m_IncludeDirs.GetCount(); ++n) {
        wxString item = m_IncludeDirs.Item(n);
        item.Trim().Trim(false);
        if(!item.empty()) {
            options << " -I" << item << " ";
        }
    }
    if(m_SuppressSystemIncludes) {
        options << wxT(" --suppress=") << "missingIncludeSystem ";
    }

    // (Un)Definitions
    for(size_t n = 0; n < m_definitions.GetCount(); ++n) {
        wxString item = m_definitions.Item(n);
        item.Trim().Trim(false);
        if(!item.empty()) {
            options << " -D" << item << " ";
        }
    }
    for(size_t n = 0; n < m_undefines.GetCount(); ++n) {
        wxString item = m_undefines.Item(n);
        item.Trim().Trim(false);
        if(!item.empty()) {
            options << " -U" << item << " ";
        }
    }

    options << wxT(" --template gcc ");
    return options;
}
PCONFIG LoadConfigurationFiles(int argc, HTTPCHAR *argv[]) {
	if (argc < 2) {
		usage();
		return (NULL);
	}

	PCONFIG config = new CONFIG;

	// First we lock for threads
	for (int i = 1; i < argc; i++) {
		if (argv[i][0] == _T('-')) {
			if (argv[i][1] == _T('T')) {
				config->ThreadNumber = _tstoi(argv[++i]);

				break;
			}
		}
	}
	config->HTTPHandle =
		(HTTPHANDLE*)malloc(config->ThreadNumber*sizeof(HTTPHANDLE));
	config->api = (HTTPAPI * *)malloc(config->ThreadNumber*sizeof(void*));
	for (int i = 0; i < config->ThreadNumber; i++) {
		config->api[i] = new HTTPAPI;
	}

	for (int i = 1; i < argc; i++) {
		if (argv[i][0] == _T('-')) {
			switch (argv[i][1]) {
			case _T('T'):
				i++;
				break;
			case _T('i'):
				if (!config->getInformation) {
					config->getInformation = 1;
				}
				else {
					DIE();
				}
				break;
			case _T('g'):
				if (argc > i + 1) {
					HTTPCHAR proxyhost[512];
					HTTPCHAR proxyport[10];
					if (_stscanf(argv[++i], _T("http://%[^:]:%s"), proxyhost,
						proxyport) == 2) {
						_tprintf(_T
							("[+] Stablishing Proxy Host Configuration: %s\n"),
							proxyhost);
						for (int i = 0; i < config->ThreadNumber; i++)
							config->api[i]->SetHTTPConfig(GLOBAL_HTTP_CONFIG,
							ConfigProxyHost, proxyhost);
						_tprintf(_T
							("[+] Stablishing Proxy Port Configuration: %s\n"),
							proxyport);
						for (int i = 0; i < config->ThreadNumber; i++)
							config->api[i]->SetHTTPConfig(GLOBAL_HTTP_CONFIG,
							ConfigProxyPort, proxyport);
					}
					else {

						_tprintf(_T(" [-] Invalid proxy parameter %s\n"),
							argv[i]);
						_tprintf(_T(" [-] Should be http://host:port\n"));
						DIE();
					}
				}
				else {
					DIE();
				}
				break;
			case _T('u'):
				if (!config->resource->port) {
					ParseUrl(argv[++i], config->resource);
				}
				else {
					DIE();
				}
				break;
			case _T('c'):
				if (argc > i + 1) {
					_tcscpy(config->CustomCookie, argv[++i]);
				}
				else {
					DIE();
				}
				break;
			case _T('C'):
				for (int threads = 0; threads < config->ThreadNumber; threads++)
					config->api[threads]->SetHTTPConfig(GLOBAL_HTTP_CONFIG,
					ConfigCookieHandling, 1);
				break;
			case _T('r'):
				config->ResumeIndex = _tstoi(argv[i + 1]);
				i++;
				break;
			case _T('R'):
				for (int threads = 0; threads < config->ThreadNumber; threads++)
					config->api[threads]->SetHTTPConfig(GLOBAL_HTTP_CONFIG,
					ConfigAutoredirect, 1);
				break;
			case _T('d'):
				if (argc > i + 1) {
					_tcscpy(config->Domain, argv[++i]);
				}
				else {
					DIE();
				}
				break;
			case 's':
				config->SingleBruteforceAttack = 1;
				break;
			case _T('m'):
				if (argc > i + 1) {
					config->MaxAttempts = _tstoi(argv[++i]);
				}
				else {
					DIE();
				}
				break;
			case _T('M'):
				if (argc > i + 1) {
					_tcscpy(config->resource->HTTPMethod, argv[++i]);
				}
				else {
					DIE();
				}
				break;
			case _T('w'):
				if (argc > i + 1) {
					config->WaitTime = _tstoi(argv[++i]) * 1000 + 150;
					// add additional 150ms
				}
				else {
					usage();
					return (0);
				}
				break;
			case _T('v'):
				if (argc > i + 1) {
					if ((config->api[0]->GetHTTPConfig(GLOBAL_HTTP_CONFIG,
						ConfigProxyHost)) && (!config->resource->SSLRequest)) {
						_tprintf(_T
							("[-] Unable to set a virtual host header with HTTP proxy (parametr -v ignored)\r\n")
							);
						i++;
					}
					else {
						config->resource->VirtualHost = _tcsdup(argv[++i]);
					}
				}
				else {
					DIE();
				}
				break;
			case _T('l'):
				if (argc > i + 1) {
					HTTPCHAR *trozo = _tcstok(argv[++i], _T(","));
					while (trozo != NULL) {
						AddUser(trozo, config);
						trozo = _tcstok(NULL, _T(","));
					}
				}
				else {
					DIE();
				}
				break;
			case _T('H'):
				if (argc > i + 1) {
					HTTPCHAR *trozo = _tcstok(argv[++i], _T(","));
					while (trozo != NULL) {
						_tcscat(config->AdditionalHeaders, trozo);
						_tcscat(config->AdditionalHeaders, _T("\r\n"));
						trozo = _tcstok(NULL, _T(","));
					}
				}
				else {
					DIE();
				}
				break;
			case _T('L'):
				if (argc > i + 1) {
					if ((strlen(argv[i]) == 3) && (argv[i][2] == 'm')) {
						LoadConfig(argv[i + 1], argv[i + 1], config);
						config->SingleBruteforceAttack = 1;
						i++;
					}
					else {
						LoadConfig(argv[++i], NULL, config);
					}

				}
				else {
					DIE();
				}
				break;
			case _T('p'):
				if (argc > i + 1) {
					HTTPCHAR *trozo = _tcstok(argv[++i], _T(","));
					while (trozo != NULL) {
						AddPassword(trozo, config);
						trozo = _tcstok(NULL, _T(","));
					}
				}
				else {
					DIE();
				}
				break;
			case _T('P'):
				if (argc > i + 1) {
					LoadConfig(NULL, argv[++i], config);
				}
				else {
					DIE();
				}
				break;
			case _T('S'):
				config->StopAfterPasswordFound = 0;
				break;
			case _T('f'):
				config->FakeSourceAddress = 1;
				break;
			default:
				_tprintf(_T("[-] Invalid parameter %s\r\n\r\n"), argv[i]);
				DIE();
				break;
			}
		}
	}
	if (!config->resource->host) {
		DIE();
	}

	for (int threads = 0; threads < config->ThreadNumber; threads++) {
		config->HTTPHandle[threads] =
			config->api[threads]->InitHTTPConnectionHandle
			(config->resource->host, config->resource->port,
			config->resource->SSLRequest);
		if (config->HTTPHandle[threads] == INVALID_HHTPHANDLE_VALUE) {
			_tprintf(_T("[-] ERROR - Unable to resolve the remote Host\n"));
			delete config;
			return (NULL);
		}
		if (config->CustomCookie[0]) {
			config->api[threads]->SetHTTPConfig(config->HTTPHandle[threads],
				ConfigCookie, config->CustomCookie);
		}
		if (config->resource->VirtualHost) {
			config->api[threads]->SetHTTPConfig(config->HTTPHandle[threads],
				ConfigHTTPHost, config->resource->VirtualHost);
		}
	}

	int ret = GetInformation(config->api[0], config->HTTPHandle[0],
		config->resource->host, config->resource->port, config->resource->path,
		config->resource->SSLRequest, config->resource->HTTPMethod,
		config->AdditionalHeaders);
	if ((!ret) || (config->getInformation)) {
		delete config;
		return (NULL);
	}

	if ((ret & NTLM_AUTH) && (config->WaitTime == 0)) {

		_tprintf(_T("\r\n"));
		_tprintf(_T
			("[-] Warning. The remote host supports NTLM auth. No lock policy was selected\r\n")
			);
		_tprintf(_T
			("[-] Warning. Remote computer or domain accounts can be locked\r\n"
			));
		_tprintf(_T
			("[-] Warning. Press any key to continue at your own risk\r\n"));
		_tprintf(_T
			("[-] Warning. Or cancel the bruteforce attack with CTRL+C (recommended -m and -w flags)\r\n")
			);
		getchar();
	}

	if (config->credential.nLogins == 0) {
		LoadConfig(_T("users.txt"), NULL, config);
	}

	if (config->credential.nPasswords == 0) {
		LoadConfig(NULL, _T("pass.txt"), config);
	}

	_tprintf(_T("[+] Loaded user list: %i users\r\n"),
		config->credential.nLogins);
	_tprintf(_T("[+] Loaded pass list: %i passwords\r\n\r\n"),
		config->credential.nPasswords);

	if (config->credential.nLogins == 0) {
		_tprintf(_T
			("[-] Unable to perform attack without usernames. Use -L or -l flag\r\n")
			);
		delete config;
		return (NULL);
	}
	if (config->credential.nPasswords == 0) {
		_tprintf(_T
			("[-] Unable to perform attack without passwords. Use -L or -l flag\r\n")
			);
		delete config;
		return (NULL);
	}
	return (config);
}