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 


Health Regeneration Code???

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
danishdanish
Newbie cheater
Reputation: 0

Joined: 15 Mar 2016
Posts: 23

PostPosted: Wed Apr 19, 2017 3:34 am    Post subject: Health Regeneration Code??? Reply with quote

Could anyone make Health Regeneration code for me to use in left 4 dead.
289697B8 this is the health address.
and plz make it simple and put all the values in the script so i can easily copy and paste it because i don't know anything about lua scripting and programming languages, not the single word.
if any information needed plz ask.
Thanks in Advanced. Smile
PM me plz
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Wed Apr 19, 2017 5:41 am    Post subject: Reply with quote

Hm let's see what was that command CE has to write who knows what into a random address and hope it's static? Oh, right:

Code:
SorryDontHaveMoreInfoUseMagicToDoWhatIWant("289697B8")


alternatively you can use a assembly

Now assuming it was static or you didn't mind finding it each time you could google the lua wiki or open the main.lua file included with cheat engine and find

Code:
writeInteger(address,value) : Writes an integer to the specified address. Returns true on success
writeQword(address, value): Write a 64-bit integer to the specified address
writeFloat(address,value) : Writes a single precision floating point to the specified address. Returns true on success
writeDouble(address,value) : Writes a double precision floating point to the specified address. Returns true on success


Though since this doesn't seem so much of a "help me learn" as a "do this for me so I can cheat" a much better option might be to notice that the "Single player cheat request" section is locked and wonder why (hint: viewtopic.php?t=603323)...

you also shouldn't be spamming this everywhere (eg. http://forum.cheatengine.org/viewtopic.php?t=604191)
Back to top
View user's profile Send private message
danishdanish
Newbie cheater
Reputation: 0

Joined: 15 Mar 2016
Posts: 23

PostPosted: Wed Apr 19, 2017 11:04 am    Post subject: Reply with quote

I didn't get what u are trying to say. only thing i ask is to tell me what would be the exact script for health regen in l4d. and the address i gave you might not be static but i know how to do pointer scan. but assume it now as a static value.
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Wed Apr 19, 2017 11:52 am    Post subject: Reply with quote

It means there's not really enough information there to tell you unless I had the game and looked up the information myself (and I don't) and that it seems a lot more like you're asking for a table/trainer (which is no longer allowed on the CE forums) than it does like you're asking for help as to how you'd find it yourself or write a script yourself.

I did include some lua code that would let you figure it out if you thought about it (for a 4 byte value use writeInteger, 8 byte use writeQword, etc.)

You could also use an assembly script instead of lua eg.

Code:
[ENABLE]
address:
  dd (int)integerValue // or dd (float)floatValue or dq (double)doubleValue etc.
[DISABLE]


though either method would only work one time (like a health pack). If you want to continuously refill your health you'd need extra code to cause those instructions to run several times eg

Code:
[ENABLE]
{$lua}
timer = createTimer()
timer.OnTimer = function(tmr)
  writeInteger(healthAddress,value)
  if not getAddressList().getMemoryRecordByDescription("name of script").Active then tmr.destroy() end
end
timer.setInterval(100) -- 1/10 of a second
{$asm}
[DISABLE]
{$lua}
getAddressList().getMemoryRecordByDescription("name of script").Active = false
{$asm}


or

Code:
globalalloc(healthWriteLoop,1000)
healthWriteLoop:
  db 0
  mov [healthAddress], (int)IntegerValue // or (float) floatValue
  // movq may allow you to move a double but I'm not certain
 
  push #1000 // 1000 milliseconds mov into ecx for x64 code
  call sleep // wait 1 second before continuing
  cmp byte ptr [healthWriteLoop], 0
  je healthWriteLoop+1 // loop
  ret

createThread(healthWriteLoop+1) // I think +1 will work but haven't tested before
[DISABLE]
healthWriteLoop+1:
  db 1


Though it'd probably be better to simply prevent the code that writes your health from running (usually by overwriting it with nop instructions) you've provided no info on what or where that might be and it's hard to guess without even knowing what type of value the health is...

As for the address being static or a pointer, in a lua script it won't make too much difference since you can include the pointer path as part of the string and let lua handle it (eg. "writeFloat([base+baseOffset]+off1]+off2", 1.0)) but it makes a big difference to assembly code since you first have to read the value for the first pointer (mov reg, [base+baseOffset]) then read the value at that address plus the next offset (mov reg, [reg+off1]), and repeat until you get to the last offset, at which point you can then change the value you care about (eg. mov [reg+off2], (int)0x0FFFFFFF)

There is not magic instruction in Cheat Engine that will take an address and just do what you want, you have to know exactly what you want to do and then use the utilities that are available to you to figure out how to do that.
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
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