an abnormal performance about petope

Sep 15, 2009 at 7:18 AM
Hi, Hermanv
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];
}
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 the left, while the correct text should be has a additional line "Microsoft.Cci.DummyType __temp_3" as shown in the right. Thanks very much! I really appreciate your long time support and help!
{
Coordinator
Sep 15, 2009 at 7:28 AM

Your images did not make it into the post. Please create an issue in the issue tracker pane and provide me with enough details to reproduce the problem.

Thanks

Herman

Sep 15, 2009 at 2:53 PM
Hi, Hermanv
I have created an issue in the issue tracker pane:-) (sorry for making a duplicate issue, but I do not know how to delete the duplicated one...)
Can you tell me the influence and meaning of decompile(shown below) in the petope sample?
When I assign decompile with "true" manually, the "WrtitePeToStream" method works without failure, it may cause some code faults in the generated code.
Am I making a mistake to assign decompile with "true" manually?
*decompile used 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);
Sep 19, 2009 at 5:15 AM
Hi, hermanv
I did reply to you in the issue tracker "an abnormal performance of the petope sample" and I also mailed you the small binary file that lead the abnormal performance of "PetoPe". Yet, I cannot find my rely in the issue tracker, I'm afraid you do not get my reply, do you?
Here is my last letter:
"Hm, here is the pe file-subjects.dll in the attachment and I have simplified it:-) When assign decompile with false petope generates correct code for subjects.dll. On the contrary when assign decompile with true it generate code with error.
Btw, the source code of subjects.dll is:
namespace Subjects
{
public class IntStack
{
public int[] Store;
private int Size;
public static int INITIAL_CAPACITY = 10;

public IntStack()
{
this.Store = new int[INITIAL_CAPACITY];
this.Size = 0;
}
public int pop()
{
if (this.Size == 0) return -1;
return this.Store[--this.Size];
}

}
}

Hope I made it clear:-)"
How can I send you the binary code? It seems that the issue tracker site has something wrong when upload attachments~
Best Regards,
Lingming Zhang
Program Analysis and Testing Group,
Peking University
Coordinator
Sep 19, 2009 at 7:13 AM

Hi Lingming

I did see replies from you. I am on vacation for the next week, and I also have some other things to attend to, but I’ll try to follow up soon after I get back to the office.

Thanks

Herman

From: zhanglm [mailto:notifications@codeplex.com]
Sent: Friday, September 18, 2009 9:15 PM
To: Herman Venter
Subject: Re: an abnormal performance about petope [cciast:68945]

From: zhanglm

Hi, hermanv

I did reply to you in the issue tracker "an abnormal performance of the petope sample" and I also mailed you the small binary file that lead the abnormal performance of "PetoPe". Yet, I cannot find my rely in the issue tracker, I'm afraid you do not get my reply, do you?

Here is my last letter:

"Hm, here is the pe file-subjects.dll in the attachment and I have simplified it:-) When assign decompile with false petope generates correct code for subjects.dll. On the contrary when assign decompile with true it generate code with error.

Btw, the source code of subjects.dll is:
namespace Subjects
{
public class IntStack
{

public int[] Store;
private int Size;
public static int INITIAL_CAPACITY = 10;


public IntStack()
{

this.Store = new int[INITIAL_CAPACITY];
this.Size = 0;
}

public int pop()
{
if (this.Size == 0) return -1;
return this.Store[--this.Size];
}

}
}


Hope I made it clear:-)"

How can I send you the binary code? It seems that the issue tracker site has something wrong when upload attachments~

Best Regards,

Lingming Zhang

Program Analysis and Testing Group,

Peking University

Read the full discussion online.

To add a post to this discussion, reply to this email (cciast@discussions.codeplex.com)

To start a new discussion for this project, email cciast@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Sep 19, 2009 at 8:47 AM
Hi, hermanv
I just wanted to make sure that you got my reply~
Wow, it really enjoyable to have a nice vocation:-)
Enjoy it~