Mass Decode using functions

So I found some code and wanted to decode it, luckily for me the function to do so was right their and not obfuscated :person_shrugging: but uh their is like 2k lines and I have to run my studio each time I want to decode, anyway to do this on a mass scale?

The decode function

local char = string.char;
local byte = string.byte;
local sub = string.sub;
local bit = bit32;
local bxor = bit.bxor;
local concat = table.concat;
local insert = table.insert;

local function decrypt_xor(ciphertext, key)
	local decrypted_bytes = {}

	for i = 1, #ciphertext do
		local byte_ciphertext = string.byte(ciphertext, i)
		local byte_key = string.byte(key, (i % #key) + 1) -- Repeat the key if shorter than ciphertext
		local xor_result = bit.bxor(byte_ciphertext, byte_key)
		table.insert(decrypted_bytes, xor_result)
	end

	return string.char(table.unpack(decrypted_bytes))
end

How I de obfuscate

print("Decode: " .. decrypt_xor("\138\198\223\3\1\39\185\224\216\4\22\46\178\215", "\75\220\163\183\106\98"))

I have tried Chatgpt but it gives me like random things so.

Check out this Lua Bytecode Deobfuscator:

You should be able to get the original code after using this tool.

Not the issue, I have the way to de obfuscate using that method and this is custom so that bytecode I dont think would work. I mean their is like over 100 instances of the obfuscation function being needed, so I want to instead of having to print it each time do a mass thing

1 Like