Click here to Skip to main content
13,596,321 members
Click here to Skip to main content

Stats

282.3K views
77.7K downloads
224 bookmarked
Posted 30 Dec 2005
Licenced CPOL

Form Designer

, 1 Aug 2009
Component for adding scriptable forms capabilities to an application.
MFCDemo.exe
CSDemo
App.ico
Bmp
ABottom.bmp
About.bmp
ALeft.bmp
ARight.bmp
ATop.bmp
AX.bmp
BringFront.bmp
Button.bmp
Center.bmp
Check.bmp
Combo.bmp
Copy.bmp
Cut.bmp
Delete.bmp
Down.bmp
Edit.bmp
Frame.bmp
Grid.bmp
GridSettings.bmp
HCenter.bmp
HScroll.bmp
HSL.bmp
HSpace.bmp
HSS.bmp
Left.bmp
List.bmp
New.bmp
Open.bmp
Paste.bmp
Picture.bmp
Preview.bmp
Progress.bmp
Props.bmp
Radio.bmp
Rectangle.bmp
Redo.bmp
Right.bmp
Save.bmp
SelAll.bmp
SelNone.bmp
SendBack.bmp
SL.bmp
Slider.bmp
Spin.bmp
SS.bmp
Tab.bmp
Text.bmp
Undo.bmp
Up.bmp
Validate.bmp
VCenter.bmp
VScroll.bmp
VSL.bmp
VSpace.bmp
VSS.bmp
Wand.bmp
CSDemo.suo
DaeDoe.bmp
MFCDemo
MFCDemo.dsp
MFCDemo.odl
MFCDemo.reg
res
DaeDoe.bmp
MFCDemo.ico
MFCDemoDoc.ico
Toolbar1.bmp
Toolbar2.bmp
Toolbar3.bmp
Wand.bmp
VBDemo
Bmp
ABottom.bmp
About.bmp
ALeft.bmp
ARight.bmp
ATop.bmp
AX.bmp
BringFront.bmp
Button.bmp
Center.bmp
Check.bmp
Combo.bmp
Copy.bmp
Cut.bmp
Delete.bmp
Down.bmp
Edit.bmp
Frame.bmp
Grid.bmp
GridSettings.bmp
HCenter.bmp
HScroll.bmp
HSL.bmp
HSpace.bmp
HSS.bmp
Left.bmp
List.bmp
New.bmp
Open.bmp
Paste.bmp
Picture.bmp
Preview.bmp
Progress.bmp
Props.bmp
Radio.bmp
Rectangle.bmp
Redo.bmp
Right.bmp
Save.bmp
SelAll.bmp
SelNone.bmp
SendBack.bmp
SL.bmp
Slider.bmp
Spin.bmp
SS.bmp
Tab.bmp
Text.bmp
Undo.bmp
Up.bmp
Validate.bmp
VCenter.bmp
VScroll.bmp
VSL.bmp
VSpace.bmp
VSS.bmp
Wand.bmp
DaeDoe.bmp
VBDemo.vbp
DDForms.chm
DDForms
Archive
FormEditorItems.rgs
vssver.scc
Constants.scr
DaeDoe.bmp
DDForms.def
DDForms.vcproj
DDForms.vcproj.vspscc
EventSinkPassThrough.rgs
FormEditor.bmp
FormEditor.rgs
FormEditorItemCollection.rgs
FormEditorItemDetails.rgs
FormViewer.bmp
FormViewer.rgs
FormViewerItemCollection.rgs
FormViewerItemDetails.rgs
mssccprj.scc
PropPageExtended.rgs
PropPageFormEditor.rgs
PropPageFormViewer.rgs
PropPageSimpleScriptEditor.rgs
SimpleScriptEditor.bmp
SimpleScriptEditor.rgs
vssver.scc
DDFormsTools
CodeMaxDriver
CodeMaxDriver.rgs
CodeMaxDriver.vcproj
CodeMaxDriver.vcproj.vspscc
CodeMaxDriverps.def
CodeMaxDriverPS.vcproj
CodeMaxDriverPS.vcproj.vspscc
mssccprj.scc
vssver.scc
CodeSenseDriver
CodeSenseDriver.rgs
CodeSenseDriver.vcproj
CodeSenseDriver.vcproj.vspscc
CodeSenseDriverps.def
CodeSenseDriverPS.vcproj
CodeSenseDriverPS.vcproj.vspscc
mssccprj.scc
vssver.scc
DDPropPageAll
DDPropPageAll.def
DDPropPageAll.vcproj
DDPropPageAll.vcproj.vspscc
mssccprj.scc
PropPageAll.rgs
vssver.scc
DDUnlock
DDUnlock.vcproj
DDUnlock.vcproj.vspscc
mssccprj.scc
vssver.scc
DDControlPack
DDButton.bmp
DDCheckBox.bmp
DDComboBox.bmp
DDControlPack.rgs
DDControlPack.vcproj
DDControlPack.vcproj.vspscc
DDHorzScrollBar.bmp
DDLabel.bmp
DDListBox.bmp
DDPicture.bmp
DDRadioButton.bmp
DDTextBox.bmp
DDVertScrollBar.bmp
mssccprj.scc
vssver.scc
Redistributables
Ansi
CodeMaxDriver.dll
CodeSenseDriver.dll
DDControlPack.dll
DDForms.dll
DDPropPageAll.dll
Unicode
CodeMaxDriver.dll
CodeSenseDriver.dll
DDControlPack.dll
DDForms.dll
DDPropPageAll.dll
// DDUnlock.cpp : Defines the entry point for the console application.
//
// Author : David Shepherd
//			Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"

#include "tea.h"

// product keys
#define KEY_SIMPLE		0x33DF8C1A
#define KEY_DATA1		0x66FD7009,0x1FF76D02,0x8FDACC64,0x64837CFD
#define KEY_DATA2		0x49ACC539,0x07ABFA45,0x7629FEDE,0xEDA76CB0

/////////////////////////////////////////////////////////////////////////////
// new handler

int NewHandler(size_t size)
{
	// ensure new throws on failure
	throw std::bad_alloc();
	return 0;
}

void Create()
{
	std::cout << "Creating unlock file..." << std::endl;

	// create the unlock file
	std::ofstream File("Unlock.txt");
	if(!File)
	{
		throw std::exception();
	}

	// create the unlock codes
	for(long l=0; l<1000; l++)
	{
		// create a unique id based on the date
		time_t Time=time(NULL);
		tm *pTime=localtime(&Time);
		if(pTime==NULL)
		{
			throw std::exception();
		}
		unsigned long Id=0;
		Id |= pTime->tm_year;	// 8 bit year 
		Id <<= 4;
		Id |= pTime->tm_mon;	// 4 bit month
		Id <<= 20;
		Id |= l;				// 20 bit counter
		// create data1 based on the id
		unsigned long Data1[2]={ Id,Id^KEY_SIMPLE };
		unsigned long KeyData1[4]={ KEY_DATA1 };
		encipher(Data1,Data1,KeyData1);

		// save data1
		File << "Data1="			<<
				std::hex			<<
				std::uppercase		<<
				std::setw(8)		<<
				std::setfill('0')	<<
				Data1[0]			<<
				"-"					<<
				std::hex			<<
				std::uppercase		<<
				std::setw(8)		<<
				std::setfill('0')	<<
				Data1[1]			<<
				", ";

		// encrypt data1 to produce data2
		unsigned long Data2[2]={ 0,0 };
		unsigned long KeyData2[4]={ KEY_DATA2 };
		encipher(Data1,Data2,KeyData2);

		// save data2
		File << "Data2="			<<
				std::hex			<<
				std::uppercase		<<
				std::setw(8)		<<
				std::setfill('0')	<<
				Data2[0]			<<
				"-"					<<
				std::hex			<<
				std::uppercase		<<
				std::setw(8)		<<
				std::setfill('0')	<<
				Data2[1]			<<
				std::endl;
	}

	std::cout << "Success." << std::endl;
	std::cout << "Press Any Key...";
	(void)getch();
}

int main(int argc,char* argv[])
{
	// set the new handler
	_PNH OldNewHandler=NULL;
	OldNewHandler=_set_new_handler(NewHandler);

	// create the unlock file
	try { Create(); }
	catch(...)
	{}

	// restore the new handler
	_set_new_handler(OldNewHandler);

	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

DaveShep
Web Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.180621.3 | Last Updated 1 Aug 2009
Article Copyright 2005 by DaveShep
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid