View previous topic :: View next topic |
Author |
Message |
LalzDS Newbie cheater Reputation: 0
Joined: 17 Sep 2013 Posts: 11
|
Posted: Sun Mar 05, 2017 5:53 pm Post subject: Any better alternative to writeBytes for 4 bytes variables? |
|
|
Greetings.
I'm currently using writeBytes to set values for 4 bytes variables.
As an example, I would use
Code: | writeBytes("20123456", 78, 97, 188, 0) |
To set value 00BC614E to variable 20123456.
This requires, however, manual value conversions. Is there no direct way to set the HEX value? Or any other better alternative.
Regards,
Lalz.
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Mar 05, 2017 5:56 pm Post subject: |
|
|
Code: |
writeInteger('theAddress', 0x123ABC)
writeInteger('theAddress', tonumber('123ABC', 16))
|
_________________
|
|
Back to top |
|
|
LalzDS Newbie cheater Reputation: 0
Joined: 17 Sep 2013 Posts: 11
|
Posted: Mon Mar 06, 2017 1:08 pm Post subject: |
|
|
Even though CE doesn't complain about the code not being injectable, neither seems to work. Are you sure your code isn't wrong?
UPDATE: "tonumber" function is working but "writeInteger" isn't. That reminds me, Isn't integer just up to 2 bytes? Because we're trying to write 4 here.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Mar 06, 2017 2:25 pm Post subject: |
|
|
writeInteger (and other similar functions) will only work when memory is writable.
writeBytes is the only one which uses VirtualProtectEx to change flags.
So, you have few options:
1
fullAccess('theAddress', 4)
writeInteger('theAddress', 0x00BC614E)
2
autoAssemble('theAddress:\ndd 00BC614E')
_________________
|
|
Back to top |
|
|
LalzDS Newbie cheater Reputation: 0
Joined: 17 Sep 2013 Posts: 11
|
Posted: Mon Mar 06, 2017 2:36 pm Post subject: |
|
|
Only the latter works, but that's already an improvement. No idea why the former won't.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Mar 06, 2017 6:56 pm Post subject: |
|
|
Code: | writeBytes("address", dwordToByteTable(0x00BC614E)) |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Mar 06, 2017 8:14 pm Post subject: |
|
|
try fullAccess(getAddress('theAddress'), 4 )
_________________
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 |
|
|
|