Ejemplo n.º 1
0
        private bool TryGetPmipFunction(out PmipFunctionDataItem pmipFunction)
        {
            pmipFunction = _stackContext.GetDataItem <PmipFunctionDataItem>();
            if (pmipFunction != null)
            {
                return(true);
            }

            foreach (var module in this._frame.RuntimeInstance.GetModuleInstances())
            {
                var address = (module as DkmNativeModuleInstance)?.FindExportName("mono_pmip", IgnoreDataExports: true);
                if (address == null)
                {
                    continue;
                }
                var item = new PmipFunctionDataItem {
                    PmipFunction = "0x" + address.CPUInstructionPart.InstructionPointer.ToString("X")
                };
                pmipFunction = item;
                _stackContext.SetDataItem(DkmDataCreationDisposition.CreateAlways, item);
                return(true);
            }

            return(false);
        }
		private bool TryGetPmipFunction(out PmipFunctionDataItem pmipFunction)
		{
			pmipFunction = _stackContext.GetDataItem<PmipFunctionDataItem>();
			if (pmipFunction != null)
				return true;

			foreach (var module in Modules)
			{
				var definition = $"{{,,{module}}}mono_pmip";

				PmipFunctionDataItem item = null;
				if (!EvaluateExpression(definition, r => item = new PmipFunctionDataItem {PmipFunction = definition}))
					continue;

				pmipFunction = item;
				_stackContext.SetDataItem(DkmDataCreationDisposition.CreateAlways, item);
				return true;
			}

			return false;
		}
Ejemplo n.º 3
0
        private bool TryGetPmipFunction(out PmipFunctionDataItem pmipFunction)
        {
            pmipFunction = _stackContext.GetDataItem<PmipFunctionDataItem>();
            if (pmipFunction != null)
                return true;

            foreach (var module in this._frame.RuntimeInstance.GetModuleInstances())
            {
                var address = (module as DkmNativeModuleInstance)?.FindExportName("mono_pmip", IgnoreDataExports: true);
                if (address == null)
                    continue;
                var item = new PmipFunctionDataItem { PmipFunction = "0x" + address.CPUInstructionPart.InstructionPointer.ToString("X") };
                pmipFunction = item;
                _stackContext.SetDataItem(DkmDataCreationDisposition.CreateAlways, item);
                return true;
            }

            return false;
        }