libpayload: x86/exec - simplify and robustify the code
Simplify the code by directly using the arguments on the stack as base
pointer relative memory references, instead of loading them into
intermediate registers first.
Make it more robust by preserving all callee saved registers mandated by
the C calling convention (and only those), namely EBP, EBX, ESI and EDI.
Don't assume anything about the register state when the called function
returns -- beside the segment registers and the stack pointer to be
still the same as before the call.
Signed-off-by: Mathias Krause <email@example.com>
Reviewed-by: Aaron Durbin <firstname.lastname@example.org>
Tested-by: build bot (Jenkins)
1 file changed