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.
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.
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?
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.
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?
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.
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 ?
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.
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