Products > Test Equipment

Rigol DSXXXX .GEL firmware file format

<< < (26/38) > >>

frozenfrogz:
I know it is usually bad practice to play necromancer and resurrect an old thread, but since this has so much useful information I hope you don’t mind :)

First of all: Thanks for the OS X and Windows firmware unpacking tools!
I could find some entry points with IDA, but this is so much more convenient and I am glad I found this thread!

Can you tell me how to correctly uncompress the SparrowAPP.out file? I have been poking at it with 7zip under W7 as mentioned in this thread plus binutils under OS X.
7zip will unpack most of the file, but quits with unexpected EOF.
When using binutils
--- Code: ---greadelf -S SparrowAPP.out
--- End code ---
it tells me: Error: Not an ELF file - it has the wrong magic bytes at the start

My uncompressed SparrowApp.out (00.04.04.03.02) header:
--- Code: ---HEX: 7F454C46 01010100
ASCII: ELF
--- End code ---

lzma -d does not recognize the compressed file and since the uncompressed file looks pretty sane, I thought it might be possible to just manually fix the header with the hex editor.
Any pointers are welcome, since I do not know much about how ELF works and what binutils expects to see in the header.

Kind regards,
Frederik

ankerwolf:
Hello Frederik,
two days ago I used unpack8.zip and got following output:

--- Code: ---D:\#\#__Rigol\Batronix_SW&Doku\Tools\GEL_Unpack8>python unpack.py ds.gel
instrument series:      DS1000Z
firmware version:       00.04.04.03.02
updateType:     0x00070000
found 10 files

{'filename': '/sys/SparrowAPP.out', 'type': 1, 'start': 640, 'length': 1085971, 'crc': 2922331421, 'unknown': (0, 0, 0)}{'filename': '/sys/SparrowFPGA.hex', 'type': 5, 'start': 1086611, 'length': 803698, 'crc': 1737700535, 'unknown': (0, 0, 0)}
{'filename': '/sys/SparrowDGFPGA.hex', 'type': 6, 'start': 1890309, 'length': 290564, 'crc': 3841850537, 'unknown': (0, 0, 0)}
{'filename': '/sys/logo.hex', 'type': 10, 'start': 2180873, 'length': 768024, 'crc': 2888623556, 'unknown': (0, 0, 0)}
{'filename': '/sys/guiResData.hex', 'type': 12, 'start': 2948897, 'length': 748076, 'crc': 4026022475, 'unknown': (0, 0, 0)}
{'filename': '/sys/guiPicData.hex', 'type': 17, 'start': 3696973, 'length': 124607, 'crc': 3101109682, 'unknown': (0, 0, 0)}
{'filename': '/sys/SparrowConfig.hex', 'type': 16, 'start': 3821580, 'length': 768024, 'crc': 3134270256, 'unknown': (0, 0, 0)}
{'filename': '/sys/SparrowWaveTable.hex', 'type': 11, 'start': 4589604, 'length': 8424, 'crc': 2957269910, 'unknown': (0, 0, 0)}
{'filename': '/sys/SparrowCalFile.hex', 'type': 15, 'start': 4598028, 'length': 144028, 'crc': 4225940020, 'unknown': (0, 0, 0)}
{'filename': '', 'type': 50, 'start': 4742056, 'length': 280, 'crc': 0, 'unknown': (0, 0, 0)}
writing /header  (640 bytes)
writing /sys/SparrowAPP.out.header       (24 bytes)
writing /sys/SparrowAPP.out      (1085947 bytes)
writing /sys/SparrowAPP.out.decompressed         (3934197 bytes)
writing /sys/SparrowFPGA.hex.header      (24 bytes)
writing /sys/SparrowFPGA.hex     (803674 bytes)
writing /sys/SparrowDGFPGA.hex.header    (24 bytes)
writing /sys/SparrowDGFPGA.hex   (290540 bytes)
writing /sys/logo.hex.header     (24 bytes)
writing /sys/logo.hex    (768000 bytes)
writing /sys/guiResData.hex.header       (24 bytes)
writing /sys/guiResData.hex      (748052 bytes)
writing /sys/guiPicData.hex.header       (24 bytes)
writing /sys/guiPicData.hex      (124583 bytes)
writing /sys/guiPicData.hex.decompressed         (4031460 bytes)
writing /sys/SparrowConfig.hex.header    (24 bytes)
writing /sys/SparrowConfig.hex   (768000 bytes)
writing /sys/SparrowWaveTable.hex.header         (24 bytes)
writing /sys/SparrowWaveTable.hex        (8400 bytes)
writing /sys/SparrowCalFile.hex.header   (24 bytes)
writing /sys/SparrowCalFile.hex  (144004 bytes)
Corrupt input data
CRC mismatch: '' (0x00000000 vs 0x6ad11bae)
writing /footer  (280 bytes)

original filesize:      4742336
bytes processed:        4742336

--- End code ---

There is SparrowAPP.out.decompressed ! It is a ELF-file.
But there are so many errors in the html- and css-files - I extracted - from this file.

From the Python script unpack.py file SparrowAPP.out.decompressed contains the Web-interface for the DS1000Z series. The html pages can be found, containing very many errors: there are incorrect characters -  unmotivated but in places with system. Also, one web page is 4 times slightly different included.  It is unclear where this error come from. From the GEL file probably not, because it is used to update. It may be but that the developers intentionally have infilled such errors to hide their work. After all of the html files including the .css were prepared so that they corresponded to the orignal of the Scope. Not found, where is the Access query for the Web Settings page. None of this is to find in the html files. (Microsoft Translator)

LG Wolfgang

frozenfrogz:
Thanks for your quick answer Wolfgang,

curiously I am getting different results and no decompressed files.


--- Code: ---python unpack.py DS1000ZUpdate.GEL
instrument series: DS1000Z
firmware version: 00.04.04.03.02
updateType: 0x00070000
found 10 files

{'start': 640, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowAPP.out', 'crc': 2922331421, 'length': 1085971, 'type': 1}
{'start': 1086611, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowFPGA.hex', 'crc': 1737700535, 'length': 803698, 'type': 5}
{'start': 1890309, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowDGFPGA.hex', 'crc': 3841850537, 'length': 290564, 'type': 6}
{'start': 2180873, 'unknown': (0, 0, 0), 'filename': '/sys/logo.hex', 'crc': 2888623556, 'length': 768024, 'type': 10}
{'start': 2948897, 'unknown': (0, 0, 0), 'filename': '/sys/guiResData.hex', 'crc': 4026022475, 'length': 748076, 'type': 12}
{'start': 3696973, 'unknown': (0, 0, 0), 'filename': '/sys/guiPicData.hex', 'crc': 3101109682, 'length': 124607, 'type': 17}
{'start': 3821580, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowConfig.hex', 'crc': 3134270256, 'length': 768024, 'type': 16}
{'start': 4589604, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowWaveTable.hex', 'crc': 2957269910, 'length': 8424, 'type': 11}
{'start': 4598028, 'unknown': (0, 0, 0), 'filename': '/sys/SparrowCalFile.hex', 'crc': 4225940020, 'length': 144028, 'type': 15}
{'start': 4742056, 'unknown': (0, 0, 0), 'filename': '', 'crc': 0, 'length': 280, 'type': 50}
writing /header (640 bytes)
writing /sys/SparrowAPP.out.header (24 bytes)
writing /sys/SparrowAPP.out (1085947 bytes)
writing /sys/SparrowFPGA.hex.header (24 bytes)
writing /sys/SparrowFPGA.hex (803674 bytes)
writing /sys/SparrowDGFPGA.hex.header (24 bytes)
writing /sys/SparrowDGFPGA.hex (290540 bytes)
writing /sys/logo.hex.header (24 bytes)
writing /sys/logo.hex (768000 bytes)
writing /sys/guiResData.hex.header (24 bytes)
writing /sys/guiResData.hex (748052 bytes)
writing /sys/guiPicData.hex.header (24 bytes)
writing /sys/guiPicData.hex (124583 bytes)
writing /sys/SparrowConfig.hex.header (24 bytes)
writing /sys/SparrowConfig.hex (768000 bytes)
writing /sys/SparrowWaveTable.hex.header (24 bytes)
writing /sys/SparrowWaveTable.hex (8400 bytes)
writing /sys/SparrowCalFile.hex.header (24 bytes)
writing /sys/SparrowCalFile.hex (144004 bytes)
CRC mismatch: '' (0x00000000 vs 0x6ad11bae)
writing /footer (280 bytes)

original filesize: 4742336
bytes processed: 4742336

--- End code ---

It throws a CRC mismatch every time that I did not notice before. I downloaded the firmware zip archives from both rigol sources again, but the CRC mismatch won’t resolve.

The .GEL files from the two different archives have the same checksum: MD5 (DS1000ZUpdate.GEL) = 367ae75bed8864bf168f3afd63de835c

Edit: This is with the script from unpack8.zip

ankerwolf:
Hallo,
merkwürdig ist das schon ...

Here are the unpack.py I used and the corrected html and css files.
I used Python 3.6.1 !!!

Same SparrowAPP.out.decompressed by use of 7-Zip from the compressed SparrowAPP.out !

LG Wolfgang

frozenfrogz:
Well, well. I used Python 2.7.10 before.
Now using python 3.5.2 the unpack script gets me two additional decompressed files.

Thanks for pointing to that :-+

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod