SQLDBCompare_Rel2.0破解手记
?引子:montaque POST了數據庫腳本版本控制 和 數據庫比較工具,推薦了工具SQLDBCompare,于是有了此文.
正文:一路NEXT下來順利安裝完畢,立刻啟動程序來嘗嘗鮮,咚
?
未授權,還剩14天,太TNND吝嗇了吧,WINXP激活期也給30天呢!算了,不與計較,先點“NO”進去再說,
?
作為SQL SERVER數據庫比較功能比較單一(當然你也可以說專業,呵呵),隨便選擇兩個數據庫比較了一下,呵,還行(不行的話我還懶得破你呢),點擊View>>License,出現出現輸入License key的對話框,隨便輸入幾個字符,昏,當然是Invalid License String,
?
不過各位看官注意了,記好這提示文字“The License string you entered is invalid”,這個可是破門的好引子呀。好了,試用軟件到此為止。言歸正傳,開工,把SQLDBCompare.exe先給拎出來瞧瞧!
左手拿出照妖鏡ILDASM,一瞄,呵呵,原來SQLDBCompare.exe赤裸裸的,嗚呼,多無辜的XX,怎么就不整塊遮羞布呢(SQLDBCompare.exe在寒風中瑟瑟發抖,滿俯委屈:“呸,有遮羞布你還能占得便宜末?”),右手嚓地一聲拔出利劍Reflector,只見寒光一閃,SQLDBCompare已經皮開肉綻,血肉模糊,不過,依稀可見如下敏感部位:
? 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);
??????????????? }
??????????? }
??????? }
?
各位看官一定很迷惑,怎么一眼就發現如上敏感部位的呢,呵呵,我說各位兄弟姐妹、叔叔伯伯、大媽大嬸……,你們難道忘了我曾經提醒大家記好這些”The License string you entered is invalid”,呵呵,我們繼續,仔細打量打量上面的“部位“,大家不難發現這個重點中的重點”LicenseKey.IsValidLicensedKey ()”,乘勝追擊,原來LicenseKey是住在BestCommonObj.dll地區(俗稱程序集)的一個沒落家族(俗稱類),而IsValidLicensedKey則是LicenseKey家族的N多活動(俗稱方法)中的一項,好了,我們不妨到BestCommonObj.dll瞧瞧LicenseKey.IsValidLicensedKey()的內幕,好家伙,簡直是不看知道,一看嚇一跳,
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;
}
看到紅字部分,這是多末令人激動的東東呀,如果我能把它放到
if (strWholeKey == null)
????? {
??????????? strReason = "Invalid key type";
??????????? return 4;
????? }
之前該多好了,一切不就Pass了嗎?呵呵,心動不如行動,還得請ILDASM寶貝讓BestCommonObj.dll現真身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;
????? }?
??
對應的MSIL嗎?立即動手,將行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,如果沒錯的話,這下再運行SQLDBCompare.exe,呵呵,已經不是上次提示的14天到期了,而是禮貌地提示請你提交用戶信息的提示了,以圖為證
?
甭理它,直接 “do it later”進入,呵呵,標題欄上已經沒有“Trial(14 Days Left)”的字樣了,再點View>>License,乖乖,多惹人喜歡的提示呀!
?
OK,That's all.
總結
以上是生活随笔為你收集整理的SQLDBCompare_Rel2.0破解手记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (转)提问的智慧
- 下一篇: 敏捷开发:软件与文档