Javascript vbscript challenge

Whilst hacking away in javascript I was experimenting with various things and I thought of a problem which would make a good challenge.

The idea was to produce some vbscript which executed the msgbox function without using parenthesis but the trick was not to raise a syntax error in javascript when parsing the code. I found a cool solution to this but lets see what you can come up with. Here are the main rules:-

Rules

1. No parenthesis may be used.
2. The vbscript version must execute msgbox with a argument of 1.
3. No syntax errors in either vbscript or jscript.
4. Errors can’t be turned off, using window.onerror for example is not allowed.
5. Both code samples must work in IE7.
6. The javascript and vbscript code should be identical.

In order to win the challenge you must provide the correct code which executes within the following tags:-

<script type="text/vbscript">
Your vbscript code here
</script>
 
<script type="text/javascript">
Your javascript code here
</script>
Share and Enjoy:
  • Digg
  • del.icio.us
  • Slashdot
  • StumbleUpon

Comments 9

  1. Giorgio Maone wrote:


    MsgBox 1′

    Posted 10 Nov 2008 at 12:59 am
  2. Giorgio Maone wrote:

    Any way to preserve formatting and JS comments? Let’s try this way…
    <pre>

    MsgBox 1′
    </pre>

    Posted 10 Nov 2008 at 1:00 am
  3. Giorgio Maone wrote:

    OK,
    unescape(
    “%27%27%0AMsgBox%201%27″
    )

    Posted 10 Nov 2008 at 1:04 am
  4. Gareth Heyes wrote:

    Sorry Giorgio my bad commenting in my blog, nice one! It was a sub challenge hehe :)

    Posted 10 Nov 2008 at 10:11 am
  5. Gareth Heyes wrote:

    Hmmmm tried it in IE7 and it causes syntax errors. Close but not correct.

    You can submit entries here:-
    http://sla.ckers.org/forum/read.php?2,25291

    Posted 10 Nov 2008 at 2:54 pm
  6. Giorgio Maone wrote:

    Gareth, did you decode it correctly?
    Here’s the code above live, tested in IE8 both in standard and compatibility mode:
    http://evil.hackademix.net/test/vbjs.html

    Posted 10 Nov 2008 at 4:25 pm
  7. Giorgio Maone wrote:

    OK, I tried to unescape my code above: your *ckying SpamBam elided the JS c-style comments once more, even if they were url-escaped :mad:

    Posted 10 Nov 2008 at 4:28 pm
  8. Gareth Heyes wrote:

    Ah-ha sorry again, that is a correct answer :)

    Posted 10 Nov 2008 at 4:47 pm
  9. Giorgio Maone wrote:

    Will this one pass through SpamBam?
    ‘\
    MsgBox 1′

    Posted 10 Nov 2008 at 6:37 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *

Comment spam protected by SpamBam