Sha256: cf2b43e6061a7007582ad42a3d7a53220c689c74fd763cc7cd81f588e53fcfda

Contents?: true

Size: 1.47 KB

Versions: 17

Compression:

Stored size: 1.47 KB

Contents

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/);

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/test.js