Question

Good morning,

Is it possible, using dyld interposition feature, to interpose this kind of C function ? 

typedef struct aStructure {
    IOReturn (*aCfunction)(void *self, UInt32 integer); // self is a 
                                                        // pointer to aStructure
} aStructure;

How the function is called:

aStructure **myStruct = ......;

(*myStruct)->aCfunction(myStruct, 1);
Was it helpful?

Solution

Probably only possible if you can figure out where the actual function is, and interpose that.

There will be code to initialize the function pointer field in the structure to point at an actual function and I guess that's where you need to change things.

Also, you calling line is slighly off, it needs to be

(*myStruct)->aCfunction(*myStruct, 1);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top