關於W32Dasm 8.93 Patch 1.0的搜尋功能,和diy W32Dasm10加上這個功能的一點想法
看到kanxun發佈的這個搜尋版,我測試了一下,所有修正檔的動作都在w32dsm.dll裡面,更改了程序的入口使其一開始就loadlibary w32dsm.dll,然後w32dsm.dll
會修改原程序相關的指令,主要與彈出搜尋dialog的api是createdialogparam,載入w32dsm.dll和沒有載入,其消息函數的位址,和顯示的資源都不一樣,這個有搜尋edit,和button的dialog資源在w32dsm.dll裡面,當而且w32dsm.dll還有專門處理搜尋的消息函數,其他處理函數和原來程序函數功能一致沒有什麼變化, 我現在將這個搜尋消息函數分析一下,給有興趣把killer版10的w32asm也加上這個功能的朋友做參考,希望大家迎難而上,多多實踐 * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:10002298(C) | :100022AD 3D11010000 cmp eax, 00000111==>比較消息是否是wm_command :100022B2 7525 jne 100022D9===>不是完蛋 :100022B4 8B4510 mov eax, dword ptr [ebp+10] :100022B7 663D6318 cmp ax, 1863==>比較子參量是否點擊search按鈕 :100022BB 7518 jne 100022D5 :100022BD 6860180000 push 00001860 :100022C2 68FF550000 push 000055FF :100022C7 FF7508 push [ebp+08] :100022CA E89F020000 call 1000256E==>做search的功能 :100022CF C9 leave :100022D0 C21000 ret 0010 call到這裡 :1000256E 55 push ebp :1000256F 8BEC mov ebp, esp :10002571 FF750C push [ebp+0C]===>identifier of control :10002574 FF7508 push [ebp+08]==> handle of dialog box * Reference To: USER32.GetDlgItem, Ord:0100h | :10002577 E838050000 Call 10002AB4 :1000257C A310660010 mov dword ptr [10006610], eax==>這樣會得到search文本框的handle :10002581 6800020000 push 00000200==>最大字串支持512個 :10002586 68EC680010 push 100068EC===>拷貝你要搜尋的字串到這個buffer :1000258B FF7510 push [ebp+10]==>identifier of control :1000258E FF7508 push [ebp+08]==>handle of dialog box * Reference To: USER32.GetDlgItemTextA, Ord:0102h | :10002591 E824050000 Call 10002ABA==》這個函數大家都知道幹什麼 :10002596 0BC0 or eax, eax :10002598 7506 jne 100025A0==>判斷是否有字串拷貝,沒有就不搜尋了 :1000259A 33C0 xor eax, eax :1000259C C9 leave :1000259D C20C00 ret 000C * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:10002598(C) | :100025A0 6A00 push 00000000 :100025A2 6A00 push 00000000 :100025A4 688B010000 push 0000018B===>傳送一個LB_GETCOUNT消息給下面的list框,需要得到有多少個需要比較 :100025A9 FF3510660010 push dword ptr [10006610] * Reference To: USER32.SendMessageA, Ord:0210h | :100025AF E830050000 Call 10002AE4 :100025B4 A30C660010 mov dword ptr [1000660C], eax==>返回list列表的個數到這個位址 :100025B9 6A00 push 00000000 :100025BB 6A00 push 00000000 :100025BD 6888010000 push 00000188==>傳送LB_GETCURSEL消息給list筐,目的是得到現在選字串的index :100025C2 FF3510660010 push dword ptr [10006610] * Reference To: USER32.SendMessageA, Ord:0210h | :100025C8 E817050000 Call 10002AE4 :100025CD 83F8FF cmp eax, FFFFFFFF==》比較是否有沒有選list框中的某個字串,如果有的話返回的是選的字串index,沒有選返回ffffffff(-1) :100025D0 7502 jne 100025D4==>有字竄選,跳到100025D4 :100025D2 33C0 xor eax, eax * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:100025D0(C) | :100025D4 A308660010 mov dword ptr [10006608], eax==>給這個變數清零,這個變數是代表搜尋的次數 :100025D9 A3F8650010 mov dword ptr [100065F8], eax==>給這個變數清零,這個變數其實是表示你需要搜尋字串的實際index * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:10002664(U) | :100025DE FF0508660010 inc dword ptr [10006608]==》搜尋的index加1 :100025E4 A108660010 mov eax, dword ptr [10006608] :100025E9 3B050C660010 cmp eax, dword ptr [1000660C]==>和listist列表的個數比較,看是否已經全部搜尋晚所有的列出的字串 :100025EF 7507 jne 100025F8==>沒有搜尋完,繼續搜尋 :100025F1 33C0 xor eax, eax :100025F3 A308660010 mov dword ptr [10006608], eax==>已經搜尋到最後的list了,把搜尋的index清空,準備重頭搜尋 * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:100025EF(C) | :100025F8 3B05F8650010 cmp eax, dword ptr [100065F8]==>比較是否和實際搜尋到的index相等 :100025FE 7519 jne 10002619==>不等跳到10002619 :10002600 6A00 push 00000000 :10002602 50 push eax====>相等,搜尋到字傳的index :10002603 6886010000 push 00000186==>發一個LB_SETCURSEL消息給list框,然後返回,這樣那條藍條就會停在搜尋到的字串上 :10002608 FF3510660010 push dword ptr [10006610] * Reference To: USER32.SendMessageA, Ord:0210h | :1000260E E8D1040000 Call 10002AE4 :10002613 33C0 xor eax, eax :10002615 C9 leave :10002616 C20C00 ret 000C===>已經搜尋到需要找得字串,返回, * Referenced by a (U)nconditional or (C)onditional Jump at Address: |:100025FE(C)比較是否和實際搜尋到的index不相等,跳過來的 | :10002619 68EC6A0010 push 10006AEC==》得到的字串放到這個變數裡面 :1000261E 50 push eax==>這裡是現在搜尋到那個字串的index了 :1000261F 6889010000 push 00000189==>傳送LB_GETTEXT 消息給list框,告訴它我們現在搜尋到eax值的index,list把這個index對應的字串 放到10006AEC這個位址裡去,我們等下好比較是否GetDlgItemTextA得到搜尋框的字串和這個位址的是否相等 :10002624 FF3510660010 push dword ptr [10006610] * Reference To: USER32.SendMessageA, Ord:0210h | :1000262A E8B5040000 Call 10002AE4 :1000262F 0BC0 or eax, eax==如果成功的話eax是拷貝字串的數目 :10002631 7431 je 10002664==》失敗就跳到比較下一條index :10002633 68EC680010 push 100068EC===>這個是我們現在index字串的位址 :10002638 68EC6A0010 push 10006AEC==>這個是GetDlgItemTextA得到字串儲存的位址 :1000263D E821030000 call 10002963===>想都不要想就知道這個call是比較上面兩個字竄是否相等 :10002642 0BC0 or eax, eax :10002644 741E je 10002664==》不相等跳到比較下一條index :10002646 6A00 push 00000000 :10002648 FF3508660010 push dword ptr [10006608]===>現在index和GetDlgItemTextA得到字串相等,把那個藍條放到這個index上 :1000264E 6886010000 push 00000186==》LB_SETCURSEL :10002653 FF3510660010 push dword ptr [10006610] * Reference To: USER32.SendMessageA, Ord:0210h | :10002659 E886040000 Call 10002AE4 :1000265E 33C0 xor eax, eax :10002660 C9 leave :10002661 C20C00 ret 000C==>找到一個,比較完成,返回 * Referenced by a (U)nconditional or (C)onditional Jump at Addresses: |:10002631(C), :10002644(C) | :10002664 E975FFFFFF jmp 100025DE===>跳到把[10006608]的值加1,比較下一個index是否相等 好了,怎麼搜尋的原理我已經分析玩了,怎麼diy 這個pe,我還有有些想法的,到了killer的10版以後creatdialog這些功能都在w32path這個dll裡面了,如果 修正檔的話,需要做的事情很多,首先更改資源,增加一個edit控件,一個button,增加捕獲這個事件的功能,然後參照上面的程序,做相應的動作,需要的工作量太大了(如果有毅力有橫心還是能完成的:)),我現在沒有足夠的時間來幹這個工作,那個朋友有興趣,可以試試,做不下去的話可以email質詢我,我盡力幫忙,造福大家的事情就靠你們了,:) |
所有時間均為台北時間。現在的時間是 02:57 PM。 |
Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.
『服務條款』
* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *