Synced with Agent Repo

1. Capped smbios to 64k
2. Removed commented out code from win-console.js
3. Updated win-terminal to check for null before pushing
This commit is contained in:
Bryan Roe 2020-04-06 17:21:19 -07:00
parent f5c5ebaf5e
commit 8550ca648b
3 changed files with 28 additions and 17 deletions

View File

@ -191,6 +191,12 @@ function SMBiosTables()
catch(e) catch(e)
{ {
} }
try
{
if (JSON.stringify(r).length > 65535) { r = {}; }
}
catch(ee)
{}
return r; return r;
} }
this.processorInfo = function processorInfo(data) { this.processorInfo = function processorInfo(data) {

View File

@ -145,7 +145,6 @@ function WindowsConsole()
this.TrayIcon.remove(); this.TrayIcon.remove();
handled = true; handled = true;
} }
//if (!handled) { console.log(msg); }
} }
}); });
retVal.remove = function remove() retVal.remove = function remove()

View File

@ -401,7 +401,8 @@ function windows_terminal() {
} }
} }
} }
this._WriteCharacter = function (key, bControlKey) { this._WriteCharacter = function (key, bControlKey)
{
var rec = GM.CreateVariable(20); var rec = GM.CreateVariable(20);
rec.Deref(0, 2).toBuffer().writeUInt16LE(KEY_EVENT); // rec.EventType rec.Deref(0, 2).toBuffer().writeUInt16LE(KEY_EVENT); // rec.EventType
rec.Deref(4, 4).toBuffer().writeUInt16LE(1); // rec.Event.KeyEvent.bKeyDown rec.Deref(4, 4).toBuffer().writeUInt16LE(1); // rec.Event.KeyEvent.bKeyDown
@ -478,11 +479,14 @@ function windows_terminal() {
return (retVal); return (retVal);
} }
this._SendDataBuffer = function (data) { this._SendDataBuffer = function (data)
{
// { data, attributes, width, height, x, y } // { data, attributes, width, height, x, y }
if (this._stream != null)
{
var dy, line, attr; var dy, line, attr;
for (dy = 0; dy < data.height; ++dy) { for (dy = 0; dy < data.height; ++dy)
{
line = data.data[dy]; line = data.data[dy];
attr = data.attributes[dy]; attr = data.attributes[dy];
line.s = line.toString(); line.s = line.toString();
@ -492,9 +496,11 @@ function windows_terminal() {
this._stream.push(TranslateLine(data.x + 1, data.y + dy + 1, line, attr)); this._stream.push(TranslateLine(data.x + 1, data.y + dy + 1, line, attr));
} }
} }
}
this._SendScroll = function _SendScroll(dx, dy) { this._SendScroll = function _SendScroll(dx, dy)
if (this._scrollTimer) { return; } {
if (this._scrollTimer || this._stream == null) { return; }
var info = GM.CreateVariable(22); var info = GM.CreateVariable(22);
if (this._kernel32.GetConsoleScreenBufferInfo(this._stdoutput, info).Val == 0) { throw ('Error getting screen buffer info'); } if (this._kernel32.GetConsoleScreenBufferInfo(this._stdoutput, info).Val == 0) { throw ('Error getting screen buffer info'); }