There is more than just hope to rely on.
Diverse Double-Compiling[0] can provably detect this class of attack.
Diverse Double-Compiling[0] can provably detect this class of attack.
...unless you're dealing with an attacker with vastly more resources than you, and a will to spend it. It's always worth keeping in mind that the way magic tricks work is usually because the performer invested much more time and effort in preparation and practice than anyone in the audience would consider reasonable.