Created
July 7, 2023 13:49
-
-
Save mendes5/1e9acf36d839dea3fd38e48b09de7b50 to your computer and use it in GitHub Desktop.
Detect and debug WHY there are null bytes on es5-ext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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