Browse Source

callvirt

pull/1/head^2
David Srbecký 18 years ago
parent
commit
86ca89b055
  1. 82
      bin/Debug/output.cs
  2. 3
      src/AstMetodBodyBuilder.cs

82
bin/Debug/output.cs

@ -13,7 +13,7 @@ namespace Reversi
{ {
if (!(!disposing)) { if (!(!disposing)) {
if (!(!(@this.components))) { if (!(!(@this.components))) {
IL__callvirt(Dispose(), (@this.components)); (@this.components).Dispose();
goto BasicBlock_4; goto BasicBlock_4;
} }
else { else {
@ -32,56 +32,56 @@ namespace Reversi
IL__stfld(okButton, @this, (IL__newobj(.ctor()))); IL__stfld(okButton, @this, (IL__newobj(.ctor())));
IL__stfld(copyrightLabel, @this, (IL__newobj(.ctor()))); IL__stfld(copyrightLabel, @this, (IL__newobj(.ctor())));
@this.SuspendLayout(); @this.SuspendLayout();
IL__callvirt(set_Location(), (@this.iconPictureBox), (IL__newobj(.ctor(), 77, 56))); (@this.iconPictureBox).set_Location((IL__newobj(.ctor(), 77, 56)));
IL__callvirt(set_Name(), (@this.iconPictureBox), "iconPictureBox"); (@this.iconPictureBox).set_Name("iconPictureBox");
IL__callvirt(set_Size(), (@this.iconPictureBox), (IL__newobj(.ctor(), 96, 96))); (@this.iconPictureBox).set_Size((IL__newobj(.ctor(), 96, 96)));
IL__callvirt(set_TabIndex(), (@this.iconPictureBox), 0); (@this.iconPictureBox).set_TabIndex(0);
IL__callvirt(set_TabStop(), (@this.iconPictureBox), 0); (@this.iconPictureBox).set_TabStop(0);
IL__callvirt(set_AutoSize(), (@this.titleLabel), 1); (@this.titleLabel).set_AutoSize(1);
IL__callvirt(set_Font(), (@this.titleLabel), (IL__newobj(.ctor(), "Microsoft Sans Serif", 8.25f, 1, 3, 0))); (@this.titleLabel).set_Font((IL__newobj(.ctor(), "Microsoft Sans Serif", 8.25f, 1, 3, 0)));
IL__callvirt(set_Location(), (@this.titleLabel), (IL__newobj(.ctor(), 103, 16))); (@this.titleLabel).set_Location((IL__newobj(.ctor(), 103, 16)));
IL__callvirt(set_Name(), (@this.titleLabel), "titleLabel"); (@this.titleLabel).set_Name("titleLabel");
IL__callvirt(set_Size(), (@this.titleLabel), (IL__newobj(.ctor(), 44, 16))); (@this.titleLabel).set_Size((IL__newobj(.ctor(), 44, 16)));
IL__callvirt(set_TabIndex(), (@this.titleLabel), 0); (@this.titleLabel).set_TabIndex(0);
IL__callvirt(set_Text(), (@this.titleLabel), "Reversi"); (@this.titleLabel).set_Text("Reversi");
IL__callvirt(set_TextAlign(), (@this.titleLabel), 32); (@this.titleLabel).set_TextAlign(32);
IL__callvirt(set_AutoSize(), (@this.versionLabel), 1); (@this.versionLabel).set_AutoSize(1);
IL__callvirt(set_Location(), (@this.versionLabel), (IL__newobj(.ctor(), 95, 32))); (@this.versionLabel).set_Location((IL__newobj(.ctor(), 95, 32)));
IL__callvirt(set_Name(), (@this.versionLabel), "versionLabel"); (@this.versionLabel).set_Name("versionLabel");
IL__callvirt(set_Size(), (@this.versionLabel), (IL__newobj(.ctor(), 61, 16))); (@this.versionLabel).set_Size((IL__newobj(.ctor(), 61, 16)));
IL__callvirt(set_TabIndex(), (@this.versionLabel), 1); (@this.versionLabel).set_TabIndex(1);
IL__callvirt(set_Text(), (@this.versionLabel), "Version 2.0"); (@this.versionLabel).set_Text("Version 2.0");
IL__callvirt(set_TextAlign(), (@this.versionLabel), 32); (@this.versionLabel).set_TextAlign(32);
IL__callvirt(set_DialogResult(), (@this.okButton), 1); (@this.okButton).set_DialogResult(1);
IL__callvirt(set_Location(), (@this.okButton), (IL__newobj(.ctor(), 88, 192))); (@this.okButton).set_Location((IL__newobj(.ctor(), 88, 192)));
IL__callvirt(set_Name(), (@this.okButton), "okButton"); (@this.okButton).set_Name("okButton");
IL__callvirt(set_TabIndex(), (@this.okButton), 3); (@this.okButton).set_TabIndex(3);
IL__callvirt(set_Text(), (@this.okButton), "OK"); (@this.okButton).set_Text("OK");
IL__callvirt(set_AutoSize(), (@this.copyrightLabel), 1); (@this.copyrightLabel).set_AutoSize(1);
IL__callvirt(set_Location(), (@this.copyrightLabel), (IL__newobj(.ctor(), 36, 160))); (@this.copyrightLabel).set_Location((IL__newobj(.ctor(), 36, 160)));
IL__callvirt(set_Name(), (@this.copyrightLabel), "copyrightLabel"); (@this.copyrightLabel).set_Name("copyrightLabel");
IL__callvirt(set_Size(), (@this.copyrightLabel), (IL__newobj(.ctor(), 178, 16))); (@this.copyrightLabel).set_Size((IL__newobj(.ctor(), 178, 16)));
IL__callvirt(set_TabIndex(), (@this.copyrightLabel), 2); (@this.copyrightLabel).set_TabIndex(2);
IL__callvirt(set_Text(), (@this.copyrightLabel), "Copyright 2003-2005 by Mike Hall."); (@this.copyrightLabel).set_Text("Copyright 2003-2005 by Mike Hall.");
IL__callvirt(set_TextAlign(), (@this.copyrightLabel), 32); (@this.copyrightLabel).set_TextAlign(32);
@this.set_AcceptButton((@this.okButton)); @this.set_AcceptButton((@this.okButton));
IL__callvirt(set_AutoScaleBaseSize(), @this, (IL__newobj(.ctor(), 5, 13))); @this.set_AutoScaleBaseSize((IL__newobj(.ctor(), 5, 13)));
@this.set_CancelButton((@this.okButton)); @this.set_CancelButton((@this.okButton));
@this.set_ClientSize((IL__newobj(.ctor(), 250, 224))); @this.set_ClientSize((IL__newobj(.ctor(), 250, 224)));
@this.set_ControlBox(0); @this.set_ControlBox(0);
IL__callvirt(Add(), @this.get_Controls(), (@this.copyrightLabel)); @this.get_Controls().Add((@this.copyrightLabel));
IL__callvirt(Add(), @this.get_Controls(), (@this.versionLabel)); @this.get_Controls().Add((@this.versionLabel));
IL__callvirt(Add(), @this.get_Controls(), (@this.titleLabel)); @this.get_Controls().Add((@this.titleLabel));
IL__callvirt(Add(), @this.get_Controls(), (@this.okButton)); @this.get_Controls().Add((@this.okButton));
IL__callvirt(Add(), @this.get_Controls(), (@this.iconPictureBox)); @this.get_Controls().Add((@this.iconPictureBox));
@this.set_FormBorderStyle(3); @this.set_FormBorderStyle(3);
@this.set_Icon((IL__castclass(System.Drawing.Icon, (IL__callvirt(GetObject(), V_0, "$this.Icon"))))); @this.set_Icon((IL__castclass(System.Drawing.Icon, (V_0.GetObject("$this.Icon")))));
@this.set_MaximizeBox(0); @this.set_MaximizeBox(0);
@this.set_MinimizeBox(0); @this.set_MinimizeBox(0);
@this.set_Name("AboutDialog"); @this.set_Name("AboutDialog");
@this.set_ShowInTaskbar(0); @this.set_ShowInTaskbar(0);
@this.set_StartPosition(4); @this.set_StartPosition(4);
IL__callvirt(set_Text(), @this, "About Reversi"); @this.set_Text("About Reversi");
@this.ResumeLayout(0); @this.ResumeLayout(0);
} }
} }

3
src/AstMetodBodyBuilder.cs

@ -379,6 +379,8 @@ namespace Decompiler
case Code.Box: throw new NotImplementedException(); case Code.Box: throw new NotImplementedException();
case Code.Break: throw new NotImplementedException(); case Code.Break: throw new NotImplementedException();
case Code.Call: case Code.Call:
case Code.Callvirt:
// TODO: Diferentiate vitual and non-vitual dispach
Cecil.MethodReference cecilMethod = ((MethodReference)operand); Cecil.MethodReference cecilMethod = ((MethodReference)operand);
Ast.IdentifierExpression astType = new Ast.IdentifierExpression(cecilMethod.DeclaringType.FullName); Ast.IdentifierExpression astType = new Ast.IdentifierExpression(cecilMethod.DeclaringType.FullName);
List<Ast.Expression> methodArgs = new List<Ast.Expression>(args); List<Ast.Expression> methodArgs = new List<Ast.Expression>(args);
@ -389,7 +391,6 @@ namespace Decompiler
return new Ast.InvocationExpression(new Ast.MemberReferenceExpression(astType, cecilMethod.Name), methodArgs); return new Ast.InvocationExpression(new Ast.MemberReferenceExpression(astType, cecilMethod.Name), methodArgs);
} }
case Code.Calli: throw new NotImplementedException(); case Code.Calli: throw new NotImplementedException();
case Code.Callvirt: throw new NotImplementedException();
case Code.Castclass: throw new NotImplementedException(); case Code.Castclass: throw new NotImplementedException();
case Code.Ckfinite: throw new NotImplementedException(); case Code.Ckfinite: throw new NotImplementedException();
case Code.Constrained: throw new NotImplementedException(); case Code.Constrained: throw new NotImplementedException();

Loading…
Cancel
Save