I am trying to decrypt an encrypted lua code, because: First: I don't want to create it from the begging. Second: It sounds fun!
I've created a simple program at Visual Basic 2013 that executes lua functions from a file, the files as you guys can see below contains the encrypted code defined as 'code' in ASCII bytes and my lua code translate it back to the original form.
The problem is: I can translate some words and sign but it still pretty mess, since this is a lua code and contains numbers, signs and words.
The files of the program, as the code encrypted and the code to decrypt can be found at my Gist: https://gist.github.com/DarkShinz/e9aeca7dd1ac1035cf6e ; so you guys can reproduce my so far progress.
I need advices to improve my following code, because, so far, it decrypts some words but others are still just numbers and some signs. Still a mess to the eye.
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
local code = {SOME COMPILED LUA CODE} //Mine is too extensive to be added here
local finalString = "Yay! :"
local codeLength = tablelength(code)
local text = nil
for i = 1, codeLength do
local letter = string.char(code[i])
if (letter:match("%w")) then
elseif (letter:match("%d")) then
elseif (letter:match("%s")) then
elseif (letter:match("%p")) then
elseif (letter:match("%(")) then
elseif (letter:match("%)")) then
elseif (letter:match("%.")) then
elseif (letter:match("%+")) then
elseif (letter:match("%*")) then
elseif (letter:match("%@")) then
elseif (letter:match("%?")) then
elseif (letter:match("%^")) then
elseif (letter:match("%$")) then
elseif (letter:match("%-")) then
elseif (letter:match("%=")) then
elseif (letter:match("%_")) then
elseif (letter:match("%[")) then
elseif (letter:match("%]")) then
elseif (letter:match("%:")) then
elseif (letter:match("%,")) then
elseif (letter:match("%#")) then
elseif (letter:match("%&")) then
else
letra = string.byte(letter)
end
finalString = finalString .. letra
end
print(finalString)
I wish I had a full clean lua source code.