mirror of
https://github.com/yardenshafir/WinDbg_Scripts
synced 2026-06-08 18:28:57 +00:00
Update filterCommPorts.js
Add functions to enumerate all server ports for a single filter driver or for all filters.
This commit is contained in:
+49
-2
@@ -5,7 +5,9 @@ function initializeScript()
|
||||
return [new host.functionAlias(GetHandlesToDevice, "DeviceFileHandles"),
|
||||
new host.functionAlias(GetQueuedIrpsForPort, "IrpsForPort"),
|
||||
new host.functionAlias(RegisteredFilterDrivers, "RegisteredFilters"),
|
||||
new host.functionAlias(EnumPortsForFilter, "EnumPortsForFilter"),
|
||||
new host.functionAlias(EnumCommPortListForFilter, "EnumCommPortListForFilter"),
|
||||
new host.functionAlias(EnumServerPortsForFilter, "EnumServerPortsForFilter"),
|
||||
new host.functionAlias(AllServerPorts, "AllServerPorts"),
|
||||
new host.apiVersionSupport(1, 6)];
|
||||
}
|
||||
|
||||
@@ -84,6 +86,7 @@ function RegisteredFilterDrivers()
|
||||
|
||||
for (let flt_frame of flt_frames) {
|
||||
dbgOutput("Frame ", flt_frame.FrameID, "\n");
|
||||
|
||||
let filters = host.namespace.Debugger.Utility.Collections.FromListEntry(flt_frame.RegisteredFilters.rList, "fltmgr!_FLT_FILTER", "Base.PrimaryLink");
|
||||
|
||||
for (let filter of filters) {
|
||||
@@ -93,11 +96,12 @@ function RegisteredFilterDrivers()
|
||||
for (let instance of instances) {
|
||||
dbgOutput("\t\tInstance: ", instance.address, ", Name: ", instance.Name, ", Altitude: ", instance.Altitude, "\n");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function EnumPortsForFilter(Filter)
|
||||
function EnumCommPortListForFilter(Filter)
|
||||
{
|
||||
let dbgOutput = host.diagnostics.debugLog;
|
||||
let v_filter = host.createTypedObject(Filter, host.getModuleType("FltMgr", "_FLT_FILTER"));
|
||||
@@ -121,3 +125,46 @@ function EnumPortsForFilter(Filter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function EnumServerPortsForFilter(Filter)
|
||||
{
|
||||
let dbgOutput = host.diagnostics.debugLog;
|
||||
let v_filter = host.createTypedObject(Filter, host.getModuleType("FltMgr", "_FLT_FILTER"));
|
||||
|
||||
if (v_filter.ConnectionList.mCount != 0)
|
||||
{
|
||||
let ports = host.namespace.Debugger.Utility.Collections.FromListEntry(v_filter.ConnectionList.mList, "fltmgr!_FLT_SERVER_PORT_OBJECT", "FilterLink");
|
||||
|
||||
for (let port of ports) {
|
||||
let objectHeaderAddress = host.parseInt64(port.address, 16).subtract(0x30);
|
||||
let objectHeader = host.createTypedObject(objectHeaderAddress, host.getModuleType("nt", "_OBJECT_HEADER"));
|
||||
|
||||
dbgOutput("\tServerPort ", objectHeader.ObjectName, ": ", port.address, "\n");
|
||||
dbgOutput("\t\tConnectNotify: ", port.ConnectNotify.address, "\n");
|
||||
dbgOutput("\t\tDisconnectNotify: ", port.DisconnectNotify.address, "\n");
|
||||
dbgOutput("\t\tMessageNotify: ", port.MessageNotify.address, "\n");
|
||||
dbgOutput("\t\tNumberOfConnections: ", port.NumberOfConnections, "\n");
|
||||
dbgOutput("\t\tMaxConnections: ", port.MaxConnections, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AllServerPorts()
|
||||
{
|
||||
let dbgOutput = host.diagnostics.debugLog;
|
||||
let fltglobals = host.getModuleSymbolAddress("fltmgr", "FltGlobals");
|
||||
let typedFltGlobals = host.createTypedObject(fltglobals, "fltmgr", "_GLOBALS");
|
||||
let flt_frames = host.namespace.Debugger.Utility.Collections.FromListEntry(typedFltGlobals.FrameList.rList, "fltmgr!_FLTP_FRAME", "Links");
|
||||
|
||||
for (let flt_frame of flt_frames) {
|
||||
dbgOutput("Frame ", flt_frame.FrameID, "\n");
|
||||
|
||||
let filters = host.namespace.Debugger.Utility.Collections.FromListEntry(flt_frame.RegisteredFilters.rList, "fltmgr!_FLT_FILTER", "Base.PrimaryLink");
|
||||
|
||||
for (let filter of filters) {
|
||||
dbgOutput("Filter ", filter.Name, " : ", filter.address, "\n");
|
||||
EnumServerPortsForFilter(filter.address);
|
||||
dbgOutput("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user