View previous topic :: View next topic |
Author |
Message |
Undercoversn How do I cheat?
Reputation: 0
Joined: 09 Aug 2015 Posts: 5
|
Posted: Sun Aug 09, 2015 2:43 am Post subject: [C#] Getting values from memory and small questions |
|
|
Hi,
I'm trying to make a special trainer for Dark Souls 1/2 in C#, I've watched some video's and it looks pretty easy. Now I've found a Dark Souls 2 table with some pointers and offsets but I'm wondering what values I should use.
These are the pointers/offsets I'm going to use:
Code: | <CheatEntry>
<ID>4</ID>
<Description>"Health"</Description>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>DarkSoulsII.exe+FB3E3C</Address>
<Offsets>
<Offset>FC</Offset>
<Offset>74</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>7</ID>
<Description>"Max Health"</Description>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>DarkSoulsII.exe+FB3E3C</Address>
<Offsets>
<Offset>104</Offset>
<Offset>74</Offset>
</Offsets>
</CheatEntry> |
This is my C# template code (very incomplete):
Code: | Note: I'll have some other vars (ints) to save the maxhp, currenthp, tofillhp, ...
bool UnlimitedHealth = false;
string HealthPointer = "004CF220"; //incorrect value
int[] HealthOffset = { 0x2 }; //incorrect value
int HealthToFill = <calculated value>;
the following is triggered when the user presses a key or click enable:
int bytesWritten;
byte[] valueToWrite = BitConverter.GetBytes(HealthToFill);
string writtenAddress = myMemory.PointerWrite((IntPtr)pointerAddress, valueToWrite, pointerOffset, out bytesWritten);
myMemory.CloseHandle();
On button click this gets activated.
|
To clarify what I want to do with Dark Souls 1/2 is to create a trainer that makes the game easier for the people that just want to enjoy the game, but not unlimited health. What I want to do is take the current health for ex. 7000, detect changes for ex (-1000), devide the change by 2 and add it to the health pool. And set max to 6500 so it doesn't loop. Also when healing (health goes up) i could set an if statement that it doesn't do the calculation/halfing. When dead I'd pause it. I'd make it perfect but I just need a push in the right direction.
I know C# but I never tried memory editing before, is what I'm trying to do possible? How do I get the game values? Thanks!
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Aug 09, 2015 5:40 am Post subject: |
|
|
Yes you are entirely able to do what you are asking. Here is some pseudo code to simulate what you are asking:
Code: | int prevHealth = 0;
while (true)
{
// Read the current health value..
int currHealth = ReadHealthValue();
// Set our previous health value if it has not been set yet..
if (prevHealth == 0)
{
prevHealth = currHealth;
continue;
}
// Next check for differences in health..
if ((currHealth < prevHealth) && (prevHealth - currHealth) >= 1000)
{
currHealth /= 2;
SetHealthValue(prevHealth + currHealth);
}
} |
Granted based on your post it does not sound like you are really familiar with C# or making a trainer with it. I would suggest taking the time to learn the language first so you understand what you are doing and not just copy/pasting a bunch of code from random YouTube videos and not really understanding how to use it.
_________________
- Retired. |
|
Back to top |
|
 |
Undercoversn How do I cheat?
Reputation: 0
Joined: 09 Aug 2015 Posts: 5
|
Posted: Sun Aug 09, 2015 6:00 am Post subject: |
|
|
atom0s wrote: | Yes you are entirely able to do what you are asking. Here is some pseudo code to simulate what you are asking:
Code: | int prevHealth = 0;
while (true)
{
// Read the current health value..
int currHealth = ReadHealthValue();
// Set our previous health value if it has not been set yet..
if (prevHealth == 0)
{
prevHealth = currHealth;
continue;
}
// Next check for differences in health..
if ((currHealth < prevHealth) && (prevHealth - currHealth) >= 1000)
{
currHealth /= 2;
SetHealthValue(prevHealth + currHealth);
}
} |
Granted based on your post it does not sound like you are really familiar with C# or making a trainer with it. I would suggest taking the time to learn the language first so you understand what you are doing and not just copy/pasting a bunch of code from random YouTube videos and not really understanding how to use it. |
Hi, thanks for taking your time to help me out. I'm not that familiar with making trainers or memory editing, I'm currently learning the language at college and indeed my knowledge is limited to what they teach me, but I'm willing to learn more when I have time I should've said understanding of C#.
What about the pointers? I'm a little bit confused as the pointer I have for health adjustment has 2 offsets, do I combine em? I've made a trainer for small games like dlc quest but the pointers i've used never looked like "DarkSoulsII.exe+FB3E3C". That's all I need to know.
Thanks for your assistance! =)
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Aug 09, 2015 8:06 am Post subject: |
|
|
Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
There is your health.
|
|
Back to top |
|
 |
Undercoversn How do I cheat?
Reputation: 0
Joined: 09 Aug 2015 Posts: 5
|
Posted: Sun Aug 09, 2015 8:24 am Post subject: |
|
|
Zanzer wrote: | Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
There is your health. |
Thanks! I'll try it when I get home! Problem solved then
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
Undercoversn How do I cheat?
Reputation: 0
Joined: 09 Aug 2015 Posts: 5
|
Posted: Sun Aug 09, 2015 1:24 pm Post subject: |
|
|
Ok thanks for the link !!
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25805 Location: The netherlands
|
Posted: Sun Aug 09, 2015 1:42 pm Post subject: |
|
|
Zanzer wrote: | Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
There is your health. |
Best turn the offset around (as they are stored the way the pointer window shows them, which is from bottom to top )
Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
There is your health.
_________________
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Aug 09, 2015 1:52 pm Post subject: |
|
|
Woops
|
|
Back to top |
|
 |
Undercoversn How do I cheat?
Reputation: 0
Joined: 09 Aug 2015 Posts: 5
|
Posted: Sun Aug 09, 2015 2:22 pm Post subject: |
|
|
Dark Byte wrote: | Zanzer wrote: | Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
There is your health. |
Best turn the offset around (as they are stored the way the pointer window shows them, which is from bottom to top )
Retrieve base address of "DarkSoulsII.exe".
Add 0xFB3E3C to that address.
Read the value at that address.
Add 0x74 to that value.
Use that value as an address.
Read the value at that address.
Add 0xFC to that value.
Use that value as an address.
Read the value at that address.
There is your health. |
Hi thanks for your correction, I've tried creating the trainer but it's not working out so well so I give up, i might try again later after i've finished my studies (in 1 month). Thanks for all your help, this makes me feel like a total douche after y'all tried to help me. I hope you don't hate me for this.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
|