iterator.context is undefined
K4r1it0 opened this issue · 0 comments
K4r1it0 commented
transform iterator.context is always undefined is this normal?
[Local::PID::1590667 ]-> TypeError: cannot read property 'rax' of undefined
at transform (<input>:19)
Process.enumerateThreads().forEach(thread => {
Stalker.follow(thread.id, {
events: {
call: true, // Call events can be enabled if needed
ret: false, // Return events
exec: false, // Execution events
block: false, // Block events
compile: false // Compilation events
},
onReceive(events) {
// Process the captured events if needed
},
transform: function (iterator) {
var instruction = iterator.next();
do {
if (instruction.mnemonic === 'syscall') {
const context = iterator.context;
console.log(context);
console.log('Syscall number (from rax): ' + context.rax);
// Additional logic for syscall handling
}
iterator.keep();
} while (iterator.next() !== null);
}
});
});