Search code examples
clinuxbinaryexecutableinstrumentation

What is an Image and routine in binary instrumentation or binary code?


Hi while doing some binary instrumentation with Pin, I have come across terms like Image and routines. We can instrument before and after an Image is loaded and executed, similarly for Routines? What are they actually in-terms of executable files?

What I have understood a routine stands for methods/functions/procedures and an image may be the dynamic linking files or libraries with a collection of routines. Am I right?


Solution

  • I think you are talking about an executable image. An executable image is a compiled file in a special format, that runs on your system. An example might be something like the file used by a system to start Windows Word or Linux Splunk. Applications are built from one or more executable images.

    Routines are usually simple applications or building blocks of a larger application.

    Instrumentation may refer to adding routines to existing code that do things like profiling, calculating code coverage and so on. You can add debug "routines" to code in order to instrument it for example. Then with a compiler setting you can turn off/on whether the added code will execute. You turn off debugging for production (running code in a business environment rather than development environment).