Page 1 of 1

Recovery office file fail

Posted: 22 Oct 2019, 06:18
by tsdpd6n
I have built the QPhotorec.exe in windows platform.
I use Qt5.11.3 and mingw.
I can recovery photo files. However, I can not find the file header of office files.
I check the source code and find that it return 0 when check for little endian in file_gen.c .

static int header_check_doc(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
const struct OLE_HDR *header=(const struct OLE_HDR *)buffer;
/* Check for Little Endian */
int a = le16(header->uByteOrder);
if(le16(header->uByteOrder)!=0xFFFE)
return 0;
if(le16(header->uDllVersion)!=3 && le16(header->uDllVersion)!=4)
return 0;
if(le16(header->reserved)!=0 || le32(header->reserved1)!=0)
return 0;
if(le16(header->uMiniSectorShift)!=6)
return 0;
if(le16(header->uDllVersion)==3 && le16(header->uSectorShift)!=9)
return 0;
/* max and qbb file have uSectorShift=12 */
if(le16(header->uDllVersion)==4 && le16(header->uSectorShift)!=12)
return 0;
if(le16(header->uDllVersion)==3 && le32(header->csectDir)!=0)
return 0;
/* max file have csectDir=1
* qbb file have csectDir=4 */
if(le16(header->uDllVersion)==4 && le32(header->csectDir)==0)
return 0;
...
}

Should I change any config?

Re: Recovery office file fail

Posted: 22 Oct 2019, 19:56
by cgrenier
I have no problem with qphotorec when I compiled it using mingw.
Did you use the configure script ?

Re: Recovery office file fail

Posted: 23 Oct 2019, 01:56
by tsdpd6n
No, I use Qt Creator 4.7.2 to compile qphotorec .