How low are you willing to go? The easeist thing is to overwrite the first 5 bytes of the function with "jmp yourfunction". In assembly, I think (not 100% positive) that a jmp is E8 xx xx xx xx, where xx is the offset. That is, xx is the distance from the code you're patching to the code you want to run, in bytes. Once it's replaced, a call to that function will immediately jump to yours, and when you return your function will return to the normal spot, since the stack is intact.
(The opcode might also be EB xx xx xx xx, I haven't used machine code for awhile)
If you need more help with this, let me know.