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 


Obfuscating Lua Script

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

Joined: 30 Jun 2018
Posts: 9

PostPosted: Sat Jun 30, 2018 6:58 am    Post subject: Obfuscating Lua Script Reply with quote

hey guys i need some help about lua scripting. how do i obfuscate it to it like this

return_G
local code = 100/102/130/79/64/431/563/314/765/123

I really don't know about lua codes or scripts, i also don't want people to steal my codes cause it took my alot of time to find it. i just wanna obfuscate it. so please if you got any ideas. let me know! Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Jun 30, 2018 9:19 am    Post subject: Reply with quote

encodeFunction()/decodeFunction() stops the laziest of them

https://wiki.cheatengine.org/index.php?title=Lua:decodeFunction

_________________
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
GlitchedError
How do I cheat?
Reputation: 0

Joined: 30 Jun 2018
Posts: 9

PostPosted: Sat Jun 30, 2018 7:39 pm    Post subject: Reply with quote

i know encode and decode function. but i dont know how to use it in lua cheat table script. plus i don't know how to shorten scripts if ur using encode/decode function. for ex.

local function myCoolFunction(str) print(str) end
print(encodeFunction(myCoolFunction))


where do i put the script in that script? i just wanna shorten it.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat Jun 30, 2018 8:23 pm    Post subject: Reply with quote

Maybe :

Code:
------Text (a function) want to camuflage
local script = string.dump(
 function()
  -- Put Contents here, example
 print("I got you...bwhahahahaha...")
 end
)

-----Convert our string into a hex string
buff=""
for v=1,string.len(script) do
buff=buff..'\\'..string.byte(script,v)
end

-----See result
print(buff)

-----If want save to a file
--file=io.open('encrypted.txt','w') --Output our bytecode into ascii format to encrypted.txt
--file:write(buff)
--file:flush()
--file:close()


----- to load back that function/text
local code = '10\41\13\10\13\10\45\45\45\45\45\67\111\110\118\101\114\116\32\111\117\114\32\115\116\114\105\110\103\32\105\110\116\111\32\97\32\104\101\120\32\115\116\114\105\110\103\13\10\98\117\102\102\61\34\34\13\10\102\111\114\32\118\61\49\44\115\116\114\105\110\103\46\108\101\110\40\115\99\114\105\112\116\41\32\100\111\13\10\98\117\102\102\61\98\117\102\102\46\46\39\92\92\39\46\46\115\116\114\105\110\103\46\98\121\116\101\40\115\99\114\105\112\116\44\118\41\13\10\101\110\100\13\10\13\10\45\45\45\45\45\83\101\101\32\114\101\115\117\108\116\13\10\112\114\105\110\116\40\98\117\102\102\41\13\10\13\10\45\45\45\45\45\73\102\32\119\97\110\116\32\115\97\118\101\32\116\111\32\97\32\102\105\108\101\13\10\45\45\102\105\108\101\61\105\111\46\111\112\101\110\40\39\101\110\99\114\121\112\116\101\100\46\116\120\116\39\44\39\119\39\41\32\45\45\79\117\116\112\117\116\32\111\117\114\32\98\121\116\101\99\111\100\101\32\105\110\116\111\32\97\115\99\105\105\32\102\111\114\109\97\116\32\116\111\32\101\110\99\114\121\112\116\101\100\46\116\120\116\13\10\45\45\102\105\108\101\58\119\114\105\116\101\40\98\117\102\102\41\13\10\45\45\102\105\108\101\58\102\108\117\115\104\40\41\13\10\45\45\102\105\108\101\58\99\108\111\115\101\40\41\13\10\13\10\13\10\45\45\45\45\45\32\116\111\32\108\111\97\100\32\98\97\99\107\32\116\104\97\116\32\102\117\110\99\116\105\111\110\47\116\101\120\116\13\10\108\111\99\97\108\32\99\111\100\101\32\61\32\39\92\50\55\92\55\54\92\49\49\55\92\57\55\92\56\49\92\48\92\49\92\52\92\52\92\52\92\56\92\48\92\53\52\92\48\92\48\92\48\92\54\52\92\54\55\92\53\56\92\57\50\92\56\53\92\49\49\53\92\49\48\49\92\49\49\52\92\49\49\53\92\57\50\92\54\54\92\49\49\52\92\49\49\55\92\49\49\48\92\49\49\49\92\57\50\92\54\56\92\49\49\49\92\57\57\92\49\49\55\92\49\48\57\92\49\48\49\92\49\49\48\92\49\49\54\92\49\49\53\92\57\50\92\56\56\92\49\48\49\92\49\49\48\92\49\49\49\92\54\54\92\49\49\49\92\49\49\54\92\57\50\92\56\51\92\57\57\92\49\49\52\92\49\48\53\92\49\49\50\92\49\49\54\92\49\49\53\92\57\50\92\49\48\49\92\49\49\48\92\57\57\92\49\49\52\92\49\50\49\92\49\49\50\92\49\49\54\92\52\54\92\49\48\56\92\49\49\55\92\57\55\92\48\92\50\92\48\92\48\92\48\92\53\92\48\92\48\92\48\92\48\92\48\92\48\92\50\92\52\92\48\92\48\92\48\92\53\92\48\92\48\92\48\92\54\53\92\54\52\92\48\92\48\92\50\56\92\54\52\92\48\92\49\92\51\48\92\48\92\49\50\56\92\48\92\50\92\48\92\48\92\48\92\52\92\54\92\48\92\48\92\48\92\49\49\50\92\49\49\52\92\49\48\53\92\49\49\48\92\49\49\54\92\48\92\52\92\49\57\92\48\92\48\92\48\92\54\55\92\57\55\92\49\48\57\92\49\49\49\92\49\49\55\92\49\48\50\92\49\48\56\92\57\55\92\49\48\51\92\49\48\53\92\49\49\48\92\49\48\51\92\51\50\92\54\56\92\49\49\49\92\49\49\48\92\49\48\49\92\52\54\92\48\92\48\92\48\92\48\92\48\92\52\92\48\92\48\92\48\92\52\92\48\92\48\92\48\92\52\92\48\92\48\92\48\92\52\92\48\92\48\92\48\92\53\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\92\48\39\13\10\108\111\97\100\115\116\114\105\110\103\40\99\111\100\101\41\32\40\41\13\10\13\10\13\10\3\0\0\0\6\0\0\0\0\0\2\4\0\0\0\6\0\64\0\65\64\0\0\36\64\0\1\38\0\128\0\2\0\0\0\4\6\112\114\105\110\116\4\28\73\32\103\111\116\32\121\111\117\46\46\46\98\119\104\97\104\97\104\97\104\97\104\97\46\46\46\1\0\0\0\0\0\0\0\0\0\4\0\0\0\5\0\0\0\5\0\0\0\5\0\0\0\6\0\0\0\0\0\0\0\1\0\0\0\5\95\69\78\86 '
loadstring(code) ()

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
GlitchedError
How do I cheat?
Reputation: 0

Joined: 30 Jun 2018
Posts: 9

PostPosted: Sat Jun 30, 2018 8:28 pm    Post subject: Reply with quote

I already did that local code thing. but the thing is i want to do obfuscated code to this = 5ypT38s!d+42)bqGnmW70wmZN92guO7#

then i turn it to local code.

now the thing is how do i do it with random symbols. sorry if i messed you up xD

oh wait last thing. i cant use

local code = '\23123'
loadstring(code) ()

gives me an error (Undefined lua error)
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat Jun 30, 2018 8:42 pm    Post subject: Reply with quote

Quote:
i want to do obfuscated code to this = 5ypT38s!d+42)bqGnmW70wmZN92guO7#


You need to know what encode function use to encoding 'raeadable' text.
There are many encode functions, such as base64, base32, SHA-1, MD5, chiper crypt, rotate13, etc. Also it make by custom encode function.

So, I don't know with method use for that as you want.
And CE already has encode/decode function it self.

loadstring(code) () also give error.
I don't know why, cause it work on CE 6.4

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
GlitchedError
How do I cheat?
Reputation: 0

Joined: 30 Jun 2018
Posts: 9

PostPosted: Sat Jun 30, 2018 8:53 pm    Post subject: Reply with quote

ok thanks for the help. i'll try to learn on it
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