generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: About bytecode loading... (informative)

Previous Thread :: Next Thread 
ColorlessBody is not online. ColorlessBody
Joined: 21 Jun 2012
Total Posts: 193
23 Jul 2012 11:32 AM
Lua 5.2 doesn't have a loadstring function. Instead, the ability to load code from strings has been added to the load function, which already exists in Lua 5.1 but doesn't have that ability.

Also, in Lua 5.2, bytecode verification was removed. This is because the bytecode verification in Lua was already filled with flaws and was becoming too complicated, so they just decided to get rid of it.

Of course, in a such case, ROBLOX can't afford to keep bytecode loading, because that would be too dangerous. There are already tricks using bytecode that allow scripters to do things they shouldn't be able to do, and if they update to Lua 5.2, which they have the intention to do, there are going to be even more of such tricks and exploits using bytecode.

This is why they decided that they would just remove bytecode loading completely (confirmed in a thread posted on the forums by Shedletsky). Because of this, you shouldn't use bytecode loading anymore, otherwise, your code will break when they update.

This also means you shouldn't obfuscate your scripts anymore using bytecode (see http://wiki.roblox.com/index.php/Script_Obfuscation).

However, it is important to note that what they are removing isn't loadstring or the ability to load code at all. They are just going to remove the ability to load bytecode. It will still be possible to load normal Lua code, just not bytecode. Therefore, don't worry, script builders and other things that need to load normal Lua code will still work.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
23 Jul 2012 11:35 AM
There are other encryption methods anyway, I'll use Vigenere, very effective. :B
Report Abuse
ColorlessBody is not online. ColorlessBody
Joined: 21 Jun 2012
Total Posts: 193
23 Jul 2012 11:37 AM
Well, the devs are going to make the source of scripts stop replicating soon, so there'll be no point in obfuscating your scripts anymore.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
23 Jul 2012 11:45 AM
Oh, if THey make it where Exploiters can't get the Scripts, that's fine with Me! =D
Report Abuse
ColorlessBody is not online. ColorlessBody
Joined: 21 Jun 2012
Total Posts: 193
23 Jul 2012 12:14 PM
Yep.

So obfuscation is going to become useless anyway, except if you want to distribute code in a model and want it to be obfuscated, but, in that case, you might as well just give the source code away.
Report Abuse
ColorlessBody is not online. ColorlessBody
Joined: 21 Jun 2012
Total Posts: 193
25 Jul 2012 05:36 AM
I still wonder when they're going to update to Lua 5.2.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:39 AM
Yea.
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
25 Jul 2012 06:10 AM
[ Content Deleted ]
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
25 Jul 2012 07:35 AM
ElecktrixAxel

Like this ;-)

function Encrypt( _msg, _key )
local msg = { _msg:upper():byte( 1, -1 ) }
local key = { _key:upper():byte( 1, -1 ) }
local enc = {}

local j, k = 1, 1
for i = 1, #msg do
if msg[i] >= string.byte('A') and msg[i] <= string.byte('Z') then
enc[k] = ( msg[i] + key[j] - 2*string.byte('A') ) % 26 + string.byte('A')

k = k + 1
if j == #key then j = 1 else j = j + 1 end
end
end

return string.char( unpack(enc) )
end

function Decrypt( _msg, _key )
local msg = { _msg:byte( 1, -1 ) }
local key = { _key:upper():byte( 1, -1 ) }
local dec = {}

local j = 1
for i = 1, #msg do
dec[i] = ( msg[i] - key[j] + 26 ) % 26 + string.byte('A')

if j == #key then j = 1 else j = j + 1 end
end

return string.char( unpack(dec) )
end


original = "Beware the Jabberwock, my son! The jaws that bite, the claws that catch!"
key = "VIGENERECIPHER";

encrypted = Encrypt( original, key )
decrypted = Decrypt( encrypted, key )

print( encrypted )
print( decrypted )
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
25 Jul 2012 07:15 PM
I would do it this way:

function encrypt(txt, key)
txt, key = txt:lower(), key:lower()
local i = 0
return txt:gsub("%a", function(a)
i = i + 1
local k = i%#key
k = k == 0 and #key or k
a = (a:byte()-96)+(key:sub(k, k):byte()-97)
a = a%26 == 0 and 26 or a%26
return(string.char(a+96))
end)
end

function decrypt(txt, key)
txt, key = txt:lower(), key:lower()
local i = 0
return txt:gsub("%a", function(a)
i = i + 1
local k = i%#key
k = k == 0 and #key or k
a = (a:byte()-96)-(key:sub(k, k):byte()-97)
a = a%26 == 0 and 26 or a%26
return(string.char(a+96))
end)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image