#include <dbg.hpp> // Loop through all trace events for (int i = 0; i < get_tev_qty(); i++) { regval_t esp; tev_info_t tev; // Get the trace event information get_tev_info(i, &tev); // If it's an instruction trace event... if (tev.type == tev_insn) { // Get ESP, store into &esp if (get_insn_tev_reg_val(i, "ESP", &esp)) // Display the value of ESP msg("TEV #%d before exec: %a\n", i, esp.ival); else msg("No ESP change for TEV #%d\n", i); } }