| View previous topic :: View next topic |
| Author |
Message |
da_cL0ner How do I cheat?
Reputation: 0
Joined: 28 Jan 2019 Posts: 4
|
Posted: Mon Jan 28, 2019 9:56 am Post subject: Finding Address Of A Value In A Self Written Game |
|
|
Hey there,
I've written a simple game which the health is decreased or increased using buttons. I started to hack the health value but couldn't find it.
I've tried enabling Or disabling fast scan & All types of values including byte, 2 byte, 4 byte, 8 byte, float, double & string but none of them showed me the value
I guess that the value is string but I tried string scanning with & without "Case Sensitive", "Writable", "Executable", "CopyOnWrite" options
Can Anyone out here help me find it?
The Game is written in windows form C# and the code for decreasing life is:
| Code: |
private void button1_Click(object sender, EventArgs e)
{
if (this.label4.Text != "0")
{
if (this.label4.Text == "10")
this.label4.Text = "0";
if (this.label4.Text == "20")
this.label4.Text = "10";
if (this.label4.Text == "30")
this.label4.Text = "20";
if (this.label4.Text == "40")
this.label4.Text = "30";
if (this.label4.Text == "50")
this.label4.Text = "40";
if (this.label4.Text == "60")
this.label4.Text = "50";
if (this.label4.Text == "70")
this.label4.Text = "60";
if (this.label4.Text == "80")
this.label4.Text = "70";
if (this.label4.Text == "90")
this.label4.Text = "80";
if (this.label4.Text == "100")
this.label4.Text = "90";
}
|
where button1 is the button that decreases health & label4.Text is representing health value.
Thank You... _________________
Nothing Is True;
Every Thing Is Permitted |
|
| Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Mon Jan 28, 2019 2:02 pm Post subject: |
|
|
this is not a useful post, but if you cant hack your own program .. then . _________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
| STN wrote: | | i am a sweetheart. |
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Mon Jan 28, 2019 3:05 pm Post subject: |
|
|
strings are difficult because they get reallocated when replaced by a different string _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
da_cL0ner How do I cheat?
Reputation: 0
Joined: 28 Jan 2019 Posts: 4
|
Posted: Mon Jan 28, 2019 4:35 pm Post subject: |
|
|
Thanks Dark Byte for your reply,
I'm kinda new in your cool CE so can you show me a way on how to find the value address for this?  |
|
| Back to top |
|
 |
LeonBlade How do I cheat?
Reputation: 0
Joined: 25 Jan 2019 Posts: 9
|
Posted: Mon Jan 28, 2019 8:04 pm Post subject: |
|
|
First off, I think you might want to reconsider how you're programming the health, that will save you a lot of hassle. If string memory is reallocated randomly then that means the only way you can "hack" your health value is to change the assembly instructions to stop it from doing that.
The reason you couldn't scan for number values if because you don't have a single number type in that function.
If you want to use a number for your health value instead, you'll be able to "hack" it a lot easier. You would define a variable for health outside of your function and then do arithmetic on it every time you click as you are now and update the label to equal your health variable.
| Code: |
int myHealth = 100;
private void button1_Click(object sender, EventArgs e)
{
// don't go under 0 health
if (myHealth > 0)
{
myHealth -= 10;
this.label4.Text = myHealth.ToString();
}
}
|
This isn't the best way, but it's a start in the right direction. If you make these changes you'll find that if you scan for a 4 byte value for your number you'll find your health. This is because you're finding the variable "myHealth" in memory. Now you could change it to 1000 for example and next time you click your button it will be 990 (because it subtracts 10 from 1000).
I hope this helps however way you want to approach this problem.[/code] |
|
| Back to top |
|
 |
da_cL0ner How do I cheat?
Reputation: 0
Joined: 28 Jan 2019 Posts: 4
|
Posted: Tue Jan 29, 2019 2:08 am Post subject: |
|
|
| LeonBlade wrote: | First off, I think you might want to reconsider how you're programming the health, that will save you a lot of hassle. If string memory is reallocated randomly then that means the only way you can "hack" your health value is to change the assembly instructions to stop it from doing that.
The reason you couldn't scan for number values if because you don't have a single number type in that function.
If you want to use a number for your health value instead, you'll be able to "hack" it a lot easier. You would define a variable for health outside of your function and then do arithmetic on it every time you click as you are now and update the label to equal your health variable.
| Code: |
int myHealth = 100;
private void button1_Click(object sender, EventArgs e)
{
// don't go under 0 health
if (myHealth > 0)
{
myHealth -= 10;
this.label4.Text = myHealth.ToString();
}
}
|
This isn't the best way, but it's a start in the right direction. If you make these changes you'll find that if you scan for a 4 byte value for your number you'll find your health. This is because you're finding the variable "myHealth" in memory. Now you could change it to 1000 for example and next time you click your button it will be 990 (because it subtracts 10 from 1000).
I hope this helps however way you want to approach this problem.[/code] |
LeonBlade, Thank you so much for your reply & I appreciate it
But I have already tried hacking integer type values & I'm trying to learn hacking/editing string type values. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Tue Jan 29, 2019 2:15 am Post subject: |
|
|
Try a different programming language to learn that first, or use a different form of assigning.
e.g
| Code: |
this.label4.Text = myHealth.ToString();
|
Will change the pointer of label4.Text because it reallocates the string _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
da_cL0ner How do I cheat?
Reputation: 0
Joined: 28 Jan 2019 Posts: 4
|
Posted: Tue Jan 29, 2019 2:32 am Post subject: |
|
|
| Dark Byte wrote: | Try a different programming language to learn that first, or use a different form of assigning.
e.g
| Code: |
this.label4.Text = myHealth.ToString();
|
Will change the pointer of label4.Text because it reallocates the string |
Alright then, thanks. |
|
| Back to top |
|
 |
|