Skip to content

Instantly share code, notes, and snippets.

@mendes5
Created July 7, 2023 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mendes5/1e9acf36d839dea3fd38e48b09de7b50 to your computer and use it in GitHub Desktop.
Save mendes5/1e9acf36d839dea3fd38e48b09de7b50 to your computer and use it in GitHub Desktop.
Detect and debug WHY there are null bytes on es5-ext
const fs = require('fs');
const inspector = require('node:inspector');
const { statSync } = fs;
Object.assign(fs, {
statSync() {
if (arguments[0].includes('\x00')) {
console.log('YOU ACTIVATED MY TRAP CARD!!!', arguments[0].split(''));
inspector.open();
inspector.waitForDebugger();
debugger;
}
return statSync.call(fs, arguments);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment