Port get_real_eip

This commit is contained in:
Fabian 2017-07-08 14:11:19 -05:00
parent 77c43a938a
commit ad06ea7bf4
2 changed files with 6 additions and 1 deletions

View file

@ -254,7 +254,6 @@ function V86Starter(options)
"_enter32": function() { return cpu.enter32.apply(cpu, arguments); },
"_update_eflags": function() { return cpu.update_eflags.apply(cpu, arguments); },
"_handle_irqs": function() { return cpu.handle_irqs.apply(cpu, arguments); },
"_get_real_eip": function() { return cpu.get_real_eip.apply(cpu, arguments); },
"_xchg8": function() { return cpu.xchg8.apply(cpu, arguments); },
"_xchg16": function() { return cpu.xchg16.apply(cpu, arguments); },
"_xchg16r": function() { return cpu.xchg16r.apply(cpu, arguments); },

View file

@ -721,3 +721,9 @@ int32_t read_moffs()
return get_seg_prefix(DS) + read_op16();
}
}
// Returns the "real" instruction pointer, without segment offset
int32_t get_real_eip()
{
return *instruction_pointer - get_seg(CS);
}