Quote:
Originally posted by aluser
presumeably the eighth byte of your kernel image is 0; thus strlen() sees a string of seven bytes.
I don't know what library you found the crc32() function in so I can't tell if you're using it correctly.
|
thanks a lot for your reply,
first,the kernel image indeed contain some ugly chars not shown as ASCII code,perhaps
as you said ,the eighth byte is 0,i am to check it.but how to solve it? The CRC tool can get correct checksum,it should use some correct method to solve the problem,what is it?
second ,the crc32() function is in linux/addon/cipe/crc32.c, i think it is in correct use.
as following:
///////////////////////////////////////////////
// COPYRIGHT (C) 1986 Gary S. Brown.
static unsigned long crc32_tab[] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
...........
}
/* Return a 32-bit CRC of the contents of the buffer. */
unsigned long crc32(unsigned char *s, unsigned int len)
{
unsigned int i;
unsigned long crc32val;
crc32val = 0;
for (i = 0; i < len; i ++)
{
crc32val =
crc32_tab[(crc32val ^ s[i]) & 0xff] ^
(crc32val >> 8);
}
return crc32val;
}
/////////////////////////////////////////////
best regards and your help is needed.