Encrypted heightmap
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
Encrypted heightmap
I would like to ask for help extracting and reimporting map files. I know that the map format inside the encrypted file is in (jp2) as can be seen from the header or metadata inside the file but other than that I have no idea where to start.
Thanks
Thanks
Last edited by praetorian1980 on Thu Apr 23, 2020 7:14 pm, edited 1 time in total.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Encrypted heightmap
Better to upload the original file.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Encrypted heightmap
Just for dumping the jp2:
I don't know if other hgt files have more files inside, if you have a bigger hgt I can check it.
Code: Select all
findloc OFFSET binary "jP "
math OFFSET - 8
goto OFFSET
get SIZE long
savepos OFFSET
get NAME basename
string NAME + ".jp2"
log NAME OFFSET SIZE
I don't know if other hgt files have more files inside, if you have a bigger hgt I can check it.
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Encrypted heightmap
Same format so it's ok to use the script.
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
Re: Encrypted heightmap
aluigi wrote:Same format so it's ok to use the script.
Do you mean this code that you posted earlier?
findloc OFFSET binary "jP "
math OFFSET - 8
goto OFFSET
get SIZE long
savepos OFFSET
get NAME basename
string NAME + ".jp2"
log NAME OFFSET SIZE
Is it possible to reimport back into the hgt?
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
Re: Encrypted heightmap
In the zip there is also a ter file. Are you able to extract its contents?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Encrypted heightmap
I don't know what type of file is that.
It starts with "version" and I guess it's related to "terrain"
It starts with "version" and I guess it's related to "terrain"
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
Re: Encrypted heightmap
I think that the hgt are imported using a codec called jasper, but I don't know how to build it from github.
-
- Posts: 7
- Joined: Thu Apr 23, 2020 1:10 pm
Re: Encrypted heightmap
I have one question:
I tried comparing a file generated from xnconvert which uses jasper jp2 codecs, with the that hgt file, but I can't decypher what's written in the header. I think, from what I saw, that the hgt file is just a regular jp2 image exported from a jasper codec app in a particular export setting and has a header added to it with information that appears to be, among other things, georeference for the map. If only I could understand what's written in there, I could manually edit the header of new images exported with this codec. Please help.
I tried comparing a file generated from xnconvert which uses jasper jp2 codecs, with the that hgt file, but I can't decypher what's written in the header. I think, from what I saw, that the hgt file is just a regular jp2 image exported from a jasper codec app in a particular export setting and has a header added to it with information that appears to be, among other things, georeference for the map. If only I could understand what's written in there, I could manually edit the header of new images exported with this codec. Please help.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Encrypted heightmap
There are various 32bit fields in the header and I'm not sure what they mean.