Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

HTML/80x86 polyglot

clone53421 (1310749) writes | more than 5 years ago

User Journal 0

Don't even ask...

javascript:void(prompt("Source code",unescape("<!-- %u0152\xC8%u017D\xD8\xBAP!\x81\xF2%20%20\xB4)%u20AC\xF4 \xCD!\xB4L0\xC0\xCD! --><html><head></head><body><script type=\x22text/javascript\x22>document.write(String(\x22Hello world!$\x22).split(\x22$\x22)[0])\x3B</script></body></html>")));

Don't even ask...

javascript:void(prompt("Source code",unescape("<!-- %u0152\xC8%u017D\xD8\xBAP!\x81\xF2%20%20\xB4)%u20AC\xF4 \xCD!\xB4L0\xC0\xCD! --><html><head></head><body><script type=\x22text/javascript\x22>document.write(String(\x22Hello world!$\x22).split(\x22$\x22)[0])\x3B</script></body></html>")));

Copy and paste into the address bar (IE or FF tested). Copy the prompted value and paste it into Notepad; that's the source code*. Save as polyglot.[com|htm] (ANSI encoding) and run. Note: the 80x86 implementation doesn't wait around, so run it from the command prompt or the window will disappear before you see the output.

*Because /. doesn't like the strange characters, I can't post the source code directly. However, once you've saved it as .htm in Notepad as described above – Unicode weirdness notwithstanding – opening it with a browser, viewing the source, copying and pasting into Notepad, and saving as .com should yield an identical copy of the program.

Note: The String() value is the actual data that the 80x86 code displays. As a result, you can easily change it to whatever pleases you. (Leave the $ at the end; it's the delimiter for the interrupt that prints the string. Consequentially, you can't print a string containing a $ character.) However, the beginning of the string is hard-coded, so you won't be able to change the HTML before it (for example to add a <title> value)... actually, try it and see what happens (don't make the HTML shorter though...).

cancel ×

0 comments

Sorry! There are no comments related to the filter you selected.

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>