Thread: SMD For Agile
View Single Post
  #10  
Old 05-28-2019, 10:56
congviet congviet is offline
Family
 
Join Date: Jun 2010
Location: Vi
Posts: 148
Rept. Given: 30
Rept. Rcvd 76 Times in 42 Posts
Thanks Given: 49
Thanks Rcvd at 51 Times in 29 Posts
congviet Reputation: 76
Exclamation

Quote:
Originally Posted by CodeCracker View Post
The unpacked file (msil decryted):
https://www80.zippyshare.com/v/Zp0cgvVz/file.html
As for what I did: I created my own dlls RevitAPI.exe and RevitAPIUI.exe
with only their constructions (classes/methods) for being able to unpack MSIL;
let me know if the unpacked exe is ok; you got to also nop Agile constructors!
1.Can you share two dlls with only classes & methods?
2. This source code:
Code:
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Autodesk.Revit.ApplicationServices;

using Autodesk.Revit.Attributes;

using Autodesk.Revit.DB;

using Autodesk.Revit.UI;

using Autodesk.Revit.UI.Selection;

namespace DecryptMe
{
    [Transaction(TransactionMode.Manual)]

    [Regeneration(RegenerationOption.Manual)]

    public class Class1 : IExternalCommand

    {

        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

        {

            //Get application and documnet objects

            UIApplication uiapp = commandData.Application;

            Document doc = uiapp.ActiveUIDocument.Document;

            //Define a reference Object to accept the pick result

            Reference pickedref = null;

            //Pick a group

            Selection sel = uiapp.ActiveUIDocument.Selection;

            pickedref = sel.PickObject(ObjectType.Element, "Please select a group");

            Element elem = doc.GetElement(pickedref);

            Group group = elem as Group;

            //Pick point

            XYZ point = sel.PickPoint("Please pick a point to place group");

            //Place the group

            Transaction trans = new Transaction(doc);

            trans.Start("Lab");

            doc.Create.PlaceGroup(point, group.GroupType);

            trans.Commit();

            return Result.Succeeded;

        }

    }
}
This Decrypted code:

Code:
using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;

namespace ns0
{
	[Regeneration(0)]
	[Transaction(1)]
	public class GClass0 : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			Transaction transaction;
			for (;;)
			{
				int num = 睷.睷_0(-3);
				for (;;)
				{
					switch (num)
					{
					case 0:
					{
						UIApplication uiapplication;
						Selection selection = uiapplication.ActiveUIDocument.Selection;
						Reference reference_ = 睸.睸_0(selection, 1, "Please select a group");
						Document document;
						Element element = 睹.睹_0(document, reference_);
						Group object_ = element as Group;
						num = 睷.睷_0(-2);
						continue;
					}
					case 1:
						goto IL_10D;
					case 2:
					{
						Selection selection;
						XYZ xyz_ = selection.PickPoint("Please pick a point to place group");
						Document document;
						transaction = new Transaction(document);
						睺.睺_0(transaction, "Lab");
						Group object_;
						睽.睽_0(睻.睻_0(document), xyz_, 睼.睼_0(object_));
						num = 睷.睷_0(-1);
						continue;
					}
					case 3:
					{
						UIApplication uiapplication = 睾.睾_0(commandData);
						Document document = 瞀.瞀_0(睿.睿_0(uiapplication));
						num = 睷.睷_0(0);
						continue;
					}
					}
					break;
				}
			}
			IL_10D:
			transaction.Commit();
			return 0;
		}

		// Note: this type is marked as 'beforefieldinit'.
		static GClass0()
		{
			<AgileDotNetRT>.Initialize();
			<AgileDotNetRT>.PostInitialize();
		}
	}
}
How can i restore above the delegate methods to original methods? (chinese string)
Thank you very much.
Reply With Quote
The Following User Says Thank You to congviet For This Useful Post:
Indigo (07-19-2019)