| View previous topic :: View next topic |
| Author |
Message |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Mar 09, 2009 3:56 pm Post subject: CRC method? |
|
|
| Does anybody know any good CRC method that covers the whole 0x400000 - 0x800000; Currently mine crashes :S
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Mon Mar 09, 2009 4:22 pm Post subject: |
|
|
| Code: |
__checkReturn BOOL CalculateCrc(__in_deref PBYTE pData, __in SIZE_T dwLength, __out PDWORD pChecksum)
{
BOOL bRet = TRUE;
DWORD dwChecksum = 0;
unsigned int i;
for (i = 0; i < dwLength; i++)
{
try
{
dwChecksum += (pData[i] * i);
}
except (EXCEPTION_EXECUTE_HANDLER)
{
bRet = FALSE;
}
}
return bRet;
} |
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Mar 09, 2009 4:35 pm Post subject: |
|
|
| rapion124 wrote: | | Code: |
__checkReturn BOOL CalculateCrc(__in_deref PBYTE pData, __in SIZE_T dwLength, __out PDWORD pChecksum)
{
BOOL bRet = TRUE;
DWORD dwChecksum = 0;
unsigned int i;
for (i = 0; i < dwLength; i++)
{
try
{
dwChecksum += (pData[i] * i);
}
except (EXCEPTION_EXECUTE_HANDLER)
{
bRet = FALSE;
}
}
return bRet;
} |
|
Will it crash if I check 1000+ bytes?
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Tue Mar 10, 2009 4:09 am Post subject: |
|
|
| rapion124 wrote: | | Code: |
__checkReturn BOOL CalculateCrc(__in_deref PBYTE pData, __in SIZE_T dwLength, __out PDWORD pChecksum)
{
BOOL bRet = TRUE;
DWORD dwChecksum = 0;
unsigned int i;
for (i = 0; i < dwLength; i++)
{
try
{
dwChecksum += (pData[i] * i);
}
except (EXCEPTION_EXECUTE_HANDLER)
{
bRet = FALSE;
}
}
return bRet;
} |
|
What happens to pChecksum?
Also, why not UINT?
|
|
| Back to top |
|
 |
|