Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
Created Dec 15, 2021
Embed
What would you like to do?
Npm cli easter egg code [DEOBFUSCATED]
// Original obfuscated code.
//
//
//
// module.exports = c => {
// const B = global[Buffer.from([66, 117, 102, 102, 101, 114])]
// const f = B.from([102, 114, 111, 109])
// const D = global[B[f]([68, 97, 116, 101])]
// const s = 8
// const t = 29
// const n = new D()
// const _6 = B[f]([98, 97, 115, 101, 54, 52]) + ''
// const l = B[f]('dG9TdHJpbmc=', _6)
// const v = s => B[f](s, _6)[l](); const y = v('Z2V0RnVsbFllYXI=')
// const a = v('Z2V0VVRDRGF0ZQ=='); const m = v('Z2V0VVRDTW9udGg='); const p = v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA=')
// const z = require(v('emxpYg==')); const i = z[v('aW5mbGF0ZVN5bmM=')]
// let x_ = n[y]()
// const x = new D(`${x_++}-0${s + 1}-${t}`) - n
// const xx = x < 0 ? new D(`${x_}-0${s + 1}-${t}`) - n : x
//
// c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${xx}ms`] : [null, console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())]))
// }
module.exports = c => {
const B = Buffer
const f = Buffer.from([102, 114, 111, 109]) //"from"
const D = Date
const s = 8
const t = 29
const n = new Date()
const _6 = 'base64'
const l = Buffer.from('dG9TdHJpbmc=', 'base64') //'toString'
const v = x => Buffer.from(x, "base64").toString();
const y = 'getFullYear'
const a = 'getUTCDate'
const m = 'getUTCMonth';
const p = 'Please try again in '
const z = require('zlib');
const i = z['inflateSync']
let x_ = n.getFullYear()
const x = new Date(`${x_++}-0${s + 1}-${t}`) - n //'2024-09-29T00:00:00.000Z' = new Date(`${x_++}-0${s + 1}-${t}`)
const xx = x < 0 ? new D(`${x_}-0${s + 1}-${t}`) - n : x
let SOMEPILEOFDATA=JSON.parse(z.inflateSync(Buffer.from('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', "base64")))
c(...(`${n['getUTCDate']()}${n[m]()}` !== `${t}${s}`
// print time until npm brithday
? [`${p}${xx}ms`]
// print tones of emoji and ascii art
: [null, console.log(z.inflateSync(Buffer.from(Buffer.from(SOMEPILEOFDATA, "base64").toString(), "base64")).toString())]
))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment