[unknown]
[unknown]
So -- putting more of the firmware into CHDK hasn't helped and neither has putting less of it in. I'm fresh out of ideas. Anybody out there have a new approach? :'(
Sorry for replying so late.
Observation:
* you have a program and expect it to behave in a specific way
* this program behaves differently than you expected.
* you (i.e. we) are sure that our little devices do exactly what they're told to do
Conclusion 1: The device executes a program that differs from what you have developed.
Conclusion 2: The program you developed is changed at some point, most probably on the device.
Resolution: Test what the device actually executes and fix your program if necessary.
You may want to use the function WriteSDCard which is used for the udumper, as well. It writes a portion of memory to a specific sector on the SD. WriteSDCard is part of the official firmware. Ask if you have trouble locating it.
Syntax: WriteSDCard(int drive, int startsector, int sectorcount, int memstart);
drive is always 0
startsector is the first sector on the SD that is written
sectorcount is the number of sectors that are written (1sector = 512bytes)
memstart is the first byte of memory that has to be written.
You
may have trouble writing the first few bytes of memory. In case your dump doesn't work, try 0x1900 as memory start:
WriteSDCard(0, 1024, 2048, 0x1900);
Writes 1mb (2048 sectors) of memory, starting at 0x1900 to the sd starting at sector 1024.
Make sure your card is empty so you don't overwrite data you still need.
further code example:
typedef int (*f_w)(int, int, int, int); // drive(?), start sector, number of sectors, address
f_w WriteSDCard; // "variable" declaration
WriteSDCard=(f_w)(0xFFxxxxxx); // set function pointer, use firmware-specific address
After you have the memory extracted, load it in IDA as additional file to the firmware. Now you can check if the device executes exactly the same code that you have written.
Cheers.