1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Updated, so getService() on Windows will show owning user

This commit is contained in:
Bryan Roe
2019-04-08 15:41:41 -07:00
parent 41da3514d2
commit d457364197

View File

@@ -100,6 +100,7 @@ function serviceManager()
this.proxy.CreateMethod('EnumServicesStatusExA');
this.proxy.CreateMethod('OpenServiceA');
this.proxy.CreateMethod('QueryServiceStatusEx');
this.proxy.CreateMethod('QueryServiceConfigA');
this.proxy.CreateMethod('QueryServiceConfig2A');
this.proxy.CreateMethod('ControlService');
this.proxy.CreateMethod('StartServiceA');
@@ -253,6 +254,19 @@ function serviceManager()
}
}
var query_service_configa_DWORD = this.GM.CreateVariable(4);
this.proxy.QueryServiceConfigA(h, 0, 0, query_service_configa_DWORD);
if (query_service_configa_DWORD.toBuffer().readUInt32LE() > 0)
{
var query_service_configa = this.GM.CreateVariable(query_service_configa_DWORD.toBuffer().readUInt32LE());
if(this.proxy.QueryServiceConfigA(h, query_service_configa, query_service_configa._size, query_service_configa_DWORD).Val != 0)
{
var val = query_service_configa.Deref(this.GM.PointerSize == 4 ? 28 : 48, this.GM.PointerSize).Deref().String;
Object.defineProperty(retVal, 'user', { value: val });
}
}
var failureactions = this.GM.CreateVariable(8192);
var bneeded = this.GM.CreateVariable(4);
if (this.proxy.QueryServiceConfig2A(h, 2, failureactions, 8192, bneeded).Val != 0)