This commit is contained in:
Christopher Jeffrey 2013-02-24 18:22:32 -06:00
parent 8d92eb49c6
commit 1bd2a71946
1 changed files with 1 additions and 51 deletions

View File

@ -291,59 +291,9 @@ Tput.prototype.parseExtended = function(data, _data, _h, _i) {
}
}
// string offsets: 14 - 128, length: 114 (57 short)
// sym offsets: 128 - 248, length: 120 (60 short)
var stroff = [];
var symoff = [];
var stroffsets = data.slice(14, 128);
var symoffsets = data.slice(128, 248);
for (var a = 0; a < stroffsets.length; a += 2) {
stroff.push((stroffsets[a + 1] << 8) | stroffsets[a]);
}
for (var a = 0; a < symoffsets.length; a += 2) {
symoff.push((symoffsets[a + 1] << 8) | symoffsets[a]);
}
console.log(stroff);
console.log(symoff);
var end = data.slice(248, 260);
console.log(JSON.stringify(end.toString('ascii')));
//process.exit(0);
// need to get from 128 to 248
// diff: 120
//i += 60 * 2;
// Pass over the sym offsets and get to the string table.
i = data.length - h.lastStrTableOffset;
/*
var t = [];
data = data.slice(16, 248);
for (var a = 0; a < data.length; a += 2) {
t.push((data[a + 1] << 8) | data[a]);
}
console.log(t.slice(0, h.strCount));
console.log(t.slice(h.strCount));
process.exit(0);
data = data.slice(248, 612).toString('ascii').split('\0');
console.log(data);
process.exit(0);
*/
//while (!(i % 2) && data[i] !== 0x1b) i++;
//l = i + h.strCount * 2 + 6;
//for (; i < l; i += 2);
//l = i + h.strCount * 2;
//for (; i < l; i += 2);
//while (data[i] !== 0x1b) i++;
//console.log(_strings);
//console.log(_strings.length);
//console.log(data.slice(i - 10, i + 10));
//process.exit(0);
// String Table
_strings.forEach(function(offset, k) {
if (offset === -1) {