gsl-firmware icon indicating copy to clipboard operation
gsl-firmware copied to clipboard

extracting from vmlinux containing in-built gsl1688.c

Open Mis012 opened this issue 5 years ago • 1 comments

Hi, I've finally found where the fw is hiding (I think) on this device, but it seems the extraction tool is not happy with me supplying the entire vmlinux file...

do you have any suggestion?

(had to gzip the file so github doesn't complain) vmlinux.gz

Mis012 avatar Aug 21 '20 17:08 Mis012

Several years late :) but leaving the hints here as I've just had to do this for a device I have:

  • convert the kernel image to ELF with vmlinux-to-elf
  • likely fail to extract it with the tool as it's probably inlined
  • open the ELF in Ghidra or whatever your favorite RE tool is
  • find the "gsl_load_fw start" string and jump to the function referencing it
  • find the address and size used by the loading loop (size is in pairs of 32-bit ints (position & value), not bytes; and if you see that funky -1 dereference like in the screenshot below, the start address is 4 bytes earlier)
  • copy that much data (size*8) from that start address into a new file
  • compare it with other firmwares in a hex editor, it should start and end similarly enough

ghidra screenshot

valpackett avatar Dec 16 '24 07:12 valpackett