I was reading this question because I\'m trying to find the size of a function in a C++ program, It is hinted at that there may be a way that is platform specific. My target
No, this will not work:
ret
instruction.ret
, you can't just look at the individual bytes - because the corresponding value could appear as simply a value, rather than an instruction.The first problem can possibly be worked around if you restrict your coding style to, say, only have a single point of return in your function, but the other basically requires a disassembler so you can tell the individual instructions apart.