Skip to content

Commit

Permalink
[FEATURE] Make Disasm Start required for logging instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Aug 24, 2024
1 parent 57a8604 commit 00939fd
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions TinyTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
* TinyTracer, CC by: [email protected]
* Runs with: Intel PIN (https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool)
*
* Prints to <output_file> addresses of transitions from one sections to another
* (helpful in finding OEP of packed file)
* args:
* -m <module_name> ; Analysed module name (by default same as app name)
* -o <output_path> Output file
*
* Documentation: https://github.com/hasherezade/tiny_tracer/wiki
*/
#include "pin.H"

Expand Down Expand Up @@ -900,15 +895,16 @@ VOID LogInstruction(const CONTEXT* ctxt, THREADID tid, VOID *str)

VOID InstrumentInstruction(INS ins, VOID *v)
{
if (m_Settings.disasmStart || m_Settings.disasmStop)
INS_InsertCall(
ins,
IPOINT_BEFORE, (AFUNPTR)LogInstruction,
IARG_CONTEXT,
IARG_THREAD_ID,
IARG_PTR, new std::string(INS_Disassemble(ins)),
IARG_END
);
if (m_Settings.disasmStart) {
INS_InsertCall(
ins,
IPOINT_BEFORE, (AFUNPTR)LogInstruction,
IARG_CONTEXT,
IARG_THREAD_ID,
IARG_PTR, new std::string(INS_Disassemble(ins)),
IARG_END
);
}
if (m_Settings.stopOffsets.size() > 0 && m_Settings.stopOffsetTime) {
INS_InsertCall(
ins,
Expand Down

0 comments on commit 00939fd

Please sign in to comment.