Updated to use more generic x86 patching code.