Exemple #1
0
        public string getCallArgumentString(List <int> rows)
        {
            // Generates a merged argument string for the specified call rows.
            if (rows.Any() && dataVis != null)
            {
                // Sort the rows, arguments will be displayed in call order
                rows.Sort();
                // Check the first datapoint
                oSingleData datapoint = dataVis.getData(rows[0]);
                if (datapoint == null)
                {
                    return(string.Empty);
                }
                if (oFunctionMaster.destinationToFunction.ContainsKey(datapoint.destination))
                {
                    // Loop through, printing the calls
                    string result = "";
                    for (int i = 0; i < rows.Count; i++)
                    {
                        datapoint = dataVis.getData(rows[i]);
                        oFunction function = ((oFunction)oFunctionMaster.destinationToFunction[datapoint.destination]);
                        result = result + datapoint.source.ToString("X") + " -> " + datapoint.destination.ToString("X") + Environment.NewLine + function.getArgumentString(datapoint).toString() + Environment.NewLine + Environment.NewLine;
                    }

                    // Finished merging
                    return(result.Trim());
                }
                return("ERROR: The function corresponding to address " + datapoint.destination.ToString("X") + " was not found.");
            }
            return("");
        }
Exemple #2
0
 public bool isFunctionAddress(oFunction function)
 {
     if (function.address == functionAddress)
     {
         return(true);
     }
     {
         return(false);
     }
 }
Exemple #3
0
 public bool isInterModular(oFunction call)
 {
     if (call.peCallers.Count > 0)
     {
         // Remove the intra-modular calls
         //call.normalCallers = new ArrayList(0);
         return(true);
     }
     {
         return(false);
     }
 }
Exemple #4
0
 public bool isNotInList(oFunction call)
 {
     return(!functions.Contains(call.address));
 }
Exemple #5
0
        /// <summary>
        /// Returns the row and column text for a listgridview of calls.
        /// </summary>
        /// <param name="row">Cell row</param>
        /// <param name="column">Cell column</param>
        /// <returns></returns>
        public Object getCallListCell(int row, int column, int columnWidth, Font font)
        {
            if (dataVis == null)
            {
                return("");
            }

            // Get this row and column
            if (row < dataVis.getCallCount() && row >= 0)
            {
                // Get the call in question
                oSingleData call = dataVis.getData(row);
                if (call == null)
                {
                    return("");
                }

                HEAP_INFO heap;
                string    name;
                switch (column)
                {
                case 0:
                    return(row.ToString());

                case 1:
                    // Source address
                    heap = oMemoryFunctions.LookupAddressInMap(oProcess.map, call.source);

                    // Generate the string representation of this address
                    if (heap.associatedModule != null)
                    {
                        name = heap.associatedModule.ModuleName + " + 0x" +
                               (call.source - (uint)heap.associatedModule.BaseAddress).ToString("X") +
                               " (0x" + call.source.ToString("X") + ")";
                    }
                    else
                    {
                        name = "0x" + call.source.ToString("X");
                    }
                    return(name);

                case 2:
                    // Destination address
                    heap = oMemoryFunctions.LookupAddressInMap(oProcess.map, call.destination);

                    // Generate the string representation of this address
                    if (heap.associatedModule != null)
                    {
                        name = heap.associatedModule.ModuleName + " + 0x" +
                               (call.destination - (uint)heap.associatedModule.BaseAddress).ToString("X")
                               + " (0x" + call.destination.ToString("X") + ")";
                    }
                    else
                    {
                        name = "0x" + call.destination.ToString("X");
                    }

                    // Add the function name if known
                    if (oFunctionMaster.destinationToFunction.ContainsKey(call.destination))
                    {
                        oFunction function = (oFunction)oFunctionMaster.destinationToFunction[call.destination];
                        if (function.name != "")
                        {
                            name = function.name + " - " + name;
                        }
                        if (function.disabled)
                        {
                            name = @"DISABLED - " + name;
                        }
                    }
                    return(name);

                case 3:
                    // Arguments
                    oFunction functionBase = (oFunction)oFunctionMaster.destinationToFunction[call.destination];
                    if (functionBase == null)
                    {
                        return("error, null associated function");
                    }

                    // Return the function data pair with the specified column width restriction
                    if (columnWidth > 0)
                    {
                        return(functionBase.getArgumentString(call, columnWidth, font).toString());
                    }
                    return(functionBase.getArgumentString(call).toString());

                default:
                    return("?");
                }
            }
            return("?");
        }