Name of variables and functions

I have a script that I am trying to reverse but I am a little confused about many things. 1st- What are these variables names ? How can I know their meaning ? 2nd- Can someone tell me the meaning of this line of code ? I have been trying to understand it but I did not succeed. There is the script:

var _0x3ea8cd = function (_0x1a81d6)
{
    while (--_0x1a81d6)
    {
        _0x52548a['push'](_0x52548a['shift']());
    }
};

Answer

In more readable format it is equivalent to the following with exception of not having the array data that I added

var arr = [1,2,3,4,5];// _0x52548a variable

var offsetArray = function (offset){// change name of _0x1a81d6
    while (--offset){
        arr.push(arr.shift());// use arr instead of _0x52548a
    }
};
// usage
offsetArray(2)// use _0x3ea8cd(2) in original code
console.log(JSON.stringify(arr))


// using original
var _0x52548a= [1,2,3,4,5];

var _0x3ea8cd = function (_0x1a81d6)
{
    while (--_0x1a81d6)
    {
        _0x52548a['push'](_0x52548a['shift']());
    }
};
_0x3ea8cd(2)
console.log('Using original')
console.log(JSON.stringify(_0x52548a))

Leave a Reply

Your email address will not be published. Required fields are marked *