For swallowing an unknown application whole, I'm a big fan of logs and log messages.
One of these days I'll be in a system that I can just set the log aspect up and it will do what I want, but in the past I have actually put in log messages at beginning and sometimes ending of most methods and functions. And then run the app and watch the logs. Much of the time I have been able to label the messages a diagnostic level and leave the code in but turned off. Certainly in C/C++ you can do this with ifdef and choose to include it or not.
For swallowing an unknown application whole, I'm a big fan of logs and log messages. One of these days I'll be in a system that I can just set the log aspect up and it will do what I want, but in the past I have actually put in log messages at beginning and sometimes ending of most methods and functions. And then run the app and watch the logs. Much of the time I have been able to label the messages a diagnostic level and leave the code in but turned off. Certainly in C/C++ you can do this with ifdef and choose to include it or not.