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 


How to make This?
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
gamers01
Cheater
Reputation: 0

Joined: 27 Sep 2013
Posts: 45

PostPosted: Sat Feb 01, 2014 11:14 am    Post subject: Reply with quote

bro just make a script of it because i will copy and paste it Razz Smile
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Feb 01, 2014 11:46 am    Post subject: Reply with quote

Bro, you already have all you need:

Code:
function AOBSwap(aobIn,aobOut)
 aobOut = aobOut:gsub('[^%w]','') -- remove all spaces

 local _aobOut=''
 for i=1,#aobOut,2 do
  _aobOut = _aobOut..aobOut:sub(i,i+1)..' '  -- add spaces (only the needed ones)
 end

 local address = 0

--AOBScan("aobstring", protectionflags OPTIONAL, alignmenttype OPTIONAL, alignmentparam HALFOPTIONAL)


 local aobs = AOBScan(aobIn, '+W*X-C', 1, '4') -- you can change here: protection flags and alignment (e.g. writable, addresses dividable by 4)
 if(aobs ~= nil) then
   for i = 0,aobs.Count-1 do
     address = aobs.String[i]
     autoAssemble(address..[[:
                  db ]].._aobOut)
   end
   aobs.destroy()
 end
end


function _4ByteSwap(findValue,replaceWith)
  local findValue   = string.format('%08X',findValue)
  local replaceWith = string.format('%08X',replaceWith)
  local tmp=findValue   

  tmp = tmp:sub(7,8)..tmp:sub(5,6)..tmp:sub(3,4)..tmp:sub(1,2)
  findValue = tmp; tmp=replaceWith

  tmp = tmp:sub(7,8)..tmp:sub(5,6)..tmp:sub(3,4)..tmp:sub(1,2)
  replaceWith=tmp

  AOBSwap(findValue,replaceWith)
end



Now, using this:
_4ByteSwap(2450,9001)


will replace all 4byte values which are 2450
to value 9001.


Quote:

yeah i know but in 4 byte the values are different
for e.g :
200 <--- 4 byte (i want like this)
C8 <---- AOB

Rolling Eyes Rolling Eyes


lets take 4byte value, for example 9001

hexadecimal representation is: 00002329 (or without leading zeros: 2329)
another notation: 0x00002329 (or 0x2329)
another notation: $00002329 (or $2329)

4byte values, can be represented by array of byte
single-precision floating-point value (also called: float, single, float32) can be represented as "array of byte"
double-precision floating-point value (also called: double, float64, real) can be represented as "array of byte"
and string can be represented as "array of byte"
anything can be represented as "array of byte"

For example, 4 byte value 9001, in "little endian" system will be
9001 (decimal) = 00002329 (hex) = 29 23 00 00 (array of byte)


single-precision floating-point value 1.5 in "little endian" system will be:
1.5 (decimal) = 3FC00000(hex) = 00 00 C0 3F (array of byte)

_________________
Back to top
View user's profile Send private message MSN Messenger
gamers01
Cheater
Reputation: 0

Joined: 27 Sep 2013
Posts: 45

PostPosted: Sat Feb 01, 2014 3:57 pm    Post subject: Reply with quote

ty bro i understood now Smile

Last edited by gamers01 on Sat Feb 01, 2014 11:12 pm; edited 2 times in total
Back to top
View user's profile Send private message
Keule
Cheater
Reputation: 0

Joined: 08 Aug 2012
Posts: 25

PostPosted: Sat Feb 01, 2014 4:40 pm    Post subject: Reply with quote

I cant believe this...

Copy the Script to:
Table -> Show Cheat Table Lua Script

and save it as .CT

Was it that hard ?! Rolling Eyes

EDIT:
Thx Player for the Script, i gonna add it as extension to my Tables in combination with AobSwapC Smile
Back to top
View user's profile Send private message
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