I’ve recently started with x86 assembler, but I can’t find any method to know if a certain function exists in the code and if it’s been called in an execution or not.
For example, I’ve got a code with a function called “Sum”, I need a command or anything that let me know if “Sum” exists in the assembler code and it’s been called in an execution.
Thanks in advance
Luthor
There is no way to know if a function has been called already or not with making that function set some global memory somewhere to indicate its first use (al la
staticin C). in terms of knowing if it exists, this is also nigh impossible unless the function has an EAT entry, in which case you can useGetProcAddressto get the address, and check that it isn’t null.If you want to do this at ‘compile’ time however, you can tell if a function exists by trying to call it and let the assembler or linker toss an error at you if it doesn’t.
With all that being said, it sounds like you should rather be re-evaluating your approach, why exactly do you need to tell if a function has already been called and if it exists or not?