int IsArchive(void) { #ifdef _DEBUG_LOG int str_offs; /* used for debug-strings */ char DebugMsg[500]; /* used to compose debug msg */ #endif
#ifdef _USE_MEMORY_TO_MEMORY_DECOMPRESSION if (tread(MemRARFile, MarkHead.Mark, SIZEOF_MARKHEAD) != SIZEOF_MARKHEAD) { debug_log("IsArchive(): short read: FALSE"); return(FALSE); } #else if (tread(ArcPtr,MarkHead.Mark,SIZEOF_MARKHEAD)!=SIZEOF_MARKHEAD) { debug_log("IsArchive(): short read: FALSE"); return(FALSE); } in IsArchive it is returning from here > Hello to all > I ported the libclamav to run on windows and uses > Visual Studio vc++ > up to Version .83 it was working that is shows virus for clam.rar > > But when i changed it to .84 > In scanners.c when cli_scanrar() function is called > when we reach line > if(!(afiles = urarlib_list(desc, (ArchiveList_struct *) &rarlist))) > then in unrar.c > in function unrarlib_list() > it enters and returns from code below and returns value 0 > /* open and identify archive */ > newdesc = dup(desc); > cli_dbgmsg("ExtrFile(): dup(%d) = %d\n", desc, newdesc); > if ((ArcPtr=fdopen(newdesc,READBINARY))!=NULL) > { > if (!IsArchive()) > { > cli_dbgmsg("urarlib_list(): Not a valid archive."); > debug_log("Not a RAR file"); > fclose(ArcPtr); > lseek(desc, 0, SEEK_SET); > ArcPtr = NULL; > return NoOfFilesInArchive; /* error => exit! > */ > } > it enters and returns from code above and returns value 0 > due to which it enters (now in file scanners.c) > if(!(afiles = urarlib_list(desc, (ArchiveList_struct *) &rarlist))) > { > #ifdef CL_THREAD_SAFE > pthread_mutex_unlock(&cli_scanrar_mutex); > cli_scanrar_inuse = 0; > #endif > return CL_ERAR; > } > and return RAR Module Failure > > where can be the mistake where i am going wrong > Please help me > _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html