How does one transfer the program counter / instruction pointer to a variable in C++?
I want to be able to:
1) obtain the current execution address
2) pass that address to another function (f)
3) in function (f), check the integrity of the calling function's code and/or modify it
This seems to require at least some assembly code. I presume that I could check the actual addresses in question in a disassembler and hard-code them into my program, but that would be tedious.
1) How to obtain the start address of a function?
2) How to obtain the address of a label?
In C++ (VC5) I always get the error: 'illegal operation on bound member function expression' when I try to take the address of a function.