View previous topic :: View next topic |
Author |
Message |
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Mon Oct 02, 2017 5:48 am Post subject: [Newbie needs help]Trainer that changes values of addresses? |
|
|
Hello guys!
So the other day, i was messing around with CE and pcsx2, and now i want to make a couple of trainers for some ps2 games.
I already found most of the addresses that i need, but i dont understand how i can make a trainer that will change their values.
The addresses are static, and they dont change after i restart pcsx2. So if i understand this correctly, i wont need to mess with pointers.
The basic idea is to make a trainer that can give you infinite ammo for a weapon with the click of a checkbox.
Can somebody give me an example for the code?
Lets say that i want the value of 2013D58C to stay at 50, when the checkbox is checked.
I can just add this address manually on CE and change my ammo number. But a trainer would be nice.
I have some C knowledge, but from what i've seen, it wont help me
I also have some very very basic knowledge of assembly.
Thanks, and sorry for the newbie questions!
edit: please move this thread. posted in this section by accident
Last edited by Gou on Mon Oct 02, 2017 8:14 am; edited 1 time in total |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Oct 02, 2017 6:07 am Post subject: |
|
|
You create a form (or use the one that comes from File->"Generate generic trainer lua script from table"), add a checkbox, goto the events tab with that checkbox selected and add an onchange event (click the ...s) and make it look like this Code: | function CECheckbox1Change(sender)
getAddressList().getMemoryRecordByDescription("ammo").Active = sender.Checked
end |
Then, as long as you have a memory record named "ammo" with the address of the ammo, checking the checkbox on the trainer gui will do the same thing as checking the checkbox on CE's main gui next to the memory record (ie. freeze the value). If you want to set the value at the same time you could use
Code: | function CECheckbox1Change(sender)
local ammoMemrec = getAddressList().getMemoryRecordByDescription("ammo")
ammoMemrec.Active = sender.Checked
if sender.Checked then ammoMemrec.Value = 99 end
end |
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Oct 02, 2017 12:40 pm Post subject: |
|
|
Code: | [ENABLE]
2015F6A8: // address to change
dw 4294967295 // dword/4-byte value to write
[DISABLE]
2015F6A8:
dw 0 |
You can't use assembly code like mov unless you're hooking a function (or creating your own to be called with createThread)
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Mon Oct 02, 2017 1:53 pm Post subject: |
|
|
Thanks man!
This works with everything else that dont need such a big number.
But i am still getting a value that is waay off with this one.
Instead of 4294967295, it returns 29333 in the address value.
Sorry for the stupid questions, but i haven't used CE before.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Oct 02, 2017 4:05 pm Post subject: |
|
|
Gou wrote: | Instead of 4294967295, it returns 29333 in the address value. | hm, well since 2933 is 7295 in hex that would make sense for a 2 byte value (because for some reason I typed dw (define word) instead of dd (define doubleword)) when 4294967295 was read as hex because I forgot the (int) to tell CE to use decimal/base 10.
so... all my fault, I hadn't even just woken up so no real excuses for that... , sorry!
Code: | [ENABLE]
2015F6A8: // address to change
dd (int)4294967295 // double word/4-byte value to write
[DISABLE]
2015F6A8:
dd 0
|
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Mon Oct 02, 2017 4:19 pm Post subject: |
|
|
Dude! Are you serious? Saying sorry n shit hahaha. I should be the one asking sorry, not you!
Everything works like a charm!
You rock! Thanks for everything, once again!
Edit: I appreciate all of your help man!
I just have one last question
How can i insert a value, and freeze it? I've been searching on google for like day, but i cant find anything that applies to my case.
Thanks once again!
|
|
Back to top |
|
|
|