能力值:
( LV2,RANK:10 )
|
-
-
4 楼
坐等高手
|
能力值:
( LV7,RANK:105 )
|
-
-
5 楼
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
需要的
|
能力值:
( LV7,RANK:105 )
|
-
-
7 楼
w小my
需要的
static int HexScan(FILE *pFile,const char *pS) { int i,j; unsigned char *pBuf=NULL; int Result=-1; int curLen=0; int sLen=strlen(pS); fseek(pFile,0,SEEK_END); unsigned int fLen=ftell(pFile); fseek(pFile,0,SEEK_SET); pBuf=new unsigned char[fLen]; while(curLen<fLen) curLen+=fread(pBuf+curLen,sizeof(unsigned char),fLen,pFile); for(i=0;i<fLen;i++) { for(j=0;j<sLen;j++) { if (pBuf[i+j]!=*(unsigned char*)&pS[j]) break; } if(j==sLen) { Result=i;//+1; break; } } delete pBuf; fseek(pFile,0,SEEK_SET); return Result; }
|
|
|