Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 02:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[LUA] need help in decrypting / encrypting lua

Discussion on [LUA] need help in decrypting / encrypting lua within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 5
Received Thanks: 0
[LUA] need help in decrypting / encrypting lua

The title pretty much says it all but ill explain a bit more as to what Im in need, basically I have decompiled a script using website, i've got the code etc but it contains some really werid stuff like [NULL][EOT] etc , I wanted to decrypt the file simply to change some stuff in it, I did so but then I did not know how to encrypt it back so I messaged my friend and he gave me this
Code:
local code_to_decode = "script to encrypt"

local output = ""
for i = 1, #code_to_decode do
    output = output .. "\\" .. string.byte(code_to_decode, i, i)
end
print(output)
but , I was unable to use this with my decrypted script because the I am unable to copy it full, all I can copy is like 1 word - LuaQ which is at the start of the file. So now, I would like to ask someone here to please help me decrypt it so that it is easily copyable or tell me how I can run / execute the script so it encrypts.

I've enclosed the files, both versions decrypted and notdecrypted, in the attachments.

Thanks in advance,
Versilkes.
Attached Files
File Type: rar files.rar (5.2 KB, 134 views)
versilkes is offline  
Old 08/08/2013, 19:03   #2
 
elite*gold: 0
Join Date: Apr 2006
Posts: 70
Received Thanks: 19
I did LUA reverse engineering once successfully.

Thats how i did it:
1. Take the packed Lua file and use LuaAssemblyTools (it can be downloaded from github.com) to disassemble it into Lua Assembly language, this does disassemble it 100% correctly
2. take the original lua file and decompile it with some other tool that does give you some kind of half broken half right source code (it never really decompiles properly, but you can read it and get the idea of the code)
3. Learn Lua assembly language, theres somewhere a great pdf on that topic, wasnt that hard because i know assembly language
4. find in the code that you can clearly read the part which you want to change and goto the disassembled lua file and modify it that it works as you want, now compile the disassembled file with LuaAssembly Tools again.

This does work because the lua assembly is unchanged, but when you decompile the file with some other magic tool it probably wont fully decompile it, so you wont be able to actually recompile it again.
LuckyLuke is offline  
Thanks
1 User
Old 08/08/2013, 21:41   #3
 
elite*gold: 0
Join Date: Aug 2013
Posts: 5
Received Thanks: 0
Quote:
Originally Posted by LuckyLuke View Post
I did LUA reverse engineering once successfully.

Thats how i did it:
1. Take the packed Lua file and use LuaAssemblyTools (it can be downloaded from github.com) to disassemble it into Lua Assembly language, this does disassemble it 100% correctly
2. take the original lua file and decompile it with some other tool that does give you some kind of half broken half right source code (it never really decompiles properly, but you can read it and get the idea of the code)
3. Learn Lua assembly language, theres somewhere a great pdf on that topic, wasnt that hard because i know assembly language
4. find in the code that you can clearly read the part which you want to change and goto the disassembled lua file and modify it that it works as you want, now compile the disassembled file with LuaAssembly Tools again.

This does work because the lua assembly is unchanged, but when you decompile the file with some other magic tool it probably wont fully decompile it, so you wont be able to actually recompile it again.

Thank you for your reply, I have googled luaassmeblytools and I've came to this , is this the right thing? If so, would you be able to give me a small guide how to use it? I'm pretty new at this stuff and honestly know very,very little. Also, by the 'packed lua file' do you mean the original not decrypted or the one decrypted?

Lookin forward to your reply,
Versilkes.
versilkes is offline  
Old 08/09/2013, 18:57   #4
 
elite*gold: 0
Join Date: Apr 2006
Posts: 70
Received Thanks: 19
Hey, with packed i mean the original fiels that are not decrypted. The LuaAssemblyTools are not that hard to use. Just read the documentation or contact the guy who wrote the tools code. I dont really remember all of the steps. I just know you have to decompile your packed file with LuaDec51 and then you have to checkout how LASM code works. I've read this file to learn LASM:

Important: Use your decrypted file to navigate through the decrypted LASM code file for easier understanding.

Note: If you cant code in general, dont even try to do this, you will not be able to do it.
LuckyLuke is offline  
Thanks
1 User
Old 08/09/2013, 23:49   #5
 
elite*gold: 0
Join Date: Aug 2013
Posts: 5
Received Thanks: 0
Quote:
Originally Posted by LuckyLuke View Post
Hey, with packed i mean the original fiels that are not decrypted. The LuaAssemblyTools are not that hard to use. Just read the documentation or contact the guy who wrote the tools code. I dont really remember all of the steps. I just know you have to decompile your packed file with LuaDec51 and then you have to checkout how LASM code works. I've read this file to learn LASM:

Important: Use your decrypted file to navigate through the decrypted LASM code file for easier understanding.

Note: If you cant code in general, dont even try to do this, you will not be able to do it.
Once again, thanks for your reply. I've tried to do it but i've failed, just like your note said . So, I'd like to ask you, would you be able to decrypt the file for me and change what is needed? If yes, then please change 'czarujacy kostkarz' to 'gambler on secura' and 'best dice harmonia' to 'gambling on secura'.

Kind regards,
Versilkes.

EDIT:

I've tried compiling the script with luadec.
At first I got an unexpected symbol error


but after deleting I got a syntax error..


Could anyone please look into and fix it for me so it works properly?

Thanks in advance,
Versilkes.
versilkes is offline  
Old 08/12/2013, 12:06   #6
 
elite*gold: 0
Join Date: Apr 2006
Posts: 70
Received Thanks: 19
Contact the guy who made LuaAssemblyTools, maybe its a bug in his software. Sure i could change stuff for you, but I'm not interested. If you want to change it then learn how to do it or leave it.
LuckyLuke is offline  
Old 08/12/2013, 16:16   #7
 
elite*gold: 0
Join Date: Aug 2013
Posts: 5
Received Thanks: 0
I was fighting all errors that I got when trying to encrypt the script and got it encrypted (woohoo) but, when Im trying to run it it
states 'Error: attempt to call a nil value'
so now my question is, could anyone please tell me what does this mean and suggest a way to fix / what to check ?
versilkes is offline  
Old 08/12/2013, 17:32   #8
 
elite*gold: 0
Join Date: Apr 2006
Posts: 70
Received Thanks: 19
The error is saying you are calling something that is nil (=null = nothing), you need to debug your code or figure out which variable is nil and change it to be something that makes sense, no one can tell you what the actual error is.
LuckyLuke is offline  
Reply


Similar Threads Similar Threads
Help Encrypting Res Files
02/15/2013 - Flyff Private Server - 8 Replies
Can somehow make a short tutorial on how to encrypt resfiles using the source / serverfiles? Thanks in advance.
x7 Encrypting Issue
07/26/2010 - S4 League - 3 Replies
First of all, im not asking for an importer already done or something like that. I just would like someone to tell me wich "way" i must follow or some data about decrypting and encrypting s4 files cause i really want to learn this stuff and make it my own. Thanks beforehand.
New iSRO bot under encrypting
07/20/2007 - SRO Hacks, Bots, Cheats & Exploits - 0 Replies
New iSRO bot update finished, now under encrypting, expected to be finished in several hours. Thanks for your patience and BotsMall will keep following up the progress on bot. :D :D :D



All times are GMT +1. The time now is 02:11.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.