The
drwrap
DynamoRIO Extension provides function wrapping and replacing support.