implement x86/x64 libpatch_patch