I thought getting the first instruction would be easy. Becuase I ran some tests and the first instruction was essentially the address of the function. But just now, I ran into a snag. I tried making some other function, and this time the address of the function was not the address of the first instruction, but it was the address to the jmp instruction that had the real address of the next instruction.
So how can I know if the first address is a jmp to the real address or if the first address is the address itself?
Essentially, I want to be able to do this:
void function()
{
push ebp
mov ebp,esp
sub esp,0C0h
push ebx
push esi
push edi
// other stuff
}
dword i1 = sizeofinstr(function); // return sizeof push instruction (1)
dword i2 = sizeofinstr(function + i1); // return sizeof mov instruction (2)
dword i3 = sizeofinstr(function + i2); // return sizeof sub instruction (6)
// etc...
How will I know when the function ends? Is there a standard terminate function byte or soemthing?












