31
TI-Nspire / Re: Send Key event
« on: April 10, 2014, 04:03:03 pm »
Ok, is hooking easy? Is there any example?
I noticed that (in 3 different "examples") there are some "parts" which are almost in every hook example (i dont understand them anyway)
HOOK_INSTALL();
HOOK_ADDR
HOOK_VALUE
HOOK_DEFINE
(Is used in every example but the function is defined, so its not a real included function?)
HOOK_RESTORE_RETURN();
HOOK_SAVED_REGS();
In nClock the hook seems to be easier:
But i wonder what the hook_addr[] and hook_values[] is.
Is a hook_addr a ram address and hook_value is the value?
What do these lines mean?
#define HOOK_ADDR (...);
#define HOOK_VALUE(...);
What line exactly does "install" the hook (Or is it a combination of everything?)?
I know these are a lot of questions but i'd be really happy to find some answers
I noticed that (in 3 different "examples") there are some "parts" which are almost in every hook example (i dont understand them anyway)
HOOK_INSTALL();
HOOK_ADDR
HOOK_VALUE
HOOK_DEFINE
(Is used in every example but the function is defined, so its not a real included function?)
HOOK_RESTORE_RETURN();
HOOK_SAVED_REGS();
In nClock the hook seems to be easier:
Code: [Select]
static const int hook_addrs[] = {0x100B66C8, 0x100B6988, // Clickpad / Touchpad 3.1
0x100EAAAC, 0x100EADC4, // CX 3.1
0x100E72CC, 0x100E75E4, // CM 3.1
0x101122b8, 0x100eb288, // Clickpad / Touchpad 3.6
0x10111cfc, 0x1011201C}; // CX 3.6
#define HOOK_ADDR (nl_osvalue((int*)hook_addrs, sizeof(hook_addrs)/sizeof(hook_addrs[0])))
static const int hook_values[] = {0xe92d47f0, 0xe92d47f0,
0xE59F1030, 0xE59F1030,
0xE59F1030, 0xE59F1030,
0xE59F1030, 0xE59F1030,
0xE59F1030, 0xE59F1030};
#define HOOK_VALUE (nl_osvalue((int*)hook_values, sizeof(hook_values)/sizeof(hook_values[0])))
HOOK_DEFINE(hook_nclock) {
if(!*noMiniClock)
mini_nclock(1);
HOOK_RESTORE_RETURN(hook_nclock);
}
But i wonder what the hook_addr[] and hook_values[] is.
Is a hook_addr a ram address and hook_value is the value?
What do these lines mean?
#define HOOK_ADDR (...);
#define HOOK_VALUE(...);
What line exactly does "install" the hook (Or is it a combination of everything?)?
I know these are a lot of questions but i'd be really happy to find some answers