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 encrypting my Trainer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
MikeNoey
Advanced Cheater
Reputation: 0

Joined: 08 Jun 2018
Posts: 64

PostPosted: Fri Jun 08, 2018 11:37 am    Post subject: help encrypting my Trainer Reply with quote

Hi, I've been doing some reading and as far as can understand the method to protect a Lua Script from being stolen is via encodeFunction but I still don't understand how it works. It would help me understand better if I copy pasted one of my current scripts and someone who might have a spare minute could show me how encodeFunction would be used with my own code. I'd understand quickly then how to do it. Thanks in advance to anyone who assists me here.


timer = createTimer(nil, true)
timer_setInterval(timer, 1)

function Loop()


local ZClick = readFloat("[game.exe + 01F5DDA4] + 1FC")
local XClick = readFloat("[game.exe + 01F5DDA4] + 1F4")
local ZTele = readFloat("[game.exe + 01F5DDA4] + 58")
local XTele = readFloat("[game.exe + 01F5DDA4] + 50")


if isKeyPressed(0x6E) then
writeFloat("[game.exe + 01F5DDA4] + 58",ZClick)
writeFloat("[game.exe + 01F5DDA4] + 50",XClick)
end



end
timer_onTimer(timer, Loop)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Jun 08, 2018 12:14 pm    Post subject: Reply with quote

check https://forum.cheatengine.org/viewtopic.php?t=595142

but in your case
Code:

f=encodeFunction(function()
timer = createTimer(nil, true)
timer_setInterval(timer, 1)

function Loop()


local ZClick = readFloat("[game.exe + 01F5DDA4] + 1FC")
local XClick = readFloat("[game.exe + 01F5DDA4] + 1F4")
local ZTele = readFloat("[game.exe + 01F5DDA4] + 58")
local XTele = readFloat("[game.exe + 01F5DDA4] + 50")


if isKeyPressed(0x6E) then
writeFloat("[game.exe + 01F5DDA4] + 58",ZClick)
writeFloat("[game.exe + 01F5DDA4] + 50",XClick)
end



end
timer_onTimer(timer, Loop)
end)
print(f)


and you can call it by
Code:

decodeFunction('c-n/f-AcnS6g}(DSgI3oh]5OiDIzGc!3JI=SPJ4U1jQQ;DK/!9Tcyq1yh_1K0:_L_vflV4K8UB8.+}Ry/oh^EzLQ386kfviTh+/+%wdi+xrX0yFct[%V9U}[by}O).M4vJ20UZX0WjPM2tYtS1Mq}wBl1aq.X,z^3exKPbcU11xQ,*ZWvln83bnejWW#EAnbK!Nt/tBkU(HSltkO%8N47SvNQU.n,[Y/j:BA}}@*ezoDFsC[fHsx@hzL(!7ZmZG?CRW.gipd.N^}5%mjmw6g{XB{ydbTh-iUkBpygC:(^$r!.+]-]Y9R^xNvPS+%_kd*$7-UQhs^/y::#3w,!AgFr.E%EYy4$*PZoGBR+kcB@=Z?4EK@Z!]14(W/22UFhC:vnd.vXyV(D')()

_________________
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
MikeNoey
Advanced Cheater
Reputation: 0

Joined: 08 Jun 2018
Posts: 64

PostPosted: Tue Jun 12, 2018 10:25 pm    Post subject: Reply with quote

Thank you DarkByte. Following your example it works really well. When I try to employ this within a Stand Alone Trainer it doesn't work. This is the code I use in the script.

function CEButton1Click(sender)
myscript=decodeFunction('Blabla')
myscript()
end

I get this error "Error:[string "function CEButton1Click(sender)
..."]:3: attempt to call a string value (global 'myscript')"

Could someone help tell me what I've done wrong here. Thank you again in advance.



I found the solution to this problem. When creating the trainer you need to change the Target Process to 64 bit from it's default selection of 32 bit.
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