R
R
rusianvodka2014-05-12 23:15:25
C++ / C#
rusianvodka, 2014-05-12 23:15:25

How to get variables from compiled executable?

Hello Dear Ladies and Gentlemen.
The essence of the question is how to get all the declared variables from the compiled executable?
That is, for example, there is a code.

#define  as 340 
void main(){
  int a=245;
  int b=0x34;
  cin >> b;
  if ( b > a )
  {
    cout << "b>a";
  }
  else
  {
    cout << "b<a";
  }
  _getch();
}

After it is compiled and the executable file test.exe is obtained.
How can you get all the variables a,b,as from this file?
What to read, what to know?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey, 2014-05-13
Protko @Fesor

well, if this code was compiled in the release and with optimizations, then ... no way.
For example, in the above code, the compiler will be able to calculate and fulfill all the conditions at the time of compilation, and you will not have any variables at all, only the output.

B
Boxxy, 2014-05-12
@Boxxy

Reverse engineering. It's reverse engineering. The topic is extensive, but this is what you are interested in.

R
rusianvodka, 2014-05-13
@rusianvodka

That is, there is no table where all the variables are listed in the exe file, numbers are something like that.

J
Juster, 2014-05-14
@Juster

What does "get declared variables" mean? Do you need variable names or values?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question