FIR file related tools for developers - DSLR Hack development - CHDK Forum

FIR file related tools for developers

  • 5 Replies

Offline Coutts

  • *****
  • 538
    • Flickr
FIR file related tools for developers
« on: 21 / June / 2011, 21:00:26 »
I am listing all useful tools for developers working with fir files, for a wiki page here
« Last Edit: 21 / June / 2011, 21:04:40 by Coutts »
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8



Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: FIR file related tools for developers
« Reply #1 on: 19 / August / 2011, 20:01:12 »
Hi Andrew, do you have contact with the guy made the dissect_fw3_2.c ?
It seems it cannot dissect the 400d 1.1.1 FW ( I believe it calculates wrong offsets or something... it gets offset1==348 and the array for offset1 (CRYPT1) is 256 bytes long... so we have segfault.
I tried to run it on decrypted FW too, wasn't better...
// AF

Re: FIR file related tools for developers
« Reply #2 on: 20 / August / 2011, 02:21:39 »

try this


Code: (GeShi) [Select]
Fir_tool 0.6 for 5D/30D/400D (11Nov2010)

fileLen = 0x4ae26a
---.fir header---
0x000: modelId = 0x80000236, (400D / Rebel XTi, VxWorks)
0x010: version = 1.1.1
---ciphered part (xor)---
 xor_decoding [0x20-0x4ae26a]... OK (0236_111_firmware.bin)
0x020: checksum = 0xe355c059
0x024: updater offset = 0x30
0x028: firmware pack offset = 0x127c90
0x02c:  = 0x0
0x030: ---updater---
0x127c90: ---firmware---
0x127c90: (+0x000) firmware checksum = 0xea5228c2
0x127c94: number of files in the pack = 13
0x127c98: offset to the file table = 0x18 (from 0x127c90)
0x127c9c: header size = 0x220 (from 0x127c90). end of header = 0x127eb0
0x127ca0: size of file table = 0x208
0x127ca4: size after table = 0x3863ba
0x127c88: (+0x018) files table
0x127ca8: 0x01 0x0008  0x000220 0x01b040 BIND_RESOURCE
0x127cd0: 0x02 0x0003  0x01b260 0x35c9a0 MAIN_FIRMWARE
0x127cf8: 0x03 0x0004  0x377c00 0x000004 ModelID
0x127d20: 0x04 0x0004  0x377c04 0x000005 FirmwareVersion
0x127d48: 0x05 0x0004  0x377c09 0x00000a ICUVersion
0x127d70: 0x06 0x0004  0x377c13 0x0001f8 FileSizeTable
0x127d98: 0x07 0x0004  0x377e0b 0x001b69 LensNameTbl
0x127dc0: 0x08 0x0004  0x379974 0x000094 LensPOTbl
0x127de8: 0x09 0x0004  0x379a08 0x000f2c AdjWbFix
0x127e10: 0x0a 0x0004  0x37a934 0x00469a CrwParam
0x127e38: 0x0b 0x0004  0x37efce 0x00722c FlavorLutParam
0x127e60: 0x0c 0x0004  0x3861fa 0x000218 ColorAdjustDefaultAngel
0x127e88: 0x0d 0x000b  0x386412 0x0001c8 EEP
0x127eb0: (+0x220) end of table, first file
« Last Edit: 20 / August / 2011, 02:24:42 by arm.indiana »


Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: FIR file related tools for developers
« Reply #3 on: 20 / August / 2011, 08:33:58 »
Hi Indy, thanks for pointing me out... this seems to be the missing part in my collection ;)

p.s. the first char in my nick is zero ;)
// AF

Re: FIR file related tools for developers
« Reply #4 on: 20 / August / 2011, 10:24:17 »
Hi 0xAF,

please see this

to my knowledge, you have 2 ways of executing code:
- FIR context (requires a well formed, sometimes signed file).
  See and
- autoexec.bin context (sometimes requires to set the bootflag)
for VxWorks DSLRs, if I remember, it is not required to set the bootflag, you just have to make the card bootable and have an autoexec.bin file. See I'm not sure 5dm2 does require setting the bootflag.
I'll start a table on the Wiki to summarize that...
Either you patch the existing mini DryOS insider the updater (see 7d dumper), or you rewrite it a boot/init sequence (see 450D, never done with DryOS).



Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: FIR file related tools for developers
« Reply #5 on: 20 / August / 2011, 17:02:52 »
400d needs the bootflags, not only the card bootable...
this is the main reason i'm interested in .fir files... so far we (in 400plus) are using one testfir.fir which will enable the bootflags, but it is hanging the camera after doing it... so i though it would be nice to have our firmware (autoexec.bin) running by firtmware update (w/o flashing it to the ROM actually), and i can make a new menu to enable the bootflags from there ...
this way, everyone can test the firmware and if he/she likes it, can enable the bootflags and put the autoexec.bin to the CF card.

from what i see in the bootloader, the routine which enables the booflags will write the volume label to the CF too...

from the information you gave me, i see that i need to learn more about the structures of the .fir files...
// AF


Related Topics