Questions tagged [interposing]

13 questions
9
votes
3 answers

Is it possible to override static functions in an object module (gcc, ld, x86, objcopy)?

Is there a way to override functions with static scope within an object module? If I start with something like this, a module with global symbol "foo" is a function that calls local symbol "bar," that calls local symbol "baz" [scameron@localhost…
smcameron
  • 1,307
  • 8
  • 8
9
votes
3 answers

Why won't LD_PRELOAD work with Python?

Using function interposition for open() with Python doesn't seem to work after the first few calls. I suspect Python is doing some kind of initialization, or something is temporarily bypassing my function. Here the open call is clearly hooked: $ cat…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
4
votes
1 answer

Interposing of OS X system calls

I need to interpose (get my functions called instead of the original functions) some OS X system calls to overcome a flaw in a piece of closed-source software. Preferably, the resulting solution would work under 10.5 (Leopard) and newer, but I might…
3
votes
1 answer

Stack Smashing in Java Interposer

I am writing a Java interposer to modify network communication related system calls. Basically, I want to modify the IP and port of the intended recipient. The code works correctly on my laptop, but on university PC, it gives a stack smashing error…
Muhammad Waqar
  • 849
  • 2
  • 13
  • 29
2
votes
1 answer

Interposing on OSX, my function not being called

So, I'm messing around with some interposing code on OSX (gcc 4.2.1) and I'm trying to get the following to work: When I call ./login using the DYLD_INSERT_LIBRARIES=my.dylib, it should override the default login implementation and use my custom…
mr-sk
  • 13,174
  • 11
  • 66
  • 101
2
votes
1 answer

Can OS X system calls be overridden or interposed on a system-wide basis?

Working under OS X Lion, I've done some work with code injection to interpose system calls on a process-by-process basis recently. I've learned a lot along the way, and it now looks like it would make more sense, at least for research purposes, to…
bland328
  • 319
  • 1
  • 4
  • 13
1
vote
1 answer

Interposing on Java Class Methods (without interfaces)

I'd like to interpose between class methods to dynamically extends an object. I already know about the java.lang.reflect.Proxy stuff, but it's way too limited to do real interposing. From Using java.lang.reflect.Proxy to Interpose on Java Class…
Renaud Cerrato
  • 1,297
  • 16
  • 20
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…
1
vote
1 answer

Safari and getaddrinfo interposing

I've written a small dynamic library that interposes calls to getaddrinfo and connect. I insert this library using DYLD_INSERT_LIBRARIES on Firefox and Safari to hijack requests for www.apple.com and send them to www.microsoft.com. The code works…
0
votes
1 answer

Reason for my interposer classes not being compiled?

I have: unit unt_QuantumGridInterceptor; {$OPTIMIZATION OFF} interface uses { DevExpress } cxGridRows, cxGridTableView, cxGridCustomTableView, cxCustomData, cxGraphics; type TcxGridDataCellViewInfo =…
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
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
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

Library insertion/injection not work with open command

I writed a dynamic library that loaded into target application by environment variable DYLD_INSERT_LIBRARIES, the dylib works fine when application executed from terminal by this commands: $ export DYLD_INSERT_LIBRARIES=/path/to/mylib.dylib $…
mh taqia
  • 3,506
  • 1
  • 24
  • 35