建模DLL插件求思路
最近工作需要,想找个REVIT插件提高工作效率,但是因为不是经常使用,所以想找个免费版的,论坛帖子里bimlgq大哥的帖子看了一遍,奈何找不到同版本的插件,高版本的顺着思路去做,碰到瓶颈了,求大神帮助!我理解下面这段,就是检查用户信息,匹配就可以载入登录成功的窗口,但是不知道怎么改,试了几次都不行{:1_908:}
public bool CheckUserInfo()
{
bool flag = false;
string userName = this.TbUserNameBox.Text.Trim();
string passWord = this.tbPasswordBox.Password.Trim();
try
{
if (this.TbUserNameBox.Text.Trim() == string.Empty)
{
MessageBox.Show(Class2.smethod_11(13278));
this.TbUserNameBox.Focus();
}
else if (this.tbPasswordBox.Password.Trim() == string.Empty)
{
MessageBox.Show(Class2.smethod_11(13306));
this.tbPasswordBox.Focus();
}
else
{
int num = this.LoginEvent(userName, passWord);
if (num == 0)
{
flag = this.AfterLoginSuccessfully();
}
else if (num == -5)
{
MessageBoxResult messageBoxResult = MessageBox.Show(Class2.smethod_11(13322), Class2.smethod_11(13368), MessageBoxButton.YesNo, MessageBoxImage.Asterisk);
if (messageBoxResult == MessageBoxResult.Yes && HymakeHome.HymakeHome_ShowKickUser(new WindowInteropHelper(this).Handle))
{
flag = this.AfterLoginSuccessfully();
}
}
else
{
StringBuilder stringBuilder = new StringBuilder(256);
HymakeHome.HymakeHome_GetLastError(stringBuilder, 256);
if (stringBuilder.ToString() == string.Empty)
{
MessageBox.Show(Class2.smethod_11(13376));
}
else
{
MessageBox.Show(stringBuilder.ToString());
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(Class2.smethod_11(13416) + ex.Message);
}
if (flag)
{
MemberLoginForm.lastUserName = userName;
MemberLoginForm.lastPassWord = passWord;
}
return flag;
} this.LoginEvent() 方法 return 0; AfterLoginSuccessfully()方法里边不知道做了什么,进去看看,要返回 true; 3yu3 发表于 2023-3-22 16:39
this.LoginEvent() 方法 return 0; AfterLoginSuccessfully()方法里边不知道做了什么,进去看看,要返回 tr ...
大哥,能抽空帮忙看看吗?{:1_893:}两个DLL已脱壳,文件在网盘
链接:https://pan.baidu.com/s/1MMGbFITSGBna1nekcCwfSQ
提取码:dd4q flag = this.AfterLoginSuccessfully();方法中:
List<ProductInfo> usableProductList = LoginController.Instance.UsableProductList;
usableProductList.Clear();
foreach (ProductInfo productInfo in LoginConfig.Instance.AllProductInfo)
{
int num = HymakeHome.HymakeHome_QueryFeature(int.Parse(productInfo.MemberTypeCode));
productInfo.Res = num;
productInfo.LoginState = this.GetLoginStateByRemainingDays(num);
if (num > 0)
{
usableProductList.Add(productInfo);
}
}
if (this.NeedSaveUserInfo)
{
this.SaveUserInfo();
}
foreach历遍中主要内容是读取XML的序列化参数,包括一下几个内容:
public string AddinFileName { get; set; }
public string AssemblyFileName { get; set; }
public string DisplayName { get; set; }
public string FileName { get; set; }
public string FullClassName { get; set; }
public string Guid { get; set; }
public string InstallLocation { get; set; }
public string MemberTypeCode { get; set; }
public string ProductName { get; set; }
public string ProductCode { get; set; }
public ProductLoginState LoginState { get; set; }
public int Res { get; set; }
public string AppId { get; set; }
private int LoginEvent(string userName, string passWord)方法中:
private int LoginEvent(string userName, string passWord)
{
if (this.cbUseProxy.IsChecked == true)
{
HymakeHome.HymakeHome_EnableHttpProxy(this.tbAddress.Text.Trim(), this.tbUserName.Text.Trim(), this.tbPwd.Password.Trim(), int.Parse(this.tbPort.Text.Trim()));
}
string text = LoginConfig.Instance.MemberLogServerInfo.HymakeLoginIP;
if (string.IsNullOrEmpty(text))
{
text = LoginConfig.Instance.MemberLogServerInfo.HymakeHomeIP;
}
if (!string.IsNullOrEmpty(text))
{
string text2 = Class2.smethod_11(13186) + text + LoginConfig.Instance.MemberLogServerInfo.HomeName;
HymakeHome.HymakeHome_SetURL(text2);
}
return HymakeHome.HymakeHome_Login(userName, passWord, LoginController.Instance.CurProductInfo.Guid, LoginController.Instance.CurProductVersion);
}
HymakeHome.HymakeHome_EnableHttpProxy(this.tbAddress.Text.Trim(), this.tbUserName.Text.Trim(), this.tbPwd.Password.Trim(), int.Parse(this.tbPort.Text.Trim()));
HymakeHome.HymakeHome_SetURL(text2);
这两个参数跟进:
[DllImport("HymakeHome64.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi
public static extern void HymakeHome_EnableHttpProxy(string server, string user, string password, int port);
[DllImport("HymakeHome64.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi
public static extern int HymakeHome_Login(string userName, string password, string guid, string ver);
所以可知:
应用程序将用户名和密码参数传递给HymakeHome64.dll文件,由HymakeHome64.dll文件调用HTTP请求数据验证用户名和密码,并由这个文件下载用户名和密码对应的授权模块数据(XML序列化文件),然后保存文件,全部完成后返回C#程序对XML文件进行读取并获取授权数据.
所以你的重点应该放在HymakeHome64.dll这个文件里面,如果没猜错的话这个文件应该是C++编译的
gksj 发表于 2023-3-23 15:05
flag = this.AfterLoginSuccessfully();方法中:
List usableProductList = Logi ...
谢谢,我再试试 gksj 发表于 2023-3-23 15:05
flag = this.AfterLoginSuccessfully();方法中:
List usableProductList = Logi ...
请教老哥,证书: WinAuth(2.0),这个是什么混淆器啊?查不到都
页:
[1]