Hi,
I have this code .lic:
{
{
HKEY hkey;
TCHAR temp[50];
#pragma warning(push)
#pragma warning(disable:4309)
char szKey[47]={0x10, 0xDB, 0x7C, 0x7C, 0x45, 0xCA, 0x2F, 0x4C, 0xCF, 0xF1, 0xEF, 0x5F, 0xDC, 0x3E, 0x02, 0x8F, 0xA3, 0xA8, 0xB2, 0x00, 0x59, 0xFD, 0xDE, 0x89, 0x5F, 0x3B, 0x75, 0x97, 0xD9, 0x3D, 0xA0, 0x45, 0x9B, 0x95, 0x64, 0xA8, 0xA9, 0xA9, 0xEE, 0x0A, 0x8A, 0xD6, 0xBB, 0x1C, 0xBF, 0x2B, 0};
#pragma warning(pop)
EncryptDecrypt((BYTE *)szKey, sizeof(szKey) - 1, REVERSE + GROUP1, 0);
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
szKey,
0,
KEY_QUERY_VALUE | KEY_SET_VALUE,
&hkey) == ERROR_SUCCESS)
{
DWORD dwType = 0;
DWORD dwSize = sizeof(temp);
if (RMRegQueryValueEx(hkey,
_T("H1"),
NULL,
&dwType,
(BYTE*)temp,
&dwSize) != ERROR_SUCCESS)
{
CString SiteCodeMAC;
{
int iNicCount=0;
BOOL bCont = true;
CDeviceLocationInformationList_SortedByLocation dlisLocation;
iNicCount = dlisLocation.Collect();
if (iNicCount == 0)
{
bCont = false;
}
else if (iNicCount == 1)
{
}
if (bCont)
{
CDeviceLocationInformationList_SortedByPdo dlisPdo;
dlisPdo.Collect();
dlisLocation.EnumReset();
dlisPdo.EnumReset();
ReportNICInfoMP( TRUE, dlisLocation, SiteCodeMAC );
if (SiteCodeMAC.IsEmpty())
{
}
else
{
}
}
m_strSiteCodeGeneratedInOtherPlace = SiteCodeMAC;
}
{
char XXXX_HASH1_HASH4[4 + 4*8 + 1];
char ss[32 + 1];
char cXXXX_MacHdd12[32 + 1];
#if defined(_UNICODE)
sprintf(cXXXX_MacHdd12, "%S", SiteCodeMAC);
#else
sprintf(cXXXX_MacHdd12, "%s", SiteCodeMAC);
#endif
#if defined(_UNICODE)
sprintf(XXXX_HASH1_HASH4, ("%S"), SiteCodeMAC.Left(4));
#else
strcpy(XXXX_HASH1_HASH4, SiteCodeMAC.Left(4));
#endif
sprintf(ss, "%08lX", hashpjw(cXXXX_MacHdd12, REALSITECODELEN));
strcat(XXXX_HASH1_HASH4, ss);
sprintf(ss, "%08lX", calc_hashnr(cXXXX_MacHdd12, REALSITECODELEN));
strcat(XXXX_HASH1_HASH4, ss);
sprintf(ss, "%08lX", calc_hashnr_new(cXXXX_MacHdd12, REALSITECODELEN));
strcat(XXXX_HASH1_HASH4, ss);
sprintf(ss, "%08lX", hash(cXXXX_MacHdd12));
strcat(XXXX_HASH1_HASH4, ss);
#if defined(_UNICODE)
TCHAR XXXX_HASH1_HASH4_[sizeof(XXXX_HASH1_HASH4)];
_stprintf(XXXX_HASH1_HASH4_, _T("%S"), XXXX_HASH1_HASH4);
RMRegSetValueEx(hkey,
_T("H1"),
0,
REG_SZ,
(BYTE*)XXXX_HASH1_HASH4_,
(_tcsclen(XXXX_HASH1_HASH4_)+1) * sizeof(TCHAR));
#else
RMRegSetValueEx(hkey,
_T("H1"),
0,
REG_SZ,
(BYTE*)XXXX_HASH1_HASH4,
(_tcsclen(XXXX_HASH1_HASH4)+1) * sizeof(TCHAR));
#endif
}
}
else
{
CString SiteCodeMAC;
#if defined(_UNICODE)
char ctemp[32 + 1];
#endif
{
int iNicCount=0;
BOOL bCont = true;
CDeviceLocationInformationList_SortedByLocation dlisLocation;
iNicCount = dlisLocation.Collect();
if (iNicCount == 0)
{
bCont = false;
}
else if (iNicCount == 1)
{
}
if (bCont)
{
CDeviceLocationInformationList_SortedByPdo dlisPdo;
dlisPdo.Collect();
dlisLocation.EnumReset();
dlisPdo.EnumReset();
#if defined(_UNICODE)
sprintf(ctemp, "%S", temp);
ReportNICInfoMP( FALSE, dlisLocation, SiteCodeMAC, ctemp );
#else
ReportNICInfoMP( FALSE, dlisLocation, SiteCodeMAC, temp );
#endif
if (SiteCodeMAC.IsEmpty())
{
}
else
{
}
}
if (SiteCodeMAC.IsEmpty())
{
m_strSiteCodeGeneratedInOtherPlace = _T("");
{
if (GetKeyState(VK_CONTROL) < 0 && GetKeyState(VK_SHIFT) < 0 && GetKeyState(VK_MENU) < 0)
RegDeleteValue(hkey, _T("H1"));
}
}
else
{
m_strSiteCodeGeneratedInOtherPlace = SiteCodeMAC;
}
}
}
RegCloseKey(hkey);
}
else
{
}
}
}
After using this .lic I am getting "Run-Time Check Failure #2 - Stack around the variable 'ctemp' was corrupted." error, what does this mean? what should I do to eliminate it?
Thanks,
Jayjay
|