//Show the analysis static private void DisplayAnalysisResults(bool generateXmlOutput, bool showPInvokeDetails, bool showInternalCallDetails, ProbeScope probeScope, ResultType resultType, string[] assemblyNames) { Probe probe = new Probe(probeScope, resultType, showPInvokeDetails); probe.XmlResults = generateXmlOutput; Console.WriteLine(probe.Analyse(assemblyNames)); }
private bool showPInvokeDetails; //Should we retrieve PInvoke call details... //Create an instance public Probe(ProbeScope probeScope, ResultType resultType, bool showPInvokeDetails) { this.ProbeScope = probeScope; this.xmlResults = false; this.showPInvokeDetails = showPInvokeDetails; this.ResultType = resultType; this.internalCallDetails = new Hashtable(); this.pinvokeDetails = new Hashtable(); }
//Show the analysis static private void DisplayAnalysisResults(bool generateXmlOutput, bool probeReferencedAssemblies, ProbeScope probeScope, string[] assemblyNames) { try { AssemblyProbe probe = new AssemblyProbe(probeScope, probeReferencedAssemblies); probe.Probe(assemblyNames); DisplayAssemblyResults(generateXmlOutput, probe.Results); } catch (Exception e) { Console.Error.WriteLine("The following error occurred: {0}", e.Message); } }
static void Main(string[] args) { bool generateXmlOutput = false; //Should we generate XML? bool probeReferencedAssemblies = false; //Should we probe referenced assemblies? ProbeScope probeScope = ProbeScope.Assembly; //What level of detail should be shown ArrayList targetAssemblies = new ArrayList(); //The assemblies to analyse foreach (string arg in args) { switch (arg.ToUpper()) { //Generate XML output case "/X": generateXmlOutput = true; break; //Show type details case "/T": probeScope = ProbeScope.Type; break; //Show member details case "/M": probeScope = ProbeScope.All; break; //Show referenced details case "/R": probeReferencedAssemblies = true; break; //Display usage intructions case "/H": DisplayUsageInstructions(); return; default: targetAssemblies.Add(arg); break; } } DisplayAnalysisResults(generateXmlOutput, probeReferencedAssemblies, probeScope, (string[])targetAssemblies.ToArray(typeof(string))); }
static void Main(string[] args) { bool generateXmlOutput = false; //Should we generate XML? bool showPInvokeDetails = false; //Should we display the PInvoke details? bool showInternalCallDetails = false; //Should we display the InternalCall details? ProbeScope probeScope = ProbeScope.Assembly; //What level of detail should be shown ResultType resultType = ResultType.None; //Which types of results should be shown ArrayList targetAssemblies = new ArrayList(); //The assemblies to analyse //If we haven't got any arguments then tell the user how to use the program... if (args.Length == 0) { DisplayUsageInstructions(); return; } foreach (string arg in args) { switch (arg.ToUpper()) { //Generate XML output case "/X": generateXmlOutput = true; break; //Show type details case "/T": probeScope = ProbeScope.Type; break; //Show member details case "/M": probeScope = ProbeScope.All; break; //Only show managed results case "/G": resultType = resultType | ResultType.Managed; break; //Only show native results case "/N": resultType = resultType | ResultType.Native; break; //Show PInvoke details case "/P": showPInvokeDetails = true; break; //Display usage intructions case "/H": case "/?": DisplayUsageInstructions(); return; //Make sure we can handle directories... default: AddAssemblyPath(targetAssemblies, arg); break; } } //If no result type has been selected then show all results if (resultType == ResultType.None) { resultType = ResultType.All; } DisplayAnalysisResults(generateXmlOutput, showPInvokeDetails, showInternalCallDetails, probeScope, resultType, (string[])targetAssemblies.ToArray(typeof(string))); }
private ProbeScope probeScope; //The scope of the probe #region Constructor and Properties //Create an instance public AssemblyProbe(ProbeScope probeScope, bool probeReferencedAssemblies) { this.probeScope = probeScope; this.probeReferencedAssemblies = probeReferencedAssemblies; }
protected readonly XmlDocument Document; //The document to build the results from... //Create an instance protected ResultsBuilder(ProbeScope probeScope, ResultType resultType, XmlDocument document) { this.ProbeScope = probeScope; this.ResultType = resultType; this.Document = document; }
//Create an instance public TextResultsbuilder(ProbeScope probeScope, ResultType resultType, XmlDocument document) : base(probeScope, resultType, document) { }
ArrayList peFiles; //The PEFiles //Create an instance public PEFileProbe(ProbeScope probeScope, ResultType resultType) : base(probeScope, resultType) { }