I don't understand why, in
SX20, the value(s) in taskCreateHook, such as:
...
if (p[0]==0xFF89A8CC) p[0]=(int)init_file_modules_task;
...
do not match the address in the firmware itself. The ASM code in init_file_modules_task does exist in the firmware, but it starts at address: ff89c2c4 and not FF89A8CC. Why the huge difference (almost 0x2000 bytes)?
I've checked the
SX10 port: there's a perfect correspondence between the values found in taskCreateHook and the addresses in the firmware (for JogDial and init_file_modules_task at least).
I did identify the JogDial task in
SX20 firmware (starting at address 0xff86029c) however, JogDial_task_my() wasn't executed if I used the 0xff86029c as equality check in taskCreateHook. I tried to understand what is the *p in the taskCreateHook.
After some lost battles with the code, and I found that taskCreateHook is called with 67 different addresses (how did I find it? I modified the get_prop in ubasic to show me some arrays that I populate in boot.c / taskCreateHook, which I then printed on the screen using print commands within a script).
BTW: I love Canon, I will always buy Canon - so many things going on on this little thing, I'm amazed!
Pour revenir a nos moutons: I needed a way to narrow down these 67 values. I was sure that one of them is the JogDial task address - but oh, 67 to check! Eventually, I tought that if there's such a discrepancy (~0x2000 bytes) for init_file_modules_task, what if the same applies for JogDial task? I might as well try to find which of 67s *p values are within +/- 0x2000 bytes from the real one in the firmware.
Lo and behold! I ended up with 4 values. Acceptable but risky a bit (I was not checking 63 left).
I proceeded to update the taskCreateHook with each of the 4 values, hoping to see the JogDial affected somehow. Murphy effect applied, only the last value had an effect. The other three values either crashed the camera, or the JogDial worked as before, scrolling both the selected menu item as well as the pictures in preview mode.
The fourth one blocked the JogDial completly, absolutely no movement of rotation - only navigate up, down, left, right.
I'm thus happy that the JogDial doesn't work anymore 😁 😳 .
Value is:
if (p[0]==0xff85f3cc) p[0]=(int)JogDial_task_my;
neszt: how did you find the other values in taskCreateHook ?