recover gpx files

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
Post Reply
Message
Author
CircleCode
Posts: 5
Joined: 07 Jan 2018, 20:24

recover gpx files

#1 Post by CircleCode » 07 Jan 2018, 20:35

gpx files are a specific xml format.

Here is an example of this kind of file:

Code: Select all

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<gpx version="1.1" creator="OsmAnd~" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <wpt lat="64.8959307" lon="-23.7084317">
    <name>Ólafsvík</name>
    <desc>volcan
camping gratuit
p220</desc>
    <type>road trip islande</type>
    <cmt>Amenity:Olafsvik:administrative:town</cmt>
    <extensions>
      <color>#b4d00d0d</color>
    </extensions>
  </wpt>
  <wpt lat="65.0315475" lon="-16.7440014">
    <name>Öskjuvatn (viti crater)</name>
    <type>road trip islande</type>
    <cmt>Amenity:Oskjuvatn:osmwiki:wiki_place</cmt>
    <extensions>
      <color>#b4d00d0d</color>
    </extensions>
  </wpt>
</gpx>
To recognize these files, I've tried several variants of photorec.sig, but the file is always recognized as xml rather than gpx.

Here is my last photorec.sig attempt

Code: Select all

gpx 58 0x3C, 0x67, 0x70, 0x78, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D
according to hexdump -Cs 58 -n 13 test.gpx

Code: Select all

0000003a  3c 67 70 78 20 76 65 72  73 69 6f 6e 3d           |<gpx version=|
00000047
Am I doing something wrong, or is it impossible to redefine custom rules for xml files?

Side question: Since I could not recognize gpx, but photorec could recognize xml files, I ended trying to recover all xml files… but I cannot find xml file type in File Opt

Here is the different files offered starting from x:

Code: Select all

 [ ] x3f  Sigma/Foveon X3 raw picture
 [ ] xcf  Gimp XCF File
 [ ] xfi  XFI Electronic Fuel Injection Systems
 [ ] xfs  xfs structure
 [ ] xm   FastTrackerII Extended Module
 [ ] xsv  XBOX GTA San Andreas Save File
 [ ] xpt  Mozilla XPCOM Type Library
 [ ] xv   XV thumbnail image
 [ ] xz   xz Archive
 [ ] z2d  ZeroCad
>[ ] zip  zip archive including OpenOffice and MSOffice 2007

Sponsored links

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

Re: recover gpx files

#2 Post by cgrenier » 08 Jan 2018, 06:57

Did you try fidentify BEFORE trying your signature ?
Photorec 7.1-WIP should already recover gpx files. NOte that gpx and xml files are part of tx? file family.

CircleCode
Posts: 5
Joined: 07 Jan 2018, 20:24

Re: recover gpx files

#3 Post by CircleCode » 08 Jan 2018, 08:56

edit: deleted, needs some more tests on my side

CircleCode
Posts: 5
Joined: 07 Jan 2018, 20:24

Re: recover gpx files

#4 Post by CircleCode » 08 Jan 2018, 10:48

So,

with 7.1-wip, it recovered some of my gpx files, thanks for this :-)

Just some more questions:
- some of the recovered files are seen as binary (there are binary data at the end of the file, after the closing gpx tag) => I was wondering why this happens
- some of the recovered files are truncated… => can I do something to try to recover the missing parts?

Note : I'm working on a disk image.

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

Re: recover gpx files

#5 Post by cgrenier » 08 Jan 2018, 19:39

I have uploaded a new 7.1-WIP. Can you try it and tell me if you get better results ?

CircleCode
Posts: 5
Joined: 07 Jan 2018, 20:24

Re: recover gpx files

#6 Post by CircleCode » 08 Jan 2018, 20:19

Since your changes are not pushed to git, I had difficulties finding the changes (i am curious ;-) )
But good idea to look for the ending tag :-)

Sadly, no improvement on my side :-(

More details:
- in standard mode (paranoid, no brute force, do not keep partial files), no changes at all
- in more aggressive mode (brute force, keep truncated files)
- On files successfully recovered by previous version, the new version adds a bunch of nul (\0) cars at the end
- On files previously truncated, exact same result
- On files previously partial, with garbage at the end (the sectors had already been overwritten), more garbage…

So, it's not better and sometimes worse with this version.

Thanks for your attempt.

I will have to be patient and clean each file (174 files…) to recover the most of them and try to recover my trip :-)

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

Re: recover gpx files

#7 Post by cgrenier » 09 Jan 2018, 06:53

Can you check that you were using the January 2018 version ? I don't see how the results can be worst than previously...

CircleCode
Posts: 5
Joined: 07 Jan 2018, 20:24

Re: recover gpx files

#8 Post by CircleCode » 09 Jan 2018, 09:18

I double checked, and rebuilt with last sources from https://www.cgsecurity.org/testdisk-7.1-WIP.tar.bz2

And I can confirm that in standard mode, it made no change at all,
while for files that were previously fully recovered, they are now recovered with a bunch of \00 chars at the end, after the closing tag

the length of these \0 is not constant, it varies from some bytes to several kbytes

here is an example (gpx4 being the last extracted):

Code: Select all

❯ hexdump -Cs 5024 gpx4/f106509040.gpx
000013a0  2f 67 70 78 3e 00 00 00  00 00 00 00 00 00 00 00  |/gpx>...........|
000013b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002000

❯ hexdump -Cs 5024 gpx/f106509040.gpx 
000013a0  2f 67 70 78 3e                                    |/gpx>|
000013a5

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests