日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Wing IDE 5.0 破解之寻找注册码

發(fā)布時間:2024/7/23 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Wing IDE 5.0 破解之寻找注册码 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

來源:http://bbs.pediy.com/showthread.php?p=1253653


一.??工具:
1.??uncompyle2
2.??IDA?Pro?6.1
3.??WingIDE?5.0本身
二.??工具安裝
1.??安裝Python2.7
2.??安裝WinIDE?5.0
3.??解壓uncompyle2,進入解壓目錄,執(zhí)行命令python?setup.py?install
三.??破解過程
1.??直接拷貝C:\Wing?IDE?5.0\bin\2.7\src.zip到C:\crack,解壓。
2.??cd?C:\Python27\Scripts,運行python?uncompyle2?--py?-o?.?c:\crack\src,反編譯所有的pyo文件。
3.??啟動WingIDE?5.0,選擇”O(jiān)btain?or?extend?a?trial?license”,獲得個10天的試用。
點擊help-->Enter?License…,彈出的對話框中選擇”Install?and?activate?a?permant?license”,
隨便輸幾個啥,我這里輸入”FFFF”,提示如下圖:
?
哈,說的很明白了。
4.??找License?ID的規(guī)律
用WingIDE打開c:\crack\src\process\wingctl.py,搜索字符串”Invalid?license?id”,定位到這串代碼

代碼: ????????if?self.__fRadioActivate.get_active():id?=?self.__fLicenseIDEntry.get_text()errs,?lic?=?abstract.ValidateAndNormalizeLicenseID(id)if?len(errs)?==?0?and?id[0]?==?'T':errs.append(_('You?cannot?enter?a?trial?license?id?here'))if?len(errs)?>?0:msg?=?_('Invalid?license?id:?%s.?Please?check?and?correct?it.??Errors?found?were:\n\n%s')?%?(id,?'\n'.join(errs))buttons?=?[dialogs.CButtonSpec(_('_OK'),?None,?wgtk.STOCK_OK)]dlg?=?messages.CMessageDialog(self.fSingletons,?_('Invalid?License?ID'),?msg,?[],?buttons)dlg.RunAsModal(self)return?True 這可以看到,License?ID首字符如果是’T’的話,則是trial?license,這當(dāng)然不是我們要的。
右鍵點擊ValidateAndNormalizeLicenseID,選Go?to?Definition,到
代碼: def?ValidateAndNormalizeLicenseID(id):errs,?id2?=?__ValidateAndNormalize(id)if?len(id2)?>?0?and?id2[0]?not?in?kLicenseUseCodes:errs.append(_('Invalid?first?character:?Should?be?one?of?%s')?%?str(kLicenseUseCodes))if?len(id2)?>?1?and?id2[1]?!=?kLicenseProdCode:cur_product?=?'Wing?IDE?%s'?%?config.kProductlic_product?=?kLicenseProdForCode.get(id2[1],?None)if?lic_product?is?None:lic_product?=?_('an?unknown?product')else:lic_product?=?'Wing?IDE?%s'?%?config.k_ProductNames[lic_product]errs.append(_('Your?license?is?for?%s,?but?you?are?currently?running?%s.??Please?download?the?correct?product?from?http://wingware.com/downloads?or?upgrade?your?license?at?https://wingware.com/store/upgrade')?%?(lic_product,?cur_product))if?len(errs)?>?0:check_code?=?id.strip().upper().replace('-',?'')if?len(check_code)?==?16:looks_like_11?=?Truefor?c?in?check_code:if?c?not?in?'0123456789ABCDEF':looks_like_11?=?Falseif?looks_like_11:errs?=?[_('You?cannot?activate?using?a?Wing?IDE?1.1?license:??Please?use?a?trial?license?or?upgrade?your?license?at?http://wingware.com/store/upgrade')]if?len(errs)?>?0:return?(errs,?None)else:return?([],?id2) 這時我們發(fā)現(xiàn),這個函數(shù)是在abstract.py中的。
我們首先看看__ValidateAndNormalize在干些啥,轉(zhuǎn)到定義,
代碼: def?__ValidateAndNormalize(code):"""Remove?hyphens?and?extra?space/chars?in?a?license?id?or?activationrequest,?and?validate?it?as?within?the?realm?of?possibility.??Returnserrs,?value."""errs?=?[]code?=?code.strip().upper()code2?=?''badchars?=?''for?c?in?code:if?c?in?('-',?'?',?'\t'):passelif?c?not?in?textutils.BASE30:code2?+=?cif?badchars.find(c)?==?-1:badchars?+=?celse:code2?+=?cif?len(badchars)?>?0:errs.append(_('Contains?invalid?characters:?%s')?%?badchars)if?len(code2)?!=?20:errs.append(_('Wrong?length?(should?contain?20?non-hyphen?characters)'))if?len(errs)?>?0:return?(errs,?code2)else:return?([],?AddHyphens(code2)) 這我們可以看到,License?ID的字符必須在BASE30的范圍內(nèi)并且除掉’-’、’?’、’\t’等字符后必須有20個字符。
程序定義的BASE30?=?'123456789ABCDEFGHJKLMNPQRTVWXY',
這個定義是在C:\crack\src\wingutils\?textutils.py中。
現(xiàn)在返回ValidateAndNormalizeLicenseID函數(shù),從第二行知道License?ID的首字符必須是
kLicenseUseCodes中的一個kLicenseUseCodes?=?['T',?'N',?'E',?'C',?'1',?'3',?'6'],前面說過,’T’表示trial?license
第四行告訴我們,License?ID的第二個字符必須是kLicenseProdCode中的一個
這個kLicenseProdCode定義如下
代碼: kLicenseProdCodes?=?{config.kProd101:?'1',config.kProdPersonal:?'L',config.kProdProfessional:?'N',config.kProdEnterprise:?'E'} kLicenseProdCode?=?kLicenseProdCodes[config.kProductCode] 因為我們安裝的是Professional版本,所以第二個字符應(yīng)該是’N’,Enterprise版本還真不知道在哪里下載,反正官網(wǎng)上找不到~~~
好了,總結(jié)一下:
License?ID?必須有20個字符且每個字符必須是'123456789ABCDEFGHJKLMNPQRTVWXY'中的;
字符必須首字母必須是['T',?'N',?'E',?'C',?'1',?'3',?'6']中的一個,但是我們不會用’T’;
第二個字符必須是['1','L','N','E']中的一個

那現(xiàn)在隨便搞個”CN123-12345-12345-12345”輸入:

Continue,哈,出來了這個,選擇輸入激活碼

先不管,直接Continue,看看啥反應(yīng)

哦,又是需要20個字符,并且必須是”AXX”開頭,好吧,好戲要上場了。
5.??找Activation?Code
還是在c:\crack\src\process\wingctl.py查找字符串”?Invalid?activation?key”,來到這:
代碼: def?__PageTwoContinue(self):if?self.__fRadioDirect.get_active():self.__StartActivation()return?Trueif?self.__fRadioManual.get_active():act?=?self.__fManualEntry.get_text()errs,?act?=?abstract.ValidateAndNormalizeActivation(act)if?len(errs)?>?0:title?=?_('Invalid?License?ID')msg?=?_('Invalid?activation?key:?%s.?Please?check?and?correct?it.??Errors?found?were:\n\n%s')?%?(self.__fManualEntry.get_text(),?'\n'.join(errs))self.__ErrorDlg(title,?msg)return?Trueactbase?=?os.path.normpath(fileutils.join(config.kUserWingDir,?'license.pending')) 轉(zhuǎn)到ValidateAndNormalizeActivation的定義處:
代碼: def?ValidateAndNormalizeActivation(id):errs,?id2?=?__ValidateAndNormalize(id)if?id2[:3]?!=?kActivationPrefix:errs.append(_("Invalid?prefix:??Should?be?'%s'")?%?kActivationPrefix)if?len(errs)?>?0:return?(errs,?None)else:return?([],?id2) 又是__ValidateAndNormalize,前面已經(jīng)分析過了。看后面,第二行代碼清楚的告訴我們,
激活碼前三個字符必須是kActivationPrefix?,這個kActivationPrefix?=?'AXX'。
好了,我們隨便輸個”AXX23-12345-12345-12345”,這個當(dāng)然是錯誤的。
在c:\crack\src\process\wingctl.py查找字符串”?Invalid?activation?key”的下一處出現(xiàn)的地方,來到:
代碼: self.fLicense['activation']?=?acterr,?info?=?self.fLicMgr._ValidateLicenseDict(self.fLicense,?None)if?err?!=?abstract.kLicenseOK:msg?=?_('Invalid?activation?key:?%s.?Please?check?and?correct?it.')?%?self.__fManualEntry.get_text()errs.append('Current?activation?--?failed:')errs.extend([?'??'?+?t?for?t?in?self.fLicMgr._StatusToErrString((err,?info))?])if?len(errs)?>?0:msg?+=?_('??Validation?errors?were:\n\n%s')?%?'\n'.join(errs)title?=?_('Invalid?License?ID') 但是這里的函數(shù)self.fLicMgr._ValidateLicenseDict,用鼠標右鍵找不到定義的地方。
我們先看看self.fLicMgr是個啥東西,轉(zhuǎn)到定義:
代碼: class?CObtainLicenseDialog(dialogs.CGenericDialog):"""Dialog?used?to?obtain?a?new?license"""kCharWidth?=?60def?__init__(self,?singletons,?lic?=?None):self.fSingletons?=?singletonsself.fLicMgr?=?singletons.fLicMgrself.fLicense?=?lic self.fLicMg是這個類初始化時傳進來的,在類名上右鍵,點Find?Points?of?Use,來到這里
代碼: def?_ObtainLicense(self):"""Prompt?user?to?obtain?a?license,?or?quit?if?they?don't?get?one"""if?self._fPromptForSaveDialog?or?not?wgtk.kQt?and?wgtk.gdk.pointer_is_grabbed():returnif?self.__fObtainLicenseDialog?is?not?None:self.__fObtainLicenseDialog.Show()returnself.__fObtainLicenseDialog?=?CObtainLicenseDialog(self.fSingletons) 這個_ObtainLicense函數(shù)是類CWingLicenseManager的成員,
初始化CObtainLicenseDialog的參數(shù)是類CWingLicenseManager的成員,轉(zhuǎn)到定義
代碼: class?CWingLicenseManager(abstract.CLicenseManager):"""?Specialization?of?the?generic?license?manager?for?use?in?Wing?IDE?"""def?__init__(self,?singletons):"""?Constructor?"""abstract.CLicenseManager.__init__(self)self.fSingletons?=?singletonsself._fExpiringLicenseCheck?=?Falseself.__fObtainLicenseDialog?=?Noneself._fPromptForSaveDialog?=?False 找CWingLicenseManager這個類的使用點,來到singleton.py中
代碼: ????def?CreateLicMgr(self):"""?Create?license?manager.?Mucking?with?this?code?is?a?violation?ofyour?software?license?and?a?generally?sleazy?thing?to?do?to?a?bunch?ofguys?trying?to?make?a?living?by?creating?some?decent?tools?for?you.?Soplease?don't?do?it.?"""?lic_mgr?=?process.wingctl.CWingLicenseManager(self)self.fLicMgr?=?lic_mgrself.emit('changed',?self) 這里終于可以知道CObtainLicenseDialog中的self.fLicMgr其實是CWingLicenseManager。
那么看看CWingLicenseManager的基類是啥?是abstract.py文件中的CLicenseManager,
這個類中有_ValidateLicenseDict()函數(shù)的定義。好了,轉(zhuǎn)到這個函數(shù)去看看:
代碼: def?_ValidateLicenseDict(self,?lic,?filename):"""?Check?license?for?internal?integrity?and?expiration?"""lic['daysleft']?=?_('expired')for?key?in?kRequiredLicenseFields:if?not?lic.has_key(key):return?(kLicenseCorrupt,?_('Missing?a?required?line?%s')?%?key)err,?msg?=?self._ValidatePlatform(lic['license'],?lic['os'])if?err?!=?None:return?(err,?msg)err,?msg?=?self._ValidateProduct(lic['product'])if?err?!=?None:return?(err,?msg)err,?msg?=?self._ValidateVersion(lic['version'])if?err?!=?None:return?(err,?msg)try:lichash?=?CreateActivationRequest(lic)act30?=?lic['activation']if?lichash[2]?not?in?'X34':hasher?=?sha.new()hasher.update(lichash)hasher.update(lic['license'])digest?=?hasher.hexdigest().upper()lichash?=?lichash[:3]?+?textutils.SHAToBase30(digest)errs,?lichash?=?ValidateAndNormalizeRequest(lichash)act?=?act30.replace('-',?'')[3:]hexact?=?textutils.BaseConvert(act,?textutils.BASE30,?textutils.BASE16)while?len(hexact)?<?20:hexact?=?'0'?+?hexactconfig._locale_valid?=?0valid?=?control.validate(lichash,?lic['os'],?lic['version'][:lic['version'].find('.')],?hexact)valid?=?config._locale_validexcept:valid?=?0if?not?valid:return?(kLicenseCorrupt,?_('Invalid?license?activation'))daysleft?=?self._GetTermDaysLeft(lic)if?daysleft?==?-1:lic['daysleft']?=?_('unlimited')else:if?daysleft?==?-2:return?(kLicenseCorrupt,?_('Invalid?date?or?termdays?in?file'))if?daysleft?==?0:return?(kLicenseExpired,?None)if?daysleft?>?12?and?lic['license'][0]?==?'T':return?(kLicenseCorrupt,?_('Invalid?date?or?termdays?in?file'))if?daysleft?>?190?and?lic['license'][0]?!=?'T':return?(kLicenseCorrupt,?_('Invalid?date?or?termdays?in?file'))lic['daysleft']?=?str(daysleft)?+?_('?days?left')errs?=?hostinfo.IDMatch(lic['hostinfo'])if?len(errs)?>?0:return?(kLicenseHostMismatch,?None)if?filename?is?not?None:err,?info?=?self.__CheckUserCount(lic,?filename)else:err?=?kLicenseOKinfo?=?[]return?(err,?info) 可以看到,算法不復(fù)雜,用lichash和lic[‘license’]做sha運算,之后將sha的值用BASE30變換,
將lichash的前三個字符附加在前面的到新的lichash。
最初的lichash是CreateActivationRequest得到的,
這其實就是在要我們輸入激活碼那個對話框中顯示的Request?Code=’?RW518-Q2NNM-13PRE-JQ3JR’。
lic[‘license’]其實就是輸入的License?ID。
通過看ValidateAndNormalizeRequest的代碼,可知lichash的前三個字符分別是:
’R’代表這個是Request?code;’W’表示是Windows;’5’表示是5.*版本。
關(guān)鍵就在這句 代碼: valid?=?control.validate(lichash,?lic['os'],?lic['version'][:lic['version'].find('.')],?hexact) ,好,看看control是啥定義:
代碼: if?sys.platform[:5]?in?('win32',?'darwi')?or?sys.platform[:5]?==?'linux'?and?os.uname()[4]?not?in?('ppc',?'ppc64',?'arm7l'):import?ctlutil?as?control else:try:import?pycontrolcontrol?=?pycontrolexcept?ImportError:dirname?=?os.path.dirname(__file__).replace('.zip',?'')control?=?LoadFromDat(fileutils.join(dirname,?'pycontrol.dat'),?'pycontrol') 這個ctlutil是啥?搜,我用的Everyting這軟件,搜到C:\Wing?IDE?5.0\bin\2.7\src\process\ctutil.pyd,這其實就是個dll,IDA反編譯它。
反編譯后的啞名函數(shù)不多,就5個,挨個看。看到sub_10001410這函數(shù)的時候,猛然發(fā)現(xiàn)有個”_locale_valid”
代碼: .text:10001410?sub_10001410????proc?near???????????????;?DATA?XREF:?.data:100030A8o .text:10001410 .text:10001410?var_110?????????=?dword?ptr?-110h .text:10001410?var_10C?????????=?dword?ptr?-10Ch .text:10001410?var_108?????????=?dword?ptr?-108h .text:10001410?var_104?????????=?dword?ptr?-104h .text:10001410?var_100?????????=?byte?ptr?-100h .text:10001410?arg_4???????????=?dword?ptr??8 .text:10001410 .text:10001410?????????????????sub?????esp,?110h .text:10001416?????????????????cmp?????dword_100030E0,?0 .text:1000141D?????????????????jnz?????short?loc_10001432 .text:1000141F?????????????????push????offset?aConfig??;?"config" .text:10001424?????????????????call????ds:PyImport_ImportModule .text:1000142A?????????????????add?????esp,?4 .text:1000142D?????????????????mov?????dword_100030E0,?eax .text:10001432 .text:10001432?loc_10001432:???????????????????????????;?CODE?XREF:?sub_10001410+Dj .text:10001432?????????????????push????esi .text:10001433?????????????????mov?????esi,?ds:PyInt_FromLong .text:10001439?????????????????push????edi .text:1000143A?????????????????push????0 .text:1000143C?????????????????call????esi?;?PyInt_FromLong .text:1000143E?????????????????mov?????edi,?ds:PyObject_SetAttrString .text:10001444?????????????????push????eax .text:10001445?????????????????mov?????eax,?dword_100030E0 .text:1000144A?????????????????push????offset?a_locale_valid?;?"_locale_valid" .text:1000144F?????????????????push????eax .text:10001450?????????????????call????edi?;?PyObject_SetAttrString .text:10001452?????????????????lea?????ecx,?[esp+128h+var_108] 想到前面_ValidateLicenseDict的代碼中也有這么一句:valid=config._local_valid,料想這函數(shù)就是在驗證了。使用IDA強大的F5,馬上就知道,sub_10001020是在計算真正的激活碼
代碼: .text:10001489?????????????????mov?????ecx,?[esp+118h+var_10C] .text:1000148D?????????????????lea?????eax,?[esp+118h+var_100] .text:10001491?????????????????push????eax?????????????;?char?* .text:10001492?????????????????mov?????eax,?[esp+11Ch+var_104] .text:10001496?????????????????push????ecx?????????????;?int .text:10001497?????????????????mov?????ecx,?[esp+120h+var_110] .text:1000149B?????????????????call????sub_10001020????;?計算真正的activation?key .text:100014A0?????????????????add?????esp,?8 .text:100014A3?????????????????test????eax,?eax .text:100014A5?????????????????jnz?????short?loc_100014FC .text:100014A7?????????????????mov?????edx,?[esp+118h+var_108]?;?得到輸入的activation?key的地址 .text:100014AB?????????????????lea?????ecx,?[esp+118h+var_100]?;?得到計算的Activation?Key的地址 .text:100014AF?????????????????nop .text:100014B0 .text:100014B0?loc_100014B0:???????????????????????????;?CODE?XREF:?sub_10001410+BAj .text:100014B0?????????????????mov?????al,?[ecx] .text:100014B2?????????????????cmp?????al,?[edx]?;?我的媽呀,明文比較呀,這是要發(fā)啊~~~ .text:100014B4?????????????????jnz?????short?loc_100014D0 .text:100014B6?????????????????test????al,?al .text:100014B8?????????????????jz??????short?loc_100014CC .text:100014BA?????????????????mov?????al,?[ecx+1] .text:100014BD?????????????????cmp?????al,?[edx+1] .text:100014C0?????????????????jnz?????short?loc_100014D0 .text:100014C2?????????????????add?????ecx,?2 .text:100014C5?????????????????add?????edx,?2 .text:100014C8?????????????????test????al,?al .text:100014CA?????????????????jnz?????short?loc_100014B0 現(xiàn)在用IDA在1000149B處下斷點調(diào)試,直接附加到wing.exe,輸入License?ID:”?CN123-12345-12345-12345”,
輸入假的激活碼”?AXX23-12345-12345-12345”。F8單步過lea?ecx,[esp+118h+var_100],
內(nèi)存窗口里轉(zhuǎn)到ecx的地址,得到的是:
“55DF6297CE47296C1916”,這是真正的激活碼的sha值,現(xiàn)在要做的就是把這sha轉(zhuǎn)換到BASE30,
然后前面附加”AXX”就行了。新建一個py文件,轉(zhuǎn)換代碼如下:
代碼: realcode='55DF6297CE47296C1916' act30=BaseConvert(realcode,BASE16,BASE30) while?len(act30)?<?17:act30?=?'1'?+?act30 這里的BaseConvert函數(shù)是從c:\crack\src\wingutils\textutils.py中拷貝來的。運行一下這個py,得到:
act30=”1X8TBXQFVWRYLBDKB”
所以激活碼是AXX1X8TBXQFVWRYLBDKB
6.注冊機的制作
進入sub_10001020,算法非常簡單,不多說了,直接上注冊機
CalcActivationCode.rar .
注冊機是個python源代碼文件,沒有使用任何附加庫,直接可以跑
使用時,編輯下RequestCode就行了
看下效果吧
*轉(zhuǎn)載請注明來自看雪論壇@PEd

總結(jié)

以上是生活随笔為你收集整理的Wing IDE 5.0 破解之寻找注册码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。