求助,dnspy破解软件问题
本帖最后由 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;
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();
}
直接右键,编辑方法,修改INT NUM=一个值,或者直接去掉,如果保存时提示错误较多,那就需要用那个IL指令的方式去修改 直接去修改CheckPeriod返回一个值就行了 gunxsword 发表于 2022-12-30 12:04
直接右键,编辑方法,修改INT NUM=一个值,或者直接去掉,如果保存时提示错误较多,那就需要用那个IL指令的方式 ...
我试了 直接修改代码不行,保存会报很多错误。
IL指令怎么修改还想请教下。 点进去CheckPeriod()方法,IL指令编辑
ldc.i4 8888
ret 私信,发来看看 3yu3 发表于 2022-12-30 20:52
点进去CheckPeriod()方法,IL指令编辑
ldc.i4 8888
好像可以用,我再测试下,多谢
页:
[1]