I have a js code, that is obfuscated. And it works good.
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('i j(t,r,L){k("1P"==1Q r){c(f N="",X=0;X<t.a;X++)N+="0";c(f Y=0,Z=-1,n="";N.1R("0");)c(b 1S r)c(Y=0;-1!=(Z=t.1T(b,Y));){k(0!=1U(N.d(Z,b.a))){Y=Z+1;1V}c(f $=0;$<r[b].a;$++)n+="1";N=N.d(0,Z)+n+N.d(Z+b.a,N.a-(Z+b.a)),t=t.d(0,Z)+r[b]+t.d(Z+b.a,t.a-(Z+b.a)),Y=Z+r[b].a+1,n=""}h t}c(f e=0;e<r.a;e++)t=t.1W(1X(r.l(e),"g"),L.l(e));h t}i 1Y(t){h j(t,{а:"%m",б:"%o",в:"%p",г:"%q",д:"%s",е:"%u",ж:"%v",з:"%w",и:"%x",й:"%y",ё:"%z",ы:"%A",к:"%B",л:"%C",м:"%D",н:"%E",ь:"%F",о:"%G",п:"%H",р:"%I",с:"%J",т:"%K",у:"%M",ф:"%O",х:"%P",ц:"%Q",ч:"%R",ш:"%S",щ:"%T",ъ:"%U",э:"%V",ю:"%W",я:"%10"," ":"%11",А:"%12",Б:"%13",В:"%14",Г:"%15",Д:"%16",Е:"%17",Ж:"%18",З:"%19",И:"%1a",Й:"%1b",Ё:"%1c",Ы:"%1d",К:"%1e",Л:"%1f",М:"%1g",Н:"%1h",Ь:"%1i",О:"%1j",П:"%1k",Р:"%1l",С:"%1m",Т:"%1n",У:"%1o",Ф:"%1p",Х:"%1q",Ц:"%1r",Ч:"%1s",Ш:"%1t",Щ:"%1u",Ъ:"%1v",Э:"%1w",Ю:"%1x",Я:"%1y",0:"%1z",1:"%1A",2:"%1B",3:"%1C",4:"%1D",5:"%1E",6:"%1F",7:"%1G",8:"%1H",9:"%1I","-":"%1J",",":"%1K",".":"%1L",";":"%1M","/":"%1N","—":"%1O"})}i 1Z(t){h j(t,{"%m":"а","%o":"б","%p":"в","%q":"г","%s":"д","%u":"е","%v":"ж","%w":"з","%x":"и","%y":"й","%F":"ь","%z":"ё","%A":"ы","%B":"к","%C":"л","%D":"м","%E":"н","%G":"о","%H":"п","%I":"р","%J":"с","%K":"т","%M":"у","%O":"ф","%P":"х","%Q":"ц","%R":"ч","%S":"ш","%T":"щ","%U":"ъ","%V":"э","%W":"ю","%10":"я","%11":" ","%12":"А","%13":"Б","%14":"В","%15":"Г","%16":"Д","%17":"Е","%18":"Ж","%19":"З","%1a":"И","%1b":"Й","%1i":"Ь","%1c":"Ё","%1d":"Ы","%1e":"К","%1f":"Л","%1g":"М","%1h":"Н","%1j":"О","%1k":"П","%1l":"Р","%1m":"С","%1n":"Т","%1o":"У","%1p":"Ф","%1q":"Х","%1r":"Ц","%1s":"Ч","%1t":"Ш","%1u":"Щ","%1v":"Ъ","%1w":"Э","%1x":"Ю","%1y":"Я","%1z":"0","%1A":"1","%1B":"2","%1C":"3","%1D":"4","%1E":"5","%1F":"6","%1G":"7","%1H":"8","%1I":"9","%1J":"-","%1K":",","%1L":".","%1M":";","%1N":"/","%1O":"—"})}',62,124,'||||||||||length|fr|for|substr||var||return|function|strtr|if|charAt|G0||G1|G2|G3||G4||G5|G6|G7|G8|G9|H8|JB|GA|GB|GC|GD|JC|GE|GF|J0|J1|J2||J3||J4|J5|J6|J7|J8|J9|JA|JD|JE||||JF|20|K0|K1|K2|K3|K4|K5|K6|K7|K8|K9|P8|SB|KA|KB|KC|KD|SC|KE|KF|S0|S1|S2|S3|S4|S5|S6|S7|S8|S9|SA|SD|SE|SF|Z1|Z2|Z3|Z4|Z5|Z6|Z7|Z8|Z9|Z0|ZA|ZB|ZC|ZD|ZE|ZF|object|typeof|includes|in|indexOf|parseInt|continue|replace|RegExp|codestring|showstring'.split('|'),0,{}))
console.log(codestring('абвг'));
In fact it contents 2 functions – one is “codestring”, another is “showstring” (i know this!).
First function code cyrillic-string this way:
let replaces = {"а":"%G0", "б":"%G1", "в":"%G2", "г":"%G3", "д":"%G4", "е":"%G5", "ж":"%G6", "з":"%G7", "и":"%G8", "й":"%G9", "ё":"%H8", "ы":"%JB", "к":"%GA", "л":"%GB", "м":"%GC", "н":"%GD", "ь":"%JC", "о":"%GE", "п":"%GF", "р":"%J0", "с":"%J1", "т":"%J2", "у":"%J3", "ф":"%J4", "х":"%J5", "ц":"%J6", "ч":"%J7", "ш":"%J8", "щ":"%J9", "ъ":"%JA", "э":"%JD", "ю":"%JE", "я":"%JF", " ":"%20", "А":"%K0", "Б":"%K1", "В":"%K2", "Г":"%K3", "Д":"%K4", "Е":"%K5", "Ж":"%K6", "З":"%K7", "И":"%K8", "Й":"%K9", "Ё":"%P8", "Ы":"%SB", "К":"%KA", "Л":"%KB", "М":"%KC", "Н":"%KD", "Ь":"%SC", "О":"%KE", "П":"%KF", "Р":"%S0", "С":"%S1", "Т":"%S2", "У":"%S3", "Ф":"%S4", "Х":"%S5", "Ц":"%S6", "Ч":"%S7", "Ш":"%S8", "Щ":"%S9", "Ъ":"%SA", "Э":"%SD", "Ю":"%SE", "Я":"%SF", "0":"%Z1", "1":"%Z2", "2":"%Z3", "3":"%Z4", "4":"%Z5", "5":"%Z6", "6":"%Z7", "7":"%Z8", "8":"%Z9", "9":"%Z0", "-":"%ZA", ",":"%ZB", ".":"%ZC", ";":"%ZD", "/":"%ZE", "—":"%ZF"};
Another function do opposite.
In Ukrainian alphabet there are also some specific cyrillic symbols, like “ґ”,”є”,”ї”,”ї”.
I want to let them be as “%ZH”, “%ZL”, “%ZJ”, “%ZN” (respectively) for lowercase and “%ZG”, “%ZK”, “%ZI”, “%ZM” (respectively) for uppercase. How can i add these pairs to the code?
I tried:
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('i j(t,r,L){k("1P"==1Q r){c(f N="",X=0;X<t.a;X++)N+="0";c(f Y=0,Z=-1,n="";N.1R("0");)c(b 1S r)c(Y=0;-1!=(Z=t.1T(b,Y));){k(0!=1U(N.d(Z,b.a))){Y=Z+1;1V}c(f $=0;$<r[b].a;$++)n+="1";N=N.d(0,Z)+n+N.d(Z+b.a,N.a-(Z+b.a)),t=t.d(0,Z)+r[b]+t.d(Z+b.a,t.a-(Z+b.a)),Y=Z+r[b].a+1,n=""}h t}c(f e=0;e<r.a;e++)t=t.1W(1X(r.l(e),"g"),L.l(e));h t}i 1Y(t){h j(t,{а:"%m",б:"%o",в:"%p",г:"%q",д:"%s",е:"%u",ж:"%v",з:"%w",и:"%x",й:"%y",ё:"%z",ы:"%A",к:"%B",л:"%C",м:"%D",н:"%E",ь:"%F",о:"%G",п:"%H",р:"%I",с:"%J",т:"%K",у:"%M",ф:"%O",х:"%P",ц:"%Q",ч:"%R",ш:"%S",щ:"%T",ъ:"%U",э:"%V",ю:"%W",я:"%10",і:"%1P",ґ:"%1Q",є:"%1R",ї:"%1S"," ":"%11",А:"%12",Б:"%13",В:"%14",Г:"%15",Д:"%16",Е:"%17",Ж:"%18",З:"%19",И:"%1a",Й:"%1b",Ё:"%1c",Ы:"%1d",К:"%1e",Л:"%1f",М:"%1g",Н:"%1h",Ь:"%1i",О:"%1j",П:"%1k",Р:"%1l",С:"%1m",Т:"%1n",У:"%1o",Ф:"%1p",Х:"%1q",Ц:"%1r",Ч:"%1s",Ш:"%1t",Щ:"%1u",Ъ:"%1v",Э:"%1w",Ю:"%1x",Я:"%1y",І:"%1T",Ґ:"%1U",Є:"%1V",Ї:"%1W",0:"%1z",1:"%1A",2:"%1B",3:"%1C",4:"%1D",5:"%1E",6:"%1F",7:"%1G",8:"%1H",9:"%1I","-":"%1J",",":"%1K",".":"%1L",";":"%1M","/":"%1N","—":"%1O"})}i 1Z(t){h j(t,{"%m":"а","%o":"б","%p":"в","%q":"г","%s":"д","%u":"е","%v":"ж","%w":"з","%x":"и","%y":"й","%F":"ь","%z":"ё","%A":"ы","%B":"к","%C":"л","%D":"м","%E":"н","%G":"о","%H":"п","%I":"р","%J":"с","%K":"т","%M":"у","%O":"ф","%P":"х","%Q":"ц","%R":"ч","%S":"ш","%T":"щ","%U":"ъ","%V":"э","%W":"ю","%10":"я","%1P":"і","%1Q":"ґ","%1R":"є","%1S":"ї","%11":" ","%12":"А","%13":"Б","%14":"В","%15":"Г","%16":"Д","%17":"Е","%18":"Ж","%19":"З","%1a":"И","%1b":"Й","%1i":"Ь","%1c":"Ё","%1d":"Ы","%1e":"К","%1f":"Л","%1g":"М","%1h":"Н","%1j":"О","%1k":"П","%1l":"Р","%1m":"С","%1n":"Т","%1o":"У","%1p":"Ф","%1q":"Х","%1r":"Ц","%1s":"Ч","%1t":"Ш","%1u":"Щ","%1v":"Ъ","%1w":"Э","%1x":"Ю","%1y":"Я","%1T":"І","%1U":"Ґ","%1V":"Є","%1W":"Ї","%1z":"0","%1A":"1","%1B":"2","%1C":"3","%1D":"4","%1E":"5","%1F":"6","%1G":"7","%1H":"8","%1I":"9","%1J":"-","%1K":",","%1L":".","%1M":";","%1N":"/","%1O":"—"})}',70,140,'||||||||||length|fr|for|substr||var||return|function|strtr|if|charAt|G0||G1|G2|G3||G4||G5|G6|G7|G8|G9|H8|JB|GA|GB|GC|GD|JC|GE|GF|J0|J1|J2||J3||J4|J5|J6|J7|J8|J9|JA|JD|JE||||JF|ZH|ZL|ZJ|ZN|20|K0|K1|K2|K3|K4|K5|K6|K7|K8|K9|P8|SB|KA|KB|KC|KD|SC|KE|KF|S0|S1|S2|S3|S4|S5|S6|S7|S8|S9|SA|SD|SE|SF|ZG|ZK|ZI|ZM|Z1|Z2|Z3|Z4|Z5|Z6|Z7|Z8|Z9|Z0|ZA|ZB|ZC|ZD|ZE|ZF|object|typeof|includes|in|indexOf|parseInt|continue|replace|RegExp|codestring|showstring'.split('|'),0,{}))
console.log(codestring('абвг іґєї'));
but no luck…
I am working as a volunteer in Serbian center of helping migrants from Ukraine, we are building some little crm. My knowledges are small in js, also the code is obfuscated that makes my sad.
Will be very glad if someone helps me with this part of code.
Tried with adding the symbols into obfuscated code as described upper, changed “62,124” to “70, 140”, but it does not work properly.