简体   繁体   English

使用混淆的JavaScript生成字符串

[英]Generating string using obfuscated javascript

I saw this neat comment on reddit. 我在reddit上看到了这个简洁的评论。

https://www.reddit.com/r/ProgrammerHumor/comments/ak026v/aah_yes_c_my_favorite_soft_drink/ef1wi5c https://www.reddit.com/r/ProgrammerHumor/comments/ak026v/aah_yes_c_my_favorite_soft_drink/ef1wi5c

The author makes clever use of javascript statements like: 作者巧妙地使用了javascript语句,例如:

!![]+[]          // 'true'
![]+[]           // 'false'
!![]+![]         // 1
[][!![]+![]]+[]  // 'undefined'

to generate strings from these named JS primitives, and the uses array access to build a string (reeeeeeeeee) from them. 从这些命名的JS原语生成字符串,并使用数组访问权从它们构建一个字符串(reeeeeeeeee)。

I'd love to use this method to troll some friends, but I'd like some more letters. 我很乐意使用这种方法来诱骗一些朋友,但我想要更多的信件。

true, false and undefined yield the letters "d" "n" "s" "f" "e" "a" "t" "i" "r" "l" "u" - is there a way to get other alpha chars? true,false和undefined产生字母“ d”,“ n”,“ s”,“ f”,“ e”,“ a”,“ t”,“ i”,“ r”,“ l”,“ u”-是否可以获取其他字母字符? Specifically "p" and "o" but other chars would be cool too? 特别是“ p”和“ o”,但其他字符也很酷?

"This is where you can find your answer." “在这里您可以找到答案。”

This in obfuscation is -- (16441 chars) 造成混淆的原因是-(16441个字符)

[][([+!+[]+[!+[]+!+[]]]+(+[()())[!+[]+!+[]+!+[]+[+[]]]+(+(+!+[]+[+[]]+[+!+[]]))[(![+!+[]]+([+(+(+!+[]+[+[]]+[+!+[]]))[(![+!+[]]+(!+(![+!+[]+[!+[]+!+[]]])() [] [([+!+ [] + [!+ [] +!+ []]] +(+ [()())[!+ [] +!+ [] +!+ [] + [+ []]] +(+(+!+ [] + [+ []] + [+!+ []]))[(![+!+ []] +([+(+(+!+ [ ] + [+ []] + [+!+ []]))[(![+!+ []] +(!+(![+!+ [] + [!+ [] +!+ [] ]])()

Refer the link here for more info 有关更多信息,请参考此处的链接

Full list of conversions 转化的完整列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM