-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Make Disasm Start required for logging instructions
- Loading branch information
1 parent
57a8604
commit 00939fd
Showing
1 changed file
with
11 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
||
|
@@ -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, | ||
|