File: connected-users-websocket/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   connected-users-websocket/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js   Download  
File: connected-users-websocket/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 1,505 bytes
 

Contents

Class file image Download
var activeXObfuscator = require('./index'); var assert = require('assert'); var OBFUSCATED_ACTIVE_X_OBJECT = activeXObfuscator.OBFUSCATED_ACTIVE_X_OBJECT; var OBFUSCATED_ACTIVE_X = activeXObfuscator.OBFUSCATED_ACTIVE_X; var input = "foo(new ActiveXObject('Microsoft.XMLHTTP'))"; var expected = "foo(new window[" + OBFUSCATED_ACTIVE_X_OBJECT + "]('Microsoft.XMLHTTP'))"; assert.equal(activeXObfuscator(input), expected); var input = "var foo = 'ActiveXObject';"; var expected = "var foo = " + OBFUSCATED_ACTIVE_X_OBJECT + ";"; assert.equal(activeXObfuscator(input), expected); var input = 'var foo = "ActiveXObject";'; var expected = "var foo = " + OBFUSCATED_ACTIVE_X_OBJECT + ";"; assert.equal(activeXObfuscator(input), expected); var input = 'var foo = o.ActiveXObject;'; var expected = "var foo = o[" + OBFUSCATED_ACTIVE_X_OBJECT + "];"; assert.equal(activeXObfuscator(input), expected); var input = 'var foo = "ActiveX";'; var expected = "var foo = " + OBFUSCATED_ACTIVE_X + ";"; assert.equal(activeXObfuscator(input), expected); var input = "var foo = 'ActiveX';"; var expected = "var foo = " + OBFUSCATED_ACTIVE_X + ";"; assert.equal(activeXObfuscator(input), expected); var input = "var foo; // ActiveX is cool"; var expected = "var foo; // Ac...eX is cool"; assert.equal(activeXObfuscator(input), expected); var input = "var foo = 'ActiveX is cool';"; assert.throws(function() { activeXObfuscator(input); }, /Unknown ActiveX occurence/);