views:

104

answers:

1

Hello ;-)

I have a newbie but really important question for me: I have a Mac Os X application that uses carbon api, but it is still a C++ application. I need to debug which functions are called at execution time and then make a C++ patch to replace one of those functions.

The real goal: I need to log all text printed into a chat window that the application has inside an unnacessible carbon view. I thought at first it was a cocoa application, but it's not, so fscript and imlib are no good to inject code.

Is it possible? Any clues? Thank you very much.

Cheers :)

A: 

You could look into using truss to figure out what system calls are being made but I'm not sure for user-calls. The LD_PRELOAD environment variable can allow you to inject methods into other apps, but C++ methods tend to have various dependencies regarding name mangling and calling method so it would probably be tricky to plug in your own.

Can you just have the app maintainer add actual hooks to allow for what you need?

Mark B
Thank you ;-) I have been studying around and using the following command:
flaab
$strings <app> I was able to find out the strings are C++ fsprint formatted. I will declare my own and inject them by using LD_PRELOAD: I will log all strings being processed matching a regular expression and that should do the trick. I will let you know how it went. Thank you ;)
flaab
I mean I will redeclare fsprintf and so on ;)
flaab