Consider volatile registers destroyed on function calls unless otherwise safety-provable by analysis such as whole program optimization.
That last line is the rub. It seems skyrim does have some amount of this in it. At the very least, the level exp patch comes after a call and assumes rcx is preserved across that call.
In order to be super safe, it seems I will need to inject saveall/restoreall in every wrapper, not just the ones which aren't replacing a call.
According to the x64 calling convention spec:
That last line is the rub. It seems skyrim does have some amount of this in it. At the very least, the level exp patch comes after a call and assumes rcx is preserved across that call.
In order to be super safe, it seems I will need to inject saveall/restoreall in every wrapper, not just the ones which aren't replacing a call.