Author Topic: hacking Canon EOS 1000D  (Read 42187 times)

Offline acoder

  • Newbie
  • *
  • Posts: 4
Re: hacking Canon EOS 1000D
« Reply #75 on: 21 / July / 2010, 17:12:45 »
If decrypting and patching an official Canon firmware is the way to go (in case the 1000D won't boot from SD in original state), then how to decrypt the FWs?


After tinkering around with some tools it looks like FIRLoad http://pel.hu/down/FIRload.exe can decrypt the flasher part of the FIR (there  are sensible strings like "Copyright 1999-2001 ARM Limited.Copyright 1999-2001 Wind River Systems" in the decrypted file) but not the firmware itself (at least I am not able to identify any strings; still looks pretty much encrypted though I did not make any distribution analysis. EDIT: According to HxD's statistic all symbols are about evenly distributed which implies the firmware still being encrypted with a reasonable algorithm).

Updated the http://chdk.wikia.com/wiki/1000D#Firmware_info, anyway.

Any further information?
« Last Edit: 21 / July / 2010, 17:37:01 by acoder »

Offline virility

  • Rookie
  • *
  • Posts: 14
Re: hacking Canon EOS 1000D
« Reply #76 on: 22 / July / 2010, 18:54:21 »

Offline acoder

  • Newbie
  • *
  • Posts: 4
Re: hacking Canon EOS 1000D
« Reply #77 on: 24 / July / 2010, 04:28:37 »

Offline engelmarkus

  • Rookie
  • *
  • Posts: 6
Re: hacking Canon EOS 1000D
« Reply #78 on: 25 / July / 2010, 21:22:37 »
I'm sorry, but the whole process isn't easy.
First of all, you'll need an original fir file from the canon website.
Then you'll have to compile "dissect_fw3_2.c" from the attachment and run it on the fir file. This will split it into pieces.

Now you can write some code you want to run on your camera, for example
Code: [Select]
#define LED_BLUE 0xC02200E8
#define LED_ON    0x46

int main() {
  *((volatile long*)LED_BLUE) = LED_ON;
  while (1) ;
}

Compile it and link it.
Now build a new fir file. Open assemble_fw and change $header_file, $flasher_file and $camera_id to match your camera. Run assemble_fw. You will get a file "output.fir". Copy this file to your sd card and do a firmware update. The blue led should turn on. To make your camera work again you'll have to take out its battery...

You will have to blink out at least a part of a new firmware version through an led in order to find out some function addresses you need for creating a complete dump. For that I used the blue led, a photo diode and some cd audio cable. Just look at the pictures in the attachment.
Now disassemble your dump and find all of the functions listed in entry_subs.S. Replace the addresses there with the ones you found out.
You are able to reboot your camera and create a new process now, which will write a complete dump to an sd card.

Decryption of the flasher part of fir files is possible, but I think it is of no use...

Offline acoder

  • Newbie
  • *
  • Posts: 4
Re: hacking Canon EOS 1000D
« Reply #79 on: 26 / July / 2010, 22:41:15 »

Run assemble_fw. You will get a file "output.fir". Copy this file to your sd card and do a firmware update. The blue led should turn on. To make your camera work again you'll have to take out its battery...


What I am uncertain about wrt this step is: does this blow my camera's brains out or not? As it is a firmware update it should (firmware should now contain only turning blue led on and an infinite loop). But given that you later extracted the complete fw there seems to be a safety catch preserving the original firmware.

Background: the latest downloadable firmware is 1.06, while both yours and my camera are already at 1.07.

Furthermore: can you extract the respective portions from the 1.07 fw dump and integrate them back into a fir file (taking the flasher from either the 1.07 dump or the 1.06 fw download)?

In the meantime I had some trouble setting up a Ubuntu 10.4 dev vm. Seem unable to get cross gcc 4.3.3 running. Thus, I am now back on Windows using the CHDK Shell v273.

Anyhow, is IDA 4.9 sufficient for working with the dumps or is 5.x required?

Cheers
A

Offline engelmarkus

  • Rookie
  • *
  • Posts: 6
Re: hacking Canon EOS 1000D
« Reply #80 on: 01 / August / 2010, 21:55:01 »
No, it does not overwrite your firmware.
A fir file consists of 3 parts: A header, the flasher and the actual firmware (encrypted). The complete fir file is loaded at 0x800000 (RAM). Then the camera checks its header, whether it is the right file. After that it jumps to 0x800120. There the flasher code begins. The flasher itself is responsible for overwriting the flash. assemble_fw will exchange the flasher with our own code and it will zero out the rest of the file. So there is no chance of "blowing its brains out" :D .
The problem is that many of the addresses and data are hardcoded into the firmware. As the fir file is partly encrypted, you cannot easily make changes there. You'd have to reencrypt it. But I don't know how :( .
IDA 4.9 is probably ok, although I'm using 5.5.

Offline virility

  • Rookie
  • *
  • Posts: 14
Re: hacking Canon EOS 1000D
« Reply #81 on: 04 / August / 2010, 01:18:23 »
how far are you with your firmware? have you seen any features in the code that can be enabled?

Offline engelmarkus

  • Rookie
  • *
  • Posts: 6
Re: hacking Canon EOS 1000D
« Reply #82 on: 05 / August / 2010, 00:26:59 »
Well, you could do a lot of things, but you'll always have to make permanent changes to the firmware.
The next thing is probably to find out how to hook buttons, so we can make the camera do something...

Offline nakata101

  • Newbie
  • *
  • Posts: 2
Re: hacking Canon EOS 1000D
« Reply #83 on: 08 / August / 2010, 14:04:18 »
Well, you could do a lot of things, but you'll always have to make permanent changes to the firmware.
The next thing is probably to find out how to hook buttons, so we can make the camera do something...
Wow!! Cant wait for it!!!

CHDK Forum

Re: hacking Canon EOS 1000D
« Reply #83 on: 08 / August / 2010, 14:04:18 »

Offline virility

  • Rookie
  • *
  • Posts: 14
Re: hacking Canon EOS 1000D
« Reply #84 on: 13 / August / 2010, 20:50:41 »
i think the most important changes were mentioned in this thread.

3fps in raw, iso 3200, spot methering


Offline Bobsancho

  • Rookie
  • *
  • Posts: 17
Re: hacking Canon EOS 1000D
« Reply #85 on: 17 / August / 2010, 04:17:14 »
not to mention video record :)

Offline virility

  • Rookie
  • *
  • Posts: 14
Re: hacking Canon EOS 1000D
« Reply #86 on: 20 / August / 2010, 14:47:15 »

Offline sensitiveeyes

  • Newbie
  • *
  • Posts: 1
Re: hacking Canon EOS 1000D
« Reply #87 on: 25 / August / 2010, 16:22:43 »
Quick ?

The firmware "bin" that is linked to on the Camera's page, how do I go about installing it, and does anyone know of the exact changes accompanying that update?

Offline bastisk8

  • Newbie
  • *
  • Posts: 4
Re: hacking Canon EOS 1000D
« Reply #88 on: 25 / August / 2010, 18:40:50 »
Just read in ther German CHDK Forums, that canons own script language has been discovered, could this be any helpful?


Link for the German folks:
http://www.wirklemms.de/chdk/forum/viewtopic.php?t=2013

Offline acoder

  • Newbie
  • *
  • Posts: 4
Re: hacking Canon EOS 1000D
« Reply #89 on: 11 / September / 2010, 23:31:24 »
Just read in ther German CHDK Forums, that canons own script language has been discovered, could this be any helpful?

According to a quick check with my 1000D (fw 1.07) and a look at the firmware strings, at least my camera does not seem to support the recently discovered scripting language. Hopefully, I do stand corrected wrt this claim ;)

Booting from card and autoexec.bin are in the strings and thus very likely supported (though apparently disabled by default).

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal