Is it even possible? I was asked about the values that appear on the stack, in a way that without knowing the var type, just by analyzing the bytes I should be able to recognize if it’s an address or a local variable.
6
It is not possible to determine the type of a variable just by analyzing its bytes on the stack; this is because bytes on the stack can represent different types of data depending on the context in which they are used. For example, a sequence of bytes on the stack could represent integer, floating-point number, pointer to an object, or even a string. Without additional information about the program’s memory layout and data types, it is impossible to determine the type of a variable just by looking at its bytes on the stack. To determine the type of a variable in C, you need to know its declaration and the context in which it is used. Without this information, it is impossible to determine the type of a variable just by analyzing its bytes on the stack.