本帖最后由 ajm3 于 2016-5-23 22:00 编辑
net教程少,楼主也不吝啬贡献一点点
blue发了几部,感觉都很浅,比如破解注册啥的就是改一个br.true 或者改一下 idc.i4.1啥的,不够新鲜。
今天发一个net程序退出验证的去除方法,只分析代码,不发程序了
[Asm] 纯文本查看 复制代码
public MainService()
{
this.errMsg = "★★ 警告:★★\n\n系统异常,马上退出!";
}
在reflector里面搜索字符找到如图这段代码。
经过分析寻找this.errMsg,因为是经过分析寻找this.errMsg=XXXX,点击errMSG,(那就不能直接用Analyzer搜索ctor),右键,点击Analyzer得到下图
重点看 Initialize(),这个英文大家有经验的都知道是主窗体,所以重点在这里,然后分析一下代码看看哪里调用了这句删除即可
分析代码如下
[Asm] 纯文本查看 复制代码 public override void Initialize()
{
base.Initialize();
RootMenuNode parNode = new RootMenuNode();
string webConfigKeyValue = AppUtils.GetWebConfigKeyValue("IMSwitch");
base.Context["IMSwitch"] = webConfigKeyValue;
base.Context["PollingTime"] = int.Parse(ConfigurationManager.AppSettings["PollineTime"].ToString());
base.Context["isTop"] = !string.IsNullOrEmpty("910");
using (DbHelper helper = AppUtils.CreateDbHelper())
{
int num2;
this.setVersionInfo();
int magicDogFlag = this.doMagicDogFlag();
string message = string.Empty;
base.Context["registerMessage"] = string.Empty;
base.Context["registered"] = string.Empty;
base.Context["OutputMessageAndClose"] = string.Empty;
MenuHelper.CheckRemindDays(base.Context, ref message, out num2);
base.Context["registerMessage"] = message;
base.Context["registered"] = num2;
base.Context["tryMessage"] = message;
if ((string.IsNullOrEmpty(message) && SysData1.isSstages) && MenuHelper.CheckOnLineDogsOverDays(ref message))
{
base.Context["tryMessage"] = message;
}
base.Context["attendance"] = UserInfo.IsAdmin ? ((object) 0) : ((object) Limit.LIMIT_TIMEWORK_ADDDATA);
if (MenuHelper.chkSysData() == 0)
{
AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
int dogUserCount = 0;
int loginUserCount = 0;
int errorCode = 0;
if (MenuHelper.CheckCurLoginUserCountForASP(helper, CurrUser.GetCode(), ref loginUserCount, ref dogUserCount, ref errorCode) != 0)
{
AppUtils.OutputMessageAndClose(base.Context, string.Format("█ █ █ █ 系统严重警告:█ █ █ █\n\n ★", (dogUserCount == 0) ? "单机" : ("(" + dogUserCount + ")用户"), loginUserCount));
}
else if (magicDogFlag < 0)
{
AppUtils.OutputMessageAndClose(base.Context, this.getErrorMagicMessage(magicDogFlag).ToString());
}
if (MenuHelper.checkSysdataData() == 1)
{
AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
if (MenuHelper.checkSysdata1Data() == 1)
{
AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
出现3句
[Asm] 纯文本查看 复制代码 AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
一样的代码,意思就是OutputMessageAndClose,输出message并且close。明白了吧
然后修改如下效果即可
[Asm] 纯文本查看 复制代码 public override void Initialize()
{
base.Initialize();
RootMenuNode parNode = new RootMenuNode();
string webConfigKeyValue = AppUtils.GetWebConfigKeyValue("IMSwitch");
base.Context["IMSwitch"] = webConfigKeyValue;
base.Context["PollingTime"] = int.Parse(ConfigurationManager.AppSettings["PollineTime"].ToString());
base.Context["isTop"] = !string.IsNullOrEmpty("910");
using (DbHelper helper = AppUtils.CreateDbHelper())
{
int num2;
this.setVersionInfo();
int magicDogFlag = this.doMagicDogFlag();
string message = string.Empty;
base.Context["registerMessage"] = string.Empty;
base.Context["registered"] = string.Empty;
base.Context["OutputMessageAndClose"] = string.Empty;
MenuHelper.CheckRemindDays(base.Context, ref message, out num2);
base.Context["registerMessage"] = message;
base.Context["registered"] = num2;
base.Context["tryMessage"] = message;
if ((string.IsNullOrEmpty(message) && SysData1.isSstages) && MenuHelper.CheckOnLineDogsOverDays(ref message))
{
base.Context["tryMessage"] = message;
}
base.Context["attendance"] = UserInfo.IsAdmin ? ((object) 0) : ((object) Limit.LIMIT_TIMEWORK_ADDDATA);
if (MenuHelper.chkSysData() == 0)
{
//AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
int dogUserCount = 0;
int loginUserCount = 0;
int errorCode = 0;
if (MenuHelper.CheckCurLoginUserCountForASP(helper, CurrUser.GetCode(), ref loginUserCount, ref dogUserCount, ref errorCode) != 0)
{
AppUtils.OutputMessageAndClose(base.Context, string.Format("█ █ █ █ 系统严重警告:█ █ █ █\n\n ★", (dogUserCount == 0) ? "单机" : ("(" + dogUserCount + ")用户"), loginUserCount));
}
else if (magicDogFlag < 0)
{
AppUtils.OutputMessageAndClose(base.Context, this.getErrorMagicMessage(magicDogFlag).ToString());
}
if (MenuHelper.checkSysdataData() == 1)
{
//AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
if (MenuHelper.checkSysdata1Data() == 1)
{
//AppUtils.OutputMessageAndClose(base.Context, this.errMsg);
}
//的意思就是删除这一行。这样这个提示和退出就没有了
这样就ok了。不知道大家看明白没有
教程简单,net本来就简单,复杂不起来,没办法,可能难就难在加壳和脱壳,目前很少软件能加壳net的,大家有没有什么好的加密解密方法可以分享出来
//楼下有朋友点评说退出没有任何提示要怎么弄,其实和有提示差不多,思路也是一样,找到窗口主体代码,AppUtils.OutputMessageAndClose(base.Context, this.errMsg);不同的就是少了msg。退出就是close,或者vb.net的end unload me之类的代码,找到他的引用,删除就可以了
|