Is there a more or less reliable way to determine if data in some place in memory is the beginning of a processor instruction or some other data?
For example, E8 3F BD 6A 00 may be a call ( E8 ) command with a relative offset of 0x6ABD3F , or there may be three bytes of data belonging to some other command followed by push 0 ().
I know the question sounds silly and there probably isn't an easy way, but maybe a set of instructions was designed with that in mind, and maybe some simple code analysis of +100 bytes around the location might give an answer that, most likely correct.
I want to know this because I am looking at the program code and replacing all the calls with some function with my replacement calls. It works so far, but it is not impossible that at some point, when I increase the number of functions that I replace, some data will look exactly like a function call to this exact address, and will be replaced, and this will call a break in surprise. I want to reduce the likelihood of this.
source share