Recovery office file fail

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
tsdpd6n
Posts: 2
Joined: 22 Oct 2019, 06:17

Recovery office file fail

#1 Post 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?

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Recovery office file fail

#2 Post by cgrenier »

I have no problem with qphotorec when I compiled it using mingw.
Did you use the configure script ?

tsdpd6n
Posts: 2
Joined: 22 Oct 2019, 06:17

Re: Recovery office file fail

#3 Post by tsdpd6n »

No, I use Qt Creator 4.7.2 to compile qphotorec .

Locked