How to guess in which address is located a variable

L00PeR
6 years ago | edited 6 years ago

0

Hi, my question is simple, there’s any way of guessing the address in which a variable of a program is located??

For example, if I have this program.
```

include

include <conio.h>

int main(){
int x = 6;
getch();
return 0;
}
```
How can I guess where is x located (Without modifying this program)?

I could just use cheat engine, but in some applications, like for instance, the Windows 10 calculator, you just can’t guess the address with Cheat Engine.
Any help? :)

10replies
4voices
228views
SIGKILL [r4v463]
6 years ago

0

You can use a debugger to run your application and see exactly where in the stack x is located.

L00PeR
6 years ago

0

Any video(s) which introduce you into reverse engineering??

IDA pro or ollydbg?

SIGKILL [r4v463]
6 years ago

0

No videos but this link

L00PeR
6 years ago

0

Ok, thanks I’ll check it :)

SIGKILL [r4v463]
6 years ago

0

You’re welcome, you can also check other challenges websites that have levels in cracking/RE, root-me has good challenges.

L00PeR
6 years ago

0

Hi, after learning something about RE and learning to use ollydbg, I’ve been trying to do what I was asking at the beggining of the thread, but I found another problem:
0x008D245E | C745 F8 05000000 | [MOC DWORD PTR SS:[EBP-8],6

If you modify the number at the end, the number it displays when you run the program, will change.

The problem is that I can’t read nor modify this number with C++, as is not really stored in the memory; is just part of the program…. isn’t it?

dloser
6 years ago

0

“with C++”??

It’s part of the program, but the program is read into memory when you run it. You could do it with ollydbg, right?

L00PeR
6 years ago

0

I could, but I want to do it with c++ so I can automatize that.

Imagine I had a game, and I wanted to have infinite life, I would need to guess where’s the address of the life and then create a program with c++ that attached to the process read the memory etc.

The problem is that, at least in this program, which is much more simple than a game, the variable isn’t really stored in memory, but is inside the asm code!!
And I can’t modify the asm code from c++!

mychris
6 years ago

0

i know this two site, it’s for me interresting site with a lot of tuto

http://opensecuritytraining.info/Training.html

http://www.securitytube.net/

good hacking :)

dloser
6 years ago

0

What is ollydbg other than a program (possibly even written in C++)? Anything it can do, you can do in C++.

You must be logged in to reply to this discussion. Login
1 of 11

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss