Questions tagged [function-interposition]

Replacing a function in a dynamic library by providing an alternative definition

31 questions
1
vote
2 answers

Is it possible to make an arbitrary program ignore signals?

Specifically on Mac OS X, is it possible to make a program ignore SIGTERM via DYLD_INSERT_LIBRARIES, in a way which works for any or most programs? I tried compiling and inserting this: #include #include #include void…
1
vote
1 answer

Checkpointing and restarting X11 applications

I want to checkpoint and restart X11 applications. I am using the BLCR (Berkeley Lab Checkpoint/Restart (BLCR)) tool. BLCR is not able (without modifications) to reinitiate the connection to the X-Server. I used an interposition library to log all…
OldMacDonald
  • 77
  • 2
  • 7
1
vote
2 answers

Function Interposing on OSX Mavericks

I followed the directions exactly as they are on this site here http://www.newosxbook.com/src.jl?tree=listings&file=4-5-interpose.c Here is the code from that page #include #include #include #include…
rubixibuc
  • 7,111
  • 18
  • 59
  • 98
1
vote
1 answer

Interpose C function defined as function pointer inside a structure

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 …
b1onic
  • 239
  • 2
  • 14
1
vote
1 answer

How can I get the PID of a new process before it executes?

So that I can do some injecting and interposing using the inject_and_interpose code, I need to way to get the PID of a newly-launched process (a typical closed-source user application) before it actually executes. To be clear, I need to do better…
0
votes
0 answers

Override global function like fopen/ofstream

I want to know what file is opened and in what mode and for this I want to override the global functions like fopen/ofstream and other file handling function Required: FILE* fopen(filename, mode){ //Our own fopen printf("%s-%s",filename,…
Karthik K M
  • 619
  • 2
  • 9
  • 24
0
votes
1 answer

Symbol interposition on macOS

I have a program that links against a shared library libfoo. I want to override one of the functions from libfoo inside my program, such that internal calls to that function from within libfoo resolve to the definition in my program. (For context,…
Ismail Badawi
  • 36,054
  • 7
  • 85
  • 97
0
votes
0 answers

Chrome does not start when preloading read system call using LD_PRELOAD

I am working on a project which requires wrapping libc system calls particularly file i/o calls like open, read, write, close etc. I am intending to use this as a monitoring service for the file operations. I have successfully wrapped all the calls…
0
votes
0 answers

Interposing code into an existing apk

Is it possible, given an existing apk, to interpose method calls? What about arbitrary lines of code? Ideally I would like to be able to intercept a method call/line of code and call my own method to do some checks or logging and then let the…
0
votes
1 answer

Creating parametric equations using points

I have points, x, y, and t, where t=1,...,Length[x]. I wished to make two parametric equation using the idea of interpolation, but not using the method in Mathematica. Any suggestion?
0
votes
2 answers

Polyfit and polyval to perform interpolation

I have x = linspace(-5,5,256) y = 1./(1+x.^2) plot(x,y,'...') %plot of (x,y) I want to estimate this with a polynomial of order 10, such that the polynomial intersects the graph at 11 points. So, I did this: x2 = linspace(-5,5,11) y2 =…
elbarto
  • 211
  • 3
  • 15
0
votes
1 answer

How to hook system calls of my android app

I want to intercept the connect() system call and use my own custom implementation. The custom implementation will do some action like printing a log for simplicity and then call the system implementation further. I looked at Audrey's blog where the…
0
votes
1 answer

[macosx]does dlopen call open and read functions?

I've intercepted(interposed) dlopen function under MacOS X and some other functions. I see how my applications calls dlopen in the log, but don't find anything related to open/read functions after dynamic library was dlopened. How does the system…
zbencik
  • 1
  • 1
0
votes
1 answer

Interposing library: XOpenDisplay

I am working on a project where I need to change the behaviour of the XOpenDisplay function defined in X11/Xlib.h. I have found an example, which should do exactly what I am looking for, but when I compile it, I get the following error…
0
votes
1 answer

Hook a C function

I want to hook the function AudioUnitInitialize to grab the Audio Unit of an application by injecting a bundle at the application start. I found an example (http://pastie.org/1882125) but it uses the function MSHookFunction to replace the function…
Paul Warkentin
  • 3,899
  • 3
  • 26
  • 35