From: Oleg T. <he...@us...> - 2005-07-19 19:47:07
|
Update of /cvsroot/mvp-xml/EXSLT/v1/src/MethodRenamer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29285/v1/src/MethodRenamer Added Files: .cvsignore App.config MethodRenamer.cs MethodRenamer.csproj MethodRenamer.csproj.user MethodRenamer.csproj.vspscc MethodRenamer.exe MethodRenamer.exe.config Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo *.pdb *.exe --- NEW FILE: MethodRenamer.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MethodRenamer.csproj.vspscc --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MethodRenamer.exe.config --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MethodRenamer.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{A22418E5-DCE6-4D12-A016-151EA614A787}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "MethodRenamer" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Exe" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "GotDotNet.Exslt.MethodRenamer" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "Mvp.Xml.Exslt.MethodRenamer.MethodRenamer" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "true" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = ".\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = ".\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> </References> </Build> <Files> <Include> <File RelPath = "App.config" BuildAction = "None" /> <File RelPath = "MethodRenamer.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: MethodRenamer.cs --- using System; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Configuration; namespace Mvp.Xml.Exslt.MethodRenamer { /// <summary> /// An utility to rename methods in MSIL code. /// </summary> public class MethodRenamer { [STAThread] static void Main(string[] args) { IDictionary dictionary = (IDictionary)ConfigurationSettings.GetConfig("names"); //Reads input IL code StreamReader reader = new StreamReader(args[0]); //Writes output IL code StreamWriter writer = new StreamWriter(args[1]); string line; //Go read line by line while ((line = reader.ReadLine())!=null) { //Method definition? if (line.Trim().StartsWith(".method")) { writer.WriteLine(line); line = reader.ReadLine(); if (line.IndexOf("(")!=-1) { string methodName = line.Trim().Substring(0, line.Trim().IndexOf("(")); if (dictionary.Contains(methodName)) { writer.WriteLine(line.Replace(methodName+"(", "'"+(string)dictionary[methodName]+"'(")); Console.WriteLine("Found '" + methodName + "' method, renamed to '" + dictionary[methodName] + "'"); } else writer.WriteLine(line); } else writer.WriteLine(line); } else writer.WriteLine(line); } reader.Close(); writer.Close(); } } } --- NEW FILE: MethodRenamer.csproj.user --- <VisualStudioProject> <CSHARP LastOpenVersion = "7.10.3077" > <Build> <Settings ReferencePath = "" > <Config Name = "Debug" EnableASPDebugging = "false" EnableASPXDebugging = "false" EnableUnmanagedDebugging = "false" EnableSQLServerDebugging = "false" RemoteDebugEnabled = "false" RemoteDebugMachine = "" StartAction = "Project" StartArguments = "" StartPage = "" StartProgram = "" StartURL = "" StartWorkingDirectory = "" StartWithIE = "false" /> <Config Name = "Release" EnableASPDebugging = "false" EnableASPXDebugging = "false" EnableUnmanagedDebugging = "false" EnableSQLServerDebugging = "false" RemoteDebugEnabled = "false" RemoteDebugMachine = "" StartAction = "Project" StartArguments = "" StartPage = "" StartProgram = "" StartURL = "" StartWorkingDirectory = "" StartWithIE = "false" /> </Settings> </Build> <OtherProjectSettings CopyProjectDestinationFolder = "" CopyProjectUncPath = "" CopyProjectOption = "0" ProjectView = "ProjectFiles" ProjectTrust = "0" /> </CSHARP> </VisualStudioProject> --- NEW FILE: App.config --- (This appears to be a binary file; contents omitted.) |