This file contains 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
var fs = require("fs"); | |
var ws = fs.createWriteStream("0xbfc40000-0xbffffff0-scaled.log"); | |
var rs = fs.createReadStream("0xbfc40000-0xbffffff0.log"); | |
var line = 0; | |
function tohex(n) { | |
var out = n.toString(16); | |
return out; | |
} | |
rs.on("error", console.log.bind(console)); | |
rs.on("data", function(data) { | |
line += 16; | |
ws.write(data.toString().replace(/......../, tohex(line))); | |
}); | |
rs.on("end", function() { | |
console.log(line); | |
ws.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment