A590IS porting... - page 2 - DryOS Development - CHDK Forum

A590IS porting...

  • 968 Replies
  • 423151 Views
*

Offline brake

  • *
  • 23
  • IXUS90IS / SD790IS
Re: First boot: a failure!
« Reply #10 on: 01 / October / 2008, 04:47:59 »
Advertisements
The user by nick chr, and maybe he alone, knows how to encode.

The thread you need is: Emulating Digicam with QEMU which shows you how to emulate the firmware using qemu.

I've successfully done this in order to compile diskboot.bins for the ixus90.

You need to pretty much follow chr's directions exactly. Then you have a system where you can compile, then encode the firmware. The easiest way to do this is to use the firmware that chr mentions in that thread (instead of your own for your camera) unless you already know the memory location of the encoding function in your own firmware. It would be much easier however if yes, someone decoded the algorithm in the firmware (it's not chr's algorithm, it's a function in the firmware. What chr explains how to do in that thread is import the compiled diskboot.bin into memory, call the function to act on the data, which encodes it, then write it back out to file. If you look at what he uses to write the encoded data to file you will see he starts from the memory location he wrote to initially minus 1, which takes into account the requirement of having diskboot.bin start with 0x00).

If you're firmware is massive, you may need to update your compiler. I suggest using what the wiki says do use exactly as you know it will then work.
« Last Edit: 01 / October / 2008, 04:51:59 by brake »

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: First boot: a failure!
« Reply #11 on: 01 / October / 2008, 05:39:08 »
How about approaching this from the end-result side ?

we know: 1) to encode 'routine X' is applied 15 times
                2) to decode it is applied 1 time

so applying it 16 times brings back the 'original'

this suggests that 'routine X' bitrotates each 16-bit word by 1 or each 32-bits longword by 2
(and it could obviously be either left or right rotation)

has anybody experimented along these lines yet ?

wim

edit: another 'black box' approach: generating a file containing all word values or dword values
        and applying 'routine X' on that. Results would enable us to create a table-driven emulation of 'routine X'.
« Last Edit: 01 / October / 2008, 06:10:35 by whim »

*

Offline ma_jk

  • **
  • 60
Re: First boot: a failure!
« Reply #12 on: 01 / October / 2008, 05:47:45 »
Havent had time to lurk in the code.. but is it just a "bit rotation"? in theory that shouldnt be too hard to code ex-novo, not to infringe any copyrighted canon assembly.

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: First boot: a failure!
« Reply #13 on: 01 / October / 2008, 06:18:40 »
just edited my post while you were replying  :D
i guess using 'blackbox' method would also avoid infringing copyright

wim

*

Offline brake

  • *
  • 23
  • IXUS90IS / SD790IS
Re: First boot: a failure!
« Reply #14 on: 01 / October / 2008, 08:35:32 »
enc/unenced diskboot

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: First boot: a failure!
« Reply #15 on: 01 / October / 2008, 08:58:05 »
thanks, brake !

*

Offline brake

  • *
  • 23
  • IXUS90IS / SD790IS
Re: First boot: a failure!
« Reply #16 on: 01 / October / 2008, 15:52:53 »
See below.
« Last Edit: 01 / October / 2008, 23:57:45 by brake »

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: First boot: a failure!
« Reply #17 on: 01 / October / 2008, 17:44:31 »
@brake

thanks again. I'll wait until you get it done, you've got your qemu setup to check what you're doing ...
besides, the encoded & the unencoded diskboot.bin are not equal in length, so that kind of broke my
overly simplistic reversing plan. Sleep well

wim

*

Offline brake

  • *
  • 23
  • IXUS90IS / SD790IS
Re: First boot: a failure!
« Reply #18 on: 01 / October / 2008, 23:59:04 »
I've tested it and it works.

Compile however you like, then:

./encoder <input-file> <output-file>

[Get files from further down this thread]
« Last Edit: 02 / October / 2008, 07:35:27 by brake »

*

Offline ma_jk

  • **
  • 60
Re: First boot: a failure!
« Reply #19 on: 02 / October / 2008, 03:52:14 »
Awesome Brake! and quicker than ever!
Now we can do much more...

 

Related Topics


SimplePortal © 2008-2014, SimplePortal