an abnormal performance about petope sample

Sep 15, 2009 at 7:27 AM
Hi, Hermanv
Sorry, the last letter has problem in displaying pictures~ renew it as the following:
I'm Lingming:-)I found an abnormal point about petope sample, can you help me figure it out? Thanks very much!
the relevant code in petope:
if (decompile)
mutator = new CodeMutator( host, ilToSourceProvider, sourceToILProvider, pdbReader);
else
mutator = new MetadataMutator(host);
...
Stream peStream = File.Create(module.Location + ".pe");
PeWriter.WritePeToStream(module, host, peStream,
pdbReader, pdbReader, pdbWriter);
its abnormal performance:
When using petope to visit the method "pop" depiected below, when I assign the decompile with "true" the petope will work normally.
public int pop()
{
if (this.Size == 0) return -1;
return this.Store[--this.Size];
}
figure 1
Yet, when I run the generated pe file, I get "FatalExecutionEgineError", and when use petotext.exe to process the generated pe file, the generated text is shown in figure2, while the correct text should be has a additional line "Microsoft.Cci.DummyType __temp_3" as shown in figure3. Thanks very much! I really appreciate your long time support and help!
public int pop()
{
{
if (!this.Size)
{
local_0 = -1;
}
else
{
local_1 = this.Store;
local_2 = this;
local_3 = (local_2.Size - 1);
local_2.Size = local_3;
local_0 = local_1[local_3];
}
return local_0;
}
}
figure 2
public int pop()
{
{
if ((this.Size == 0))
{
local_0 = -1;
}
else
{
__temp_4 = this.Store;
__temp_3 = this;
local_2 = (__temp_3.Size - 1);
__temp_3.Size = local_2;
local_0 = __temp_4[local_2];
}
{
Microsoft.Cci.DummyType __temp_3;
return local_0;
}
}
}
figure 3