试图了解一些代码的作用(Lua)

Sha*_*ell 2 lua world-of-warcraft

这段代码有什么作用?这就是魔兽世界3.5.5的Lua

function __(r) local d = string.sub(r,0x0001,string.len(r)-0x0040) local k = string.sub(r,string.len(r)-0x003F, string.len(r)) d = string.gsub(d, '[^'..k..'=]', '') return (d:gsub('.', function(x) if (x == '=') then return '' end local r,f='',(k:find(x)-1) for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= 8) then return '' end local c=0 for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end return string.char(c) end)) end _={_=_G} _._["\108\111\097\100\115\116\114\105\110\103"](_._["\095\095"]("SuperLongStringThatWasRemovedForPrivacyReasons"))()
Run Code Online (Sandbox Code Playgroud)

现在我猜的是这是某种加密代码还是什么?我不太确定.你们认为它是什么?/你知道这个代码在运行时会做什么吗?

注意:非常长的字符串......真的很长.它长约150,000个字符.

Ego*_*off 5

代码相当于

loadstring(
   decode_from_base64(
      ("SuperLongStringThatWasRemovedForPrivacyReasons"):sub(1, -65)
   )
)()
Run Code Online (Sandbox Code Playgroud)

所以,SuperLongStringThatWasRemovedForPrivacyReasons实际上是一个base-64编码的Lua程序(程序可能是Lua源代码或Lua字节代码).
您可以自己轻松解码,有很多在线base-64解码器可用.