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 


Help me make a script with a 'written value'.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
thbgohan
How do I cheat?
Reputation: 0

Joined: 02 Apr 2012
Posts: 9

PostPosted: Mon Apr 02, 2012 7:09 pm    Post subject: Help me make a script with a 'written value'. Reply with quote

I need make a script cheat that can do that:
Search for a value:
D1 24 07 66 ?? ?? 85 ?? ??
Write this value
Change the value by:
02 02 02 02 02 02 02 02 02

Then make another script that can unchange the value:
02 02 02 02 02 02 02 02 02
>
D1 24 07 66 ?? ?? 85 ?? ??
(value written)

Someone know how do that? The cheat engine have the option to read a value? If not, someone know a similar program that can do that?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Mon Apr 02, 2012 7:16 pm    Post subject: Reply with quote

This can be done in lua, but might be a lot easier/convenient in autoassembler

Code:

[enable]
alloc(originalbytes,9)
label(originaladdress)
registersymbol(originaladdress)
registersymbol(originalbytes)

aobscan(_found, d1 24 07 66 ?? ?? 85)

originalbytes:
readmem(_found, 9)

_found:
originaladdress:
db 02 02 02 02 02 02 02 02 02

[disable]
originaladdress:
readmem(originalbytes,9)

dealloc(originalbytes)
unregistersymbol(originaladdress)
unregistersymbol(originalbytes)


_________________
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
View user's profile Send private message MSN Messenger
thbgohan
How do I cheat?
Reputation: 0

Joined: 02 Apr 2012
Posts: 9

PostPosted: Mon Apr 02, 2012 7:53 pm    Post subject: Reply with quote

did not work, I think a lua script like this will help me:



Code:

function replaceAOB()

  r=AOBScan("62 06 66 ?? ?? 24 03 a1 4f ?? ?? ?? d0 4f ?? ?? ?? d0 4f ?? ?? ?? 47")


  if (r~=nil) then
    c=strings_getCount(r)
    if (c>0) then
      resultlist=nil
      resultlist={}
      for i=0,c-1 do
        a=strings_getString(r,i);
        resultlist[i+1]={}
        resultlist[i+1][1]=a  --store the address
        resultlist[i+1][2]=readBytes(a, 23, true) --store the original bytes     

        --6.1 has an ugly bug with writeBytes using a tableformat so I have to use an ugly workaround...
        for j=12,22 do
          writeBytes(tonumber("0x"..a)+j, 2)
        end


      end
      print("Found "..c.." results")
    else
      print("No results");
    end
  else
    print("Scan error")
  end

end

function restoreAOB()
  for i=1,#resultlist do
    print("restoring result "..i)
    local a=tonumber("0x"..resultlist[i][1])
    local orig=resultlist[i][2];
    for j=12,22 do
      writeBytes(a+j,orig[j])
    end
  end
end





Thank you for everything *-*
Back to top
View user's profile Send private message
thbgohan
How do I cheat?
Reputation: 0

Joined: 02 Apr 2012
Posts: 9

PostPosted: Tue Apr 03, 2012 9:16 am    Post subject: Reply with quote

help
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Tue Apr 03, 2012 2:35 pm    Post subject: Reply with quote

Not sure what you need help with. This script looks easy enough to adjust to your own code. Just adjust the aob and the size of the buffers and from where to restore
_________________
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
View user's profile Send private message MSN Messenger
thbgohan
How do I cheat?
Reputation: 0

Joined: 02 Apr 2012
Posts: 9

PostPosted: Wed Apr 04, 2012 6:57 pm    Post subject: Reply with quote

help me I'm not sure beginner mount the script with these other aobs help me please
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Apr 05, 2012 5:46 am    Post subject: Reply with quote

Read this

http://forum.cheatengine.org/viewtopic.php?p=5342897#5342897

http://forum.cheatengine.org/viewtopic.php?p=5343191#5343191

_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
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