好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 bitghost 于 2022-12-30 14:47 编辑
各位大虾,我是新手。想请教下用dnspy反编译出来的程序,怎么修改可以跳过调用这个int num = this.CheckPeriod()?
我已经测试过直接修改代码,保存会报很多错误,应该只能用IL指令修改。对应的IL代码如截图。
// XYYY.Form1
// Token: 0x060000B3 RID: 179 RVA: 0x00024240 File Offset: 0x00022440
private void Form1_Load(object sender, EventArgs e)
{
int i = this.common.CheckRunning("XYYY");
if (i > 1)
{
MessageBox.Show("WCS软件已经打开, 不允许重复打开!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
base.Close();
return;
}
int num = this.CheckPeriod();
if (num <= 0)
{
string text;
if (num == -88888)
{
text = "输入权限效期加密字符有误!";
}
else
{
text = "您的软件已经过期请向供应商咨询!";
}
MessageBox.Show(text);
this.flag1 = 1;
this.ButtonDisable();
FormResetExpire formResetExpire = new FormResetExpire();
formResetExpire.ShowDialog();
base.Close();
return;
}
if (num < this.cntpdate)
{
string text = string.Format("您的软件仅剩余{0}天使用期限,请联系供应商!", num.ToString());
MessageBox.Show(text);
}
this.DataBack();
DataTable soc = this.GetSoc();
string sport = "51235";
this.SCANNER = soc.Rows.Count;
this.scan = new scancomm(soc, sport, this.SCANNER);
this.scan.DataArrivalevetHandler += this.scan_DataArrivalevetHandler;
if (this.DebugFlag)
{
this.scan.LogeventHander += this.scan_LogeventHander;
}
if (!this.scan.ConnectSoc())
{
MessageBox.Show("连接失败!");
Form1.iWin = -99;
base.Close();
return;
}
if (this.scan.BeginListen())
{
Form1.gScan = new string[this.SCANNER];
for (i = 0; i < this.SCANNER; i++)
{
Form1.gScan = "";
}
this.ConnOPCSync();
this.ConnOPCAsync();
this.ButtonInit();
this.ButtonInit2();
Form1.sCzlx = "";
this.rs1 = new RSControl(this.comnm1, this.baudnm1);
this.rs2 = new RSControl(this.comnm2, this.baudnm2);
this.rs1.byteBeginReadNum = 1;
this.rs2.byteBeginReadNum = 1;
if (this.DebugFlag)
{
this.rs1.Logon = 1;
this.rs2.Logon = 1;
this.rs1.LogeventHander += this.rs1_LogeventHander;
this.rs2.LogeventHander += this.rs2_LogeventHander;
}
this.rs1.ELeRSDataArrivaleventHandler += this.rs1_ELeRSDataArrivaleventHandler;
this.rs2.ELeRSDataArrivaleventHandler += this.rs2_ELeRSDataArrivaleventHandler;
this.rsconnectstatus1 = this.rs1.ConnectComm();
if (!this.rsconnectstatus1)
{
string text2 = string.Format("{0}串口未能连接打开", this.comnm1);
MessageBox.Show(text2);
this.common.WriteLog(text2, this.DB);
}
this.rsconnectstatus2 = this.rs2.ConnectComm();
if (!this.rsconnectstatus2)
{
string text2 = string.Format("{0}串口未能连接打开", this.comnm2);
MessageBox.Show(text2);
this.common.WriteLog(text2, this.DB);
}
this.isTimerInProcess = false;
this.timer1.Start();
return;
}
MessageBox.Show("由于中途有连接断开,已选择无法再继续!");
Form1.iWin = -99;
base.Close();
}
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|