
I went through many blogs and forums when I was required to read a dll and understand if particular string value exists in the dll or not.
I wanted to read dll not for the business logic but for the string value present in dll or not.
Though Ildasm.exe tool is a great help but it tells about the properties and methods in the dll, not about the string value. When you double click on the content in ildasm window then it shows IL (intermediate language).
So now I want to create and read the IL file from this particular DLL.
Code as given below: -
string mSILlocation = "D:\\InterfacingService.il";
string command1 = dllLocation.Insert(dllLocation.Length, mSILlocation).Insert(dllLocation.Length, " /output:");
//string Command = "[DLL Location] /output:[location of new IL file created](file.il)";
int ExitCode;
ProcessStartInfo ProcessInfo;
System.Diagnostics.Process Process;
ProcessInfo = new ProcessStartInfo("C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\bin\\ildasm.exe", command1);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(Timeout);
ExitCode = Process.ExitCode;
Process.Close();
No comments:
Post a Comment