Esempio n. 1
0
        /// <summary>
        /// Gets the name of the function for the specified address.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="address">The address.</param>
        /// <param name="functionName">Name of the function.</param>
        /// <param name="displacement">The displacement.</param>
        public void GetProcessAddressFunctionName(Process process, ulong address, out string functionName, out ulong displacement)
        {
            ulong  distance;
            Module module;
            ISymbolProviderModule diaModule = GetDiaModule(process, address, out distance, out module);

            diaModule.GetFunctionNameAndDisplacement(process, address, (uint)distance, out functionName, out displacement);
            functionName = module.Name + "!" + functionName;
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the name of the function for the specified stack frame.
        /// </summary>
        /// <param name="stackFrame">The stack frame.</param>
        /// <param name="functionName">Name of the function.</param>
        /// <param name="displacement">The displacement.</param>
        public void GetStackFrameFunctionName(StackFrame stackFrame, out string functionName, out ulong displacement)
        {
            ulong  distance;
            Module module;
            ISymbolProviderModule diaModule = GetDiaModule(stackFrame.Process, stackFrame.InstructionOffset, out distance, out module);

            diaModule.GetFunctionNameAndDisplacement(stackFrame.Process, stackFrame.InstructionOffset, (uint)distance, out functionName, out displacement);
            if (!functionName.Contains("!"))
            {
                functionName = module.Name + "!" + functionName;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the name of the function for the specified address.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="address">The address.</param>
        /// <param name="functionName">Name of the function.</param>
        /// <param name="displacement">The displacement.</param>
        public void GetProcessAddressFunctionName(Process process, ulong address, out string functionName, out ulong displacement)
        {
            ulong  distance;
            Module module;
            ISymbolProviderModule symbolProviderModule = GetSymbolProviderModule(process, address, out distance, out module);

            if (symbolProviderModule == null)
            {
                FallbackSymbolProvider.GetProcessAddressFunctionName(process, address, out functionName, out displacement);
                return;
            }

            symbolProviderModule.GetFunctionNameAndDisplacement((uint)distance, out functionName, out displacement);
            if (!functionName.StartsWith(module.Name + "!"))
            {
                functionName = module.Name + "!" + functionName;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the name of the function for the specified stack frame.
        /// </summary>
        /// <param name="stackFrame">The stack frame.</param>
        /// <param name="functionName">Name of the function.</param>
        /// <param name="displacement">The displacement.</param>
        public void GetStackFrameFunctionName(StackFrame stackFrame, out string functionName, out ulong displacement)
        {
            ulong  distance;
            Module module;
            ISymbolProviderModule symbolProviderModule = GetSymbolProviderModule(stackFrame.Process, stackFrame.InstructionOffset, out distance, out module);

            if (symbolProviderModule == null)
            {
                FallbackSymbolProvider.GetStackFrameFunctionName(stackFrame, out functionName, out displacement);
                return;
            }

            symbolProviderModule.GetFunctionNameAndDisplacement((uint)distance, out functionName, out displacement);
            if (string.IsNullOrEmpty(functionName))
            {
                functionName = module.Name + "!???";
            }
            else if (!functionName.Contains("!"))
            {
                functionName = module.Name + "!" + functionName;
            }
        }