Okay, this may sound like a more advanced technique (if it isn't, then I guess I'm really still a newbie. ). But I'm trying to copy a function from one program to another, not an address or anything, the whole function, assembly and all.

I am getting the function's base address with &MyFunction, but does this really work?
I tried to get the size by subtracting that from the address of a variable I placed directly after it, but I quickly realized that doesn't work. When I place another right before the function I see that the functions and variables aren't even stored in the same location in memory.

So... How do I get the starting point in memory of the function? And how do I get the function size?