public void Setup()
 {
     proc = new Procedure_v1();
     var arch = new X86ArchitectureFlat32();
     var platform = new Win32Platform(null, arch);
     var program = new Program
     {
         Architecture = arch,
         Platform = platform
     };
     interactor = new ProcedureDialogInteractor(program, proc);
 }
示例#2
0
        public override void DoIt()
        {
            var dlgFactory = Services.RequireService<IDialogFactory>();
            var uiSvc = Services.RequireService<IDecompilerShellUiService>();
            var ser = program.CreateProcedureSerializer();
            var sProc = ser.Serialize(procedure, address);
            //$REVIEW: use dialog factory.
            var i = new ProcedureDialogInteractor(program.Platform.Architecture, sProc);
            using (ProcedureDialog dlg = i.CreateDialog())
            {
                if (DialogResult.OK == uiSvc.ShowModalDialog(dlg))
                {
                    program.User.Procedures[address] =
                        i.SerializedProcedure;
                    ser = program.CreateProcedureSerializer();
                    procedure.Signature =
                        ser.Deserialize(i.SerializedProcedure.Signature, procedure.Frame);

                    // canAdvance = false;
                }
            }
        }
        private void EditSignature()
        { 
            //$TODO: need "current program"
            IProcessorArchitecture arch = null; // Decompiler.Program.Architecture;
            var ser = arch.CreateProcedureSerializer(new TypeLibraryLoader(arch, true), "stdapi");
            var proc = ser.Serialize(SelectedProcedureEntry.Value, SelectedProcedureEntry.Key);
            var i = new ProcedureDialogInteractor(arch, proc);
            using (ProcedureDialog dlg = i.CreateDialog())
            {
                if (DialogResult.OK == UIService.ShowModalDialog(dlg))
                {
                    //$REVIEW: Need to pass InputFile into the SelectedProcedureEntry piece.
                    var program =  Decompiler.Project.Programs[0]; 
                    program.UserProcedures[SelectedProcedureEntry.Key] =
                        i.SerializedProcedure;
                    ser = arch.CreateProcedureSerializer(new TypeLibraryLoader(arch, true), "stdapi");
                    SelectedProcedureEntry.Value.Signature =
                        ser.Deserialize(i.SerializedProcedure.Signature, SelectedProcedureEntry.Value.Frame);

                    canAdvance = false;
                }
            }
        }
示例#4
0
        private void EditSignature()
        {
            //$TODO: need "current program"
            IProcessorArchitecture arch = null; // Decompiler.Program.Architecture;
            var ser  = arch.CreateProcedureSerializer(new TypeLibraryLoader(arch, true), "stdapi");
            var proc = ser.Serialize(SelectedProcedureEntry.Value, SelectedProcedureEntry.Key);
            var i    = new ProcedureDialogInteractor(arch, proc);

            using (ProcedureDialog dlg = i.CreateDialog())
            {
                if (DialogResult.OK == UIService.ShowModalDialog(dlg))
                {
                    //$REVIEW: Need to pass InputFile into the SelectedProcedureEntry piece.
                    var program = Decompiler.Project.Programs[0];
                    program.UserProcedures[SelectedProcedureEntry.Key] =
                        i.SerializedProcedure;
                    ser = arch.CreateProcedureSerializer(new TypeLibraryLoader(arch, true), "stdapi");
                    SelectedProcedureEntry.Value.Signature =
                        ser.Deserialize(i.SerializedProcedure.Signature, SelectedProcedureEntry.Value.Frame);

                    canAdvance = false;
                }
            }
        }
示例#5
0
 public ProcedureDialog(ProcedureDialogInteractor i)
 {
     InitializeComponent();
     this.interactor = i;
 }
示例#6
0
 public IProcedureDialog CreateProcedureDialog(Program program, Core.Serialization.Procedure_v1 sProc)
 {
     var i = new ProcedureDialogInteractor(program, sProc);
     return i.CreateDialog();
 }
示例#7
0
 public ProcedureDialog(ProcedureDialogInteractor i)
 {
     InitializeComponent();
     this.interactor = i;
 }