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 


Thanks Corroder

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Jul 19, 2015 7:19 am    Post subject: Thanks Corroder Reply with quote

Hehhehehe Lol Thanks Corroder
No Need To Show My Post to Everyone Wink

And No Need To Put Your FB Name Every Where Wink Smile Very Happy

Don't Put Mine Also Cool


Last edited by lolAnonymous on Sun Jul 19, 2015 2:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Jul 19, 2015 9:26 am    Post subject: Reply with quote

To encoding codes you could use Base 64 encoding / decoding.
Here is reference for encoding / decoding function with Base 64 method for LUA.

http://lua-users.org/wiki/BaseSixtyFour

I don't know if LUA support Base 85 or other encode methods.

To "hide" all your cheat table, maybe you can put cheat table as string and safe it into a file and load the table with a function in the trainer.

Here example encode method with Base64 method :


Code:

-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <[email protected]>
-- licensed under the terms of the LGPL2
-- character table string

local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

-- encoding
function enc(data)
    return ((data:gsub('.', function(x)
        local r,b='',x:byte()
        for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
        return r;
    end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
        if (#x < 6) then return '' end
        local c=0
        for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
        return b:sub(c+1,c+1)
    end)..({ '', '==', '=' })[#data%3+1])
end

-- decoding
function dec(data)
    data = string.gsub(data, '[^'..b..'=]', '')
    return (data:gsub('.', function(x)
        if (x == '=') then return '' end
        local r,f='',(b:find(x)-1)
        for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
        return r;
    end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
        if (#x ~= 8) then return '' end
        local c=0
        for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
        return string.char(c)
    end))
end

-- command line if not called as library
if (arg ~= nil) then
   local func = 'enc'
   for n,v in ipairs(arg) do
      if (n > 0) then
         if (v == "-h") then print "base64.lua [-e] [-d] text/data" break
         elseif (v == "-e") then func = 'enc'
         elseif (v == "-d") then func = 'dec'
         else print(_G[func](v)) end
      end
   end
else
   module('base64',package.seeall)
end

--- Test
scn01 = "D1 66 EF 01 01 47 47"  --- of course you need encoding this outside the table and not put this code here
rpl01 = ""D2 66 EF 01 01 47 47"
a = enc(scn01)   ---- encoding code here
b = enc(rpl01)  ---- encoding code here
--- Test
print(a)   ----- result : RDEgNjYgRUYgMDEgMDEgNDcgNDc=
print(b)   ----- result : RDIgNjYgRUYgMDEgMDEgNDcgNDc=

-----Let say you already have function AOBswap(scan, replace)
----- Here to put your code in a button click function

get_a = dec(a)  ---decoding AOB code a
get_b = dec(b)  - decoding AOB code b
resultlist = AOBScan(tostring(a), "+W*X-C")   -- check AOB scan
if (resultlist) then
showMessage("Code Found")  --  if success
get_swap = AOBswap(get_a, get_b)
resultlist.Destroy()
resultlist = nil
else
showMessage("No Code Found")  -- if fail
end
end



I hope some expert could help with better ways...
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Sun Jul 19, 2015 10:52 am    Post subject: Reply with quote

Lua can support pretty much any encoding you throw at it as long as you can find a suitable implementation of it (or make one yourself). Regardless though, no matter what encoding/encryption you use, your trainer is still going to have the full raw Lua script inside of it which means that no matter what you do, people can still get the text of your script. Once they have the text they can see how you did your encoding/encryptions and just undo it.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Jul 19, 2015 2:10 pm    Post subject: Thanks Reply with quote

Thanks Alot Corroder And atom0s Can Any One Of U Pm Me So I Can Pm Other People Because In This Forum I Can't Send A PM Until Some One PM Me Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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