Get the "size" (length) of a C++ function?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4156585/how-to-get-the-length-of-a-function-in-bytes">How to get the length of a function in bytes?</a>  </p>
</blockquote>



<p>I'm making a Hooking program that will be used to insert a method into the specified section of memory. </p>

<p>I need to get the length of a local C++ function, I've used a cast to get the location of a function, but how would I get the length? </p>

<p>would </p>

<pre><code>int GetFuncLen()
{
  int i = 0;
  while((DWORD*)Function+i&lt;max)
  {
    if((DWORD*)Function+i==0xC3)
    {
      return i;
    }
    i++;
  }
}
</code></pre>

<p>work?</p>
