SQLDBCompare_Rel2.0破解手记
?引子:montaque POST了數(shù)據(jù)庫腳本版本控制 和 數(shù)據(jù)庫比較工具,推薦了工具SQLDBCompare,于是有了此文.
正文:一路NEXT下來順利安裝完畢,立刻啟動(dòng)程序來嘗嘗鮮,咚
?
未授權(quán),還剩14天,太TNND吝嗇了吧,WINXP激活期也給30天呢!算了,不與計(jì)較,先點(diǎn)“NO”進(jìn)去再說,
?
作為SQL SERVER數(shù)據(jù)庫比較功能比較單一(當(dāng)然你也可以說專業(yè),呵呵),隨便選擇兩個(gè)數(shù)據(jù)庫比較了一下,呵,還行(不行的話我還懶得破你呢),點(diǎn)擊View>>License,出現(xiàn)出現(xiàn)輸入License key的對(duì)話框,隨便輸入幾個(gè)字符,昏,當(dāng)然是Invalid License String,
?
不過各位看官注意了,記好這提示文字“The License string you entered is invalid”,這個(gè)可是破門的好引子呀。好了,試用軟件到此為止。言歸正傳,開工,把SQLDBCompare.exe先給拎出來瞧瞧!
左手拿出照妖鏡ILDASM,一瞄,呵呵,原來SQLDBCompare.exe赤裸裸的,嗚呼,多無辜的XX,怎么就不整塊遮羞布呢(SQLDBCompare.exe在寒風(fēng)中瑟瑟發(fā)抖,滿俯委屈:“呸,有遮羞布你還能占得便宜末?”),右手嚓地一聲拔出利劍Reflector,只見寒光一閃,SQLDBCompare已經(jīng)皮開肉綻,血肉模糊,不過,依稀可見如下敏感部位:
? private void menuItemLicense_Click(object sender, EventArgs e)
??????? {
??????????? if (CompareDatabaseOptionDlg.m_nVersionStatus == 0)
??????????? {
??????????????? MessageBox.Show(this, "The SQLDBCompare on this computer is already licensed!", "Good News", MessageBoxButtons.OK);
??????????? }
??????????? else
??????????? {
??????????????? AddLicenseDlg dlg1 = new AddLicenseDlg();
??????????????? if (dlg1.ShowDialog() != DialogResult.OK)
??????????????? {
??????????????????? return;
???? ???????????}
???????????????......???????????????
??????????????? }
??????????????? else
??????????????? {
??????????????????? MessageBox.Show(this, "The License string you entered is invalid!", "Invalid License String", MessageBoxButtons.OK);
??????????????? }
??????????? }
??????? }
?
各位看官一定很迷惑,怎么一眼就發(fā)現(xiàn)如上敏感部位的呢,呵呵,我說各位兄弟姐妹、叔叔伯伯、大媽大嬸……,你們難道忘了我曾經(jīng)提醒大家記好這些”The License string you entered is invalid”,呵呵,我們繼續(xù),仔細(xì)打量打量上面的“部位“,大家不難發(fā)現(xiàn)這個(gè)重點(diǎn)中的重點(diǎn)”LicenseKey.IsValidLicensedKey ()”,乘勝追擊,原來LicenseKey是住在BestCommonObj.dll地區(qū)(俗稱程序集)的一個(gè)沒落家族(俗稱類),而IsValidLicensedKey則是LicenseKey家族的N多活動(dòng)(俗稱方法)中的一項(xiàng),好了,我們不妨到BestCommonObj.dll瞧瞧LicenseKey.IsValidLicensedKey()的內(nèi)幕,好家伙,簡(jiǎn)直是不看知道,一看嚇一跳,
public static int IsValidLicensedKey(int nProductCode, string strWholeKey, ref string strModifiedKey, ref string strReason)
{
????? strModifiedKey = strWholeKey;
????? if (strWholeKey == null)
????? {
??????????? strReason = "Invalid key type";
??????????? return 4;
????? }?
?????.....?????
????? if (text3[0x21] == '1')
????? {
??????????? strReason = "Unlimit License";
??????????? return 0;
????? }?
? ......????
?? strReason = "Invalid key type";
????? return 4;
}
看到紅字部分,這是多末令人激動(dòng)的東東呀,如果我能把它放到
if (strWholeKey == null)
????? {
??????????? strReason = "Invalid key type";
??????????? return 4;
????? }
之前該多好了,一切不就Pass了嗎?呵呵,心動(dòng)不如行動(dòng),還得請(qǐng)ILDASM寶貝讓BestCommonObj.dll現(xiàn)真身BestCommonObj.il,用Editplus打開BestCommonObj.il,到3615行附近,瞧這
?? ???IL_00d2:? ldarg.3
????? IL_00d3:? ldstr????? "Unlimit License"
????? IL_00d8:? stind.ref
????? IL_00d9:? ldc.i4.0
????? IL_00da:? ret
?
不就是
if (text3[0x21] == '1')
????? {
??????????? strReason = "Unlimit License";
??????????? return 0;
????? }?
??
對(duì)應(yīng)的MSIL嗎?立即動(dòng)手,將行3502至3508代碼修改為
????? IL_0004:? brtrue.s?? IL_0006
?
????? IL_0006:? ldarg.3
????? IL_0007:? ldstr????? "Unlimit License"
????? IL_000c:? stind.ref
????? IL_000d:? ldc.i4.0
????? IL_000e:? ret
注意:行3502至3508原來的代碼為
????? IL_0004:? brtrue.s?? IL_000f
?
?? ???IL_0006:? ldarg.3
????? IL_0007:? ldstr????? "Invalid key type"
????? IL_000c:? stind.ref
????? IL_000d:? ldc.i4.4
????? IL_000e:? ret
?
保存BestCommonObj.il,再讓ILASM大師把BestCommonObj.il帶回到從前的BestCommonObj.dll,如果沒錯(cuò)的話,這下再運(yùn)行SQLDBCompare.exe,呵呵,已經(jīng)不是上次提示的14天到期了,而是禮貌地提示請(qǐng)你提交用戶信息的提示了,以圖為證
?
甭理它,直接 “do it later”進(jìn)入,呵呵,標(biāo)題欄上已經(jīng)沒有“Trial(14 Days Left)”的字樣了,再點(diǎn)View>>License,乖乖,多惹人喜歡的提示呀!
?
OK,That's all.
總結(jié)
以上是生活随笔為你收集整理的SQLDBCompare_Rel2.0破解手记的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (转)提问的智慧
- 下一篇: 敏捷开发:软件与文档