How to hijack tasks? - General Discussion and Assistance - CHDK Forum supplierdeeply

How to hijack tasks?

  • 5 Replies
  • 3678 Views
*

Offline RaduP

  • *****
  • 926
How to hijack tasks?
« on: 18 / October / 2009, 14:52:25 »
Advertisements
After I am done with the SD980 port, I would like to attempt to get the touchscreen x/y data as well as possibly making some changes in the JPEG processing engine (for example, to remove the sharpening and NR).
To do that, I'd have to hijack some tasks, similar to how the exposure, keyboard and jogdial are hijacked.
The question is, how do I find the exact entry point to them, in such a way that they can be added to the taskCreateHook function?

*

Offline reyalp

  • ******
  • 14110
Re: How to hijack tasks?
« Reply #1 on: 18 / October / 2009, 17:48:50 »
Find the task name string (most have fairly obvious names)
Find a function that references the task name and one of the task creation functions (there are several, referred to in the IDA sigs as CreateTask and KernCreateTask)
The task function will be close by. You can figure out the exact order of arguments by looking at other places tasks are created.

I'm shocked you've got this far without understanding this.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 926
Re: How to hijack tasks?
« Reply #2 on: 18 / October / 2009, 20:04:03 »
Well, being able to find the tasks that are already done on a different camera is easy, not much understanding required :) But I never really understood the exact process of finding them, I did not see much documentation about it. I am not really good at hacking stuff, this is, in fact, the first project of mine where I need to disassembly stuff (and to make it worse, it's ARM :D )

*

Offline RaduP

  • *****
  • 926
Re: How to hijack tasks?
« Reply #3 on: 20 / October / 2009, 01:10:44 »
Wow, I found the touch panel task from the first try :D
What made it easy was my empirical observation that the tasks have no return point. So I searched for touch, and eventually found TouchPanelDriver.c
One of the functions using it was noreturn, then I tried my LED blinking magic in boot.c, and it worked.


*

Offline RaduP

  • *****
  • 926
Re: How to hijack tasks?
« Reply #4 on: 20 / October / 2009, 02:30:26 »
And I got the location for x/y clicks :)
Since I suck at ARM assembly, I just looked for the general memory area that this particular task manipulates, then I displayed it all on screen (only 40 ints or so) then it was pretty easy.
The x/y data only changes when you 'click' on the touchscreen, not if you move your finger along. I think that's somewhere else, and need to decode that information, because it doesn't seem very straight forward.

*

Offline RaduP

  • *****
  • 926
Re: How to hijack tasks?
« Reply #5 on: 20 / October / 2009, 04:11:46 »
Now, if I could actually clear the screen, I could implement some nice menus :)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal