Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


AOB code: how bytes replaced by Text?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 30

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon Mar 19, 2018 6:21 pm    Post subject: Reply with quote

FreeER wrote:
use doubleToByteTable and writeDouble Smile


Thanks worked. Smile
But in a few clicks / usage it collapsed after page. Sad
There's probably a mistake in the change.

Code:
00 00 00 00 00 ?? ?? 40 =  %s %s


or:

Code:
codescan1 = '01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 00 ?? ?? 40'

Aobswap(codescan1,('01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? ?? ?? 00 00 %s %s '):format(newvalue, newvalue))


What is wrong?

Code:
function byteTableToAobString(t)
  for k,v in ipairs(t) do
    t[k] = ('%02X'):format(v)
  end
  return table.concat(t, ' ')
end

function CEButton1Click(sender)
  newvalue = UDF1.CEEdit1.Text
  newvalue = tonumber(newvalue)
  if not newvalue then return end -- if not a number we're done
 newvalue = doubleToByteTable(newvalue) -- alternatively
  newvalue = byteTableToAobString(newvalue)


codescan1 = '01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 00 ?? ?? 40'

Aobswap(codescan1,('01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? ?? ?? 00 00 %s %s '):format(newvalue, newvalue))

UDF1.CEButton1.Caption="ON";
showMessage('DONE!')
end


Thanks again.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon Mar 19, 2018 7:08 pm    Post subject: Reply with quote

did you want to write 2 double values after the ?? ?? ?? ?? ?? ?? 00 00, or just 1? Because you're putting the byte string for the new double value in there twice with the ('...%s %s'):format(newvalue, newvalue), that will also make the replacement AOB longer than the scan AOB, not certain how AOBSwap handles that (I'd expect it to work but).
_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 30

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon Mar 19, 2018 7:15 pm    Post subject: Reply with quote

FreeER wrote:
did you want to write 2 double values after the ?? ?? ?? ?? ?? ?? 00 00, or just 1? Because you're putting the byte string for the new double value in there twice with the ('...%s %s'):format(newvalue, newvalue), that will also make the replacement AOB longer than the scan AOB, not certain how AOBSwap handles that (I'd expect it to work but).



Sorry. I just figured it out. fixed.
now the page did not crash and
Until I wrote this, you wrote the answer. Smile
I apologize again and thank you.

Code:
00 00 00 00 00 ?? ?? 40 =  %s
and thanks Smile

and once again you saved the day. Smile

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites