Static addresses to Dynamic
Using ReadProcessMemory/WriteProcessMemory APIs you can change variable values in memory.
I am developing an application that I do not want to be hacked.
Static address is 1 address, it never changes (ex: &H1005FD1)
But Dynamic address constantly changes( With everystartup it changes. (ex: &H100000 can change into &H2641949)
Right now im using code:
Code:
Module 1:
public Usage as integer
public Money(32768) as integer
Form1:
Private sub Form_Load()
Randomize
usage = rnd * 32769
End Sub
Private sub Command1_Click()
Money(usage) = text1.text
End Sub
But are there any other ways?
Re: Static addresses to Dynamic
That sample code would fail: one only needed to know the memory pointer of "usage" variable and they'd know where to find the information. The information would be available from Text1 and contents of it are rather easy to find out simply by finding the correct hWnd. You'd need greater and far more complex solutions.
To protect your application very well you'd need a lot more low level knowledge of how things work; more than I know; possibly more than anyone who posts regularly on these forums these days. In the end it comes down to a few questions:
Why in the world would anyone want to hack your application?
What needs to be protected? Who are the people you want to prevent getting into your application?
Crypting is what you could do to data, basically you'd keep the important data crypted with a strong method all the time, only making it usable (decrypting) when you need it. And immediately when you don't need it anymore you should put it away. This would be much easier and it would still be rather effective. CVMichael has done a lot on this front. It doesn't protect against the best, but it would be a very good protection against a majority of people who might want to try out some low level of hacking attempts, such a directly reading the memory.
Not to say I'd be an expert of any kind on this subject, but I know enough to know that it is something hard to achieve; depending on what you really need, of course.
Re: Static addresses to Dynamic
The textbox was just an example.
it was for testing.
Lets say that application is a game, people can cheat it by writeprocessmemory API.
People can then create trainers for the game.
But it would be alot harder to make a trainer for the game if all the addresses are dynamic.
also, how can people get the address of Usage when they dont know the value of it.
Re: Static addresses to Dynamic
Some people are able to read machine code that the program consists of, thus being able to simply read what your code is doing. For someone with some experience on the subject it wouldn't take long to figure out the trick.
One clever solution would be to make a class module to hold the important data. You could optionally store it encrypted there. Then you could simply clone the class, thus creating a new class, and destroy the old one. Suddenly your data is in a new location. This ought to be hard enough to figure out quickly and may give safety for a long time. Depends on how skilled people there are.
Re: Static addresses to Dynamic
How could i "clone" a class and destory the old class?
Re: Static addresses to Dynamic
Quote:
Originally Posted by masterkert3
How could i "clone" a class and destory the old class?
A thread popped up on this a few days ago
A Form is also a class which can be cloned and set to nothing.
Be aware that it is practically impossible to make something unhackable, if a machine can read it then others can too, all you can do is make it difficult.
Also be aware that for every dynamically positioned piece of data, there is something static which points to it.