コード例 #1
0
        public void TestSerializeAndDeserializeDriverObject()
        {
            var DriverName   = "MyName";
            var driverObject = new DriverObject(DriverName);
            var serialized   = JsonUtils.Dehydrate(driverObject);
            var rehydrated   = JsonUtils.Hydrate(serialized, RESULT_TYPE.DRIVER);

            Assert.IsTrue(serialized == JsonUtils.Dehydrate(rehydrated));
            Assert.IsTrue(rehydrated.Identity == DriverName);
        }
コード例 #2
0
        List <DriverObject> DoIt(HashSet <ulong> records)
        {
            List <DriverObject> drivers = new List <DriverObject>();

            foreach (var item in records)
            {
                ObjectHeader oh     = new ObjectHeader(_profile, _dataProvider, physicalAddress: item);
                string       name   = oh.HeaderNameInfo.Name;
                ulong        offset = (ulong)oh.Size + item;
                DriverObject drvObj = new DriverObject(_profile, _dataProvider, oh, physicalAddress: offset);
                drvObj.Name = name;
                drivers.Add(drvObj);
            }
            return(drivers);
        }
コード例 #3
0
        public DriverResult(DriverObject driverObject)
        {
            _name        = driverObject.Name;
            _driverName  = driverObject.DriverName;
            _serviceName = driverObject.DriverExtension.ServiceKeyName;
            _size        = "0x" + driverObject.DriverSize.ToString("X").ToLower() + " (" + driverObject.DriverSize.ToString() + ")";
            _handles     = driverObject.HandleCount.ToString();
            _pointers    = driverObject.PointerCount.ToString();
            _address     = "0x" + driverObject.PhysicalAddress.ToString("X").ToLower();
            _driverStart = "0x" + driverObject.DriverStartPointer.ToString("X").ToLower();
            _driverStartPhysicalAddress = "0x" + driverObject.DriverStartPhysicalAddress.ToString("X").ToLower();
            _driverExtension            = "0x" + driverObject.DriverExtensionVirtualAddress.ToString("X").ToLower();
            InfoHelper helper = new InfoHelper();

            helper.Type            = InfoHelperType.DriverObject;
            helper.PhysicalAddress = driverObject.PhysicalAddress;
            helper.BufferSize      = 1024; // need to get the actual driver object size
            helper.Title           = "Driver Object";
            helper.TheObject       = driverObject;
            _object = helper;
        }