コード例 #1
0
ファイル: SerCheck.cpp プロジェクト: xfxf123444/japan
BOOL YGSCCheckSerial(char *szCompany,char *szProduct,char *szNumber,char *szSerial)
{
	DWORD dwKey,dwSerial;
	BYTE  btEcyKey[24];
	char  szKeyTmp[9],szKey1[11],szKey2[11],szTemp[24];
	int  i;

	if (strlen(szCompany) != 4 || 
		strlen(szProduct) != 3 || 
		strlen(szNumber) != 6 ||
		strlen(szSerial) != 6) return FALSE;

	dwKey = atoi(szNumber);
	strcpy(szKey1,szCompany);
	memcpy(&szKey2,&dwKey,4);
	for (i = 0;i < 4;i++)
	{
		szKeyTmp[2*i] = szKey1[i];
		szKeyTmp[2*i+1] = szKey2[i];
	}

	dwSerial = atoi(szProduct);
	YGGenerate3Key(dwKey,dwSerial,btEcyKey);
	YGDESEncryCode((LPBYTE)&btEcyKey,(LPBYTE)szKeyTmp,(LPBYTE)szKeyTmp,8,YGDESEDE3);

	dwKey = *((DWORD *)&szKeyTmp) + *((DWORD *)&szKeyTmp[4]);

	NumToText(dwKey,szTemp);
	return (!stricmp(szSerial,szTemp));
}
コード例 #2
0
ファイル: SerCheck.cpp プロジェクト: xfxf123444/japan
BOOL YGSCGenerateSerial(char *szSerial,PYGCSSTRU pGenSerInfo)
{
	DWORD dwKey,dwChkSerial = 0;
	BYTE  btEcyKey[24];
	char  szKeyTmp[9],szKey1[11],szKey2[11],szTemp[24];
	int  i;

	if (strlen(pGenSerInfo->szComp) != 4) return FALSE;
	if (pGenSerInfo->dwProduct < 1 || pGenSerInfo->dwProduct > 999) return FALSE;
	if (pGenSerInfo->dwNumber < 1 || pGenSerInfo->dwNumber > 999999) return FALSE;

	memcpy(&szKey1,&pGenSerInfo->szComp,4);
	memcpy(&szKey2,&pGenSerInfo->dwNumber,4);
	for (i = 0;i < 4;i++)
	{
		szKeyTmp[2*i] = szKey1[i];
		szKeyTmp[2*i+1] = szKey2[i];
	}

	YGGenerate3Key(pGenSerInfo->dwNumber,pGenSerInfo->dwProduct,btEcyKey);
	YGDESEncryCode((LPBYTE)&btEcyKey,(LPBYTE)szKeyTmp,(LPBYTE)szKeyTmp,8,YGDESEDE3);

	dwKey = *((DWORD *)&szKeyTmp) + *((DWORD *)&szKeyTmp[4]);

	strcpy(szSerial,pGenSerInfo->szComp);
	sprintf(szTemp,"-%3.3d",pGenSerInfo->dwProduct);
	strcat(szSerial,szTemp);
	sprintf(szTemp,"-%6.6d-",pGenSerInfo->dwNumber);
	strcat(szSerial,szTemp);
	NumToText(dwKey,szTemp);
	strcat(szSerial,szTemp);
	return TRUE;
}
コード例 #3
0
ファイル: SelectAttrib.cpp プロジェクト: HoverRace/HoverRace
void SelectAttrib::Refresh()
{
	int lWallTexture = HC_NO_SELECTION;
	int lCeilingTexture = HC_NO_SELECTION;
	int lFloorTexture = HC_NO_SELECTION;
	int lItemType = HC_NO_SELECTION;
	int lFloorLevel = HC_NO_SELECTION;
	int lCeilingLevel = HC_NO_SELECTION;
	int lXPos = HC_NO_SELECTION;
	int lYPos = HC_NO_SELECTION;
	int lZPos = HC_NO_SELECTION;
	int lOrientation = HC_NO_SELECTION;

	// Retrieve each interesting field from the document
	if(mCurrentDoc != NULL) {
		lWallTexture = mCurrentDoc->SetWallTexture(HC_READ_ONLY);
		lCeilingTexture = mCurrentDoc->SetCeilingTexture(HC_READ_ONLY);
		lFloorTexture = mCurrentDoc->SetFloorTexture(HC_READ_ONLY);
		lItemType = mCurrentDoc->SetItemType(HC_READ_ONLY);
		lFloorLevel = mCurrentDoc->SetFloorLevel(HC_READ_ONLY);
		lCeilingLevel = mCurrentDoc->SetCeilingLevel(HC_READ_ONLY);
		lXPos = mCurrentDoc->SetXPos(HC_READ_ONLY);
		lYPos = mCurrentDoc->SetYPos(HC_READ_ONLY);
		lZPos = mCurrentDoc->SetZPos(HC_READ_ONLY);
		lOrientation = mCurrentDoc->SetOrientation(HC_READ_ONLY);

	}

	// Refresh the state of each control
	//

	// CComboBoxs
	mWallTextureCtrl.EnableWindow(lWallTexture != HC_NO_SELECTION);
	mWallTextureCtrl.SetCurSel(lWallTexture < 0 ? -1 : lWallTexture);

	mCeilingTextureCtrl.EnableWindow(lCeilingTexture != HC_NO_SELECTION);
	mCeilingTextureCtrl.SetCurSel(lCeilingTexture < 0 ? -1 : lCeilingTexture);

	mFloorTextureCtrl.EnableWindow(lFloorTexture != HC_NO_SELECTION);
	mFloorTextureCtrl.SetCurSel(lFloorTexture < 0 ? -1 : lFloorTexture);

	mItemTypeCtrl.EnableWindow(lItemType != HC_NO_SELECTION);
	mItemTypeCtrl.SetCurSel(lItemType < 0 ? -1 : lItemType);

	// Edit boxes
	mFloorLevelEdit.EnableWindow(lFloorLevel != HC_NO_SELECTION);
	mFloorLevelEdit.SetWindowText(NumToText(lFloorLevel));

	mCeilingLevelEdit.EnableWindow(lCeilingLevel != HC_NO_SELECTION);
	mCeilingLevelEdit.SetWindowText(NumToText(lCeilingLevel));

	mXPosEdit.EnableWindow(lXPos != HC_NO_SELECTION);
	mXPosEdit.SetWindowText(NumToText(lXPos));

	mYPosEdit.EnableWindow(lYPos != HC_NO_SELECTION);
	mYPosEdit.SetWindowText(NumToText(lYPos));

	mZPosEdit.EnableWindow(lZPos != HC_NO_SELECTION);
	mZPosEdit.SetWindowText(NumToText(lZPos));

	mAngleEdit.EnableWindow(lOrientation != HC_NO_SELECTION);
	mAngleEdit.SetWindowText(NumToText(lOrientation));

	/*
	   CComboBox   mCeilingTextureCtrl;
	   CComboBox   mFloorTextureCtrl;

	   CEdit       mCeilingLevelEdit;
	   CSliderCtrl mCeilingLevelSlider;

	   CEdit       mFloorLevelEdit;
	   CSliderCtrl mFloorLevelSlider;

	   CEdit       mXPosEdit;
	   CEdit       mYPosEdit;
	   CEdit       mZPosEdit;
	   CEdit       mAngleEdit;

	   CComboBox   mItemTypeCtrl;

	 */

	/*
	   lWallTextureCtrl    .Detach();
	   lCeilingTextureCtrl .Detach();
	   lFloorTextureCtrl   .Detach();
	   lCeilingLevelEdit   .Detach();
	   lCeilingLevelSlider .Detach();
	   lFloorLevelEdit     .Detach();
	   lFloorLevelSlider   .Detach();
	   lXPosEdit           .Detach();
	   lYPosEdit           .Detach();
	   lZPosEdit           .Detach();
	   lAngleEdit          .Detach();
	   lItemTypeTextureCtrl.Detach();
	 */

	/*
	   IDC_WALL_TEXTURE
	   IDC_CEILING_TEXTURE
	 */
}