Hallo everyone,

Iam using mono cecil in visual studio 2010 visual c#, Here is my code
where i load the assembly into the moduledefinition to read the
architecture of the .dll file.

Stream stream;
 Image image;

            stream = new FileStream(@"d:\testen64.dll", FileMode.Open,
FileAccess.Read);
           AssemblyDefinition assembly =
AssemblyDefinition.ReadAssembly(stream);
           ModuleDefinition mdef =
ModuleDefinition.ReadModule(stream);

           string st = mdef.Architecture.ToString();
           Console.WriteLine(st);
The problem is iam getting an error in the imagereader.cs file when it
try to check the

if (ReadUInt16() != 0x5a4d)

  throw new BadImageFormatException();

When i try to read the value ReadUInt16() value iam getting 23117
which is a decimal value of 0x5a4d ?..

Any idea how can i proceed ?..

Thank you..

Dinesh.

-- 
--
mono-cecil

Reply via email to