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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

160 - 14 bjanes.1

發布時間:2023/12/1 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 160 - 14 bjanes.1 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

環境:

window xp sp3


工具:

ollydbg ,exeinfo pe


拿到程序后,查殼。顯示是無殼的VB程序


用之前用的VB decompiler載入,沒找到有用的東西,還是用回了OD。


OD載入,運行起來。輸入“GNUBD”然后點擊“”check it",彈出錯誤消息框,回到OD,F12暫停,Alt+F9回到用戶領空,然后把錯誤消息框的“確定”點掉,然后就可以看到在OD中程序在哪里調用了MessageBox。

00403A4E . C785 58FFFFFF>mov dword ptr ss:[ebp-0xA8],bjanes_1.004>; UNICODE "Wrong serial!" 00403A58 . 89BD 50FFFFFF mov dword ptr ss:[ebp-0xB0],edi 00403A5E . FFD6 call esi ; <&MSVBVM60.__vbaVarDup> 00403A60 . 8D95 60FFFFFF lea edx,dword ptr ss:[ebp-0xA0] 00403A66 . 8D4D C0 lea ecx,dword ptr ss:[ebp-0x40] 00403A69 . C785 68FFFFFF>mov dword ptr ss:[ebp-0x98],bjanes_1.004>; UNICODE "Sorry, try again!" 00403A73 . 89BD 60FFFFFF mov dword ptr ss:[ebp-0xA0],edi 00403A79 . FFD6 call esi 00403A7B . 8D45 90 lea eax,dword ptr ss:[ebp-0x70] 00403A7E . 8D4D A0 lea ecx,dword ptr ss:[ebp-0x60] 00403A81 . 50 push eax 00403A82 . 8D55 B0 lea edx,dword ptr ss:[ebp-0x50] 00403A85 . 51 push ecx 00403A86 . 52 push edx 00403A87 . 8D45 C0 lea eax,dword ptr ss:[ebp-0x40] 00403A8A . 53 push ebx 00403A8B . 50 push eax 00403A8C . FF15 30104000 call dword ptr ds:[<&MSVBVM60.#595>] ; MSVBVM60.rtcMsgBox 00403A92 . 8D4D 90 lea ecx,dword ptr ss:[ebp-0x70] ; 停在這里
往上可以看到是錯誤的信息,往下翻一翻可以看到:

00403A8C . FF15 30104000 call dword ptr ds:[<&MSVBVM60.#595>] ; MSVBVM60.rtcMsgBox 00403A92 . 8D4D 90 lea ecx,dword ptr ss:[ebp-0x70] ; 停在這里 00403A95 . 8D55 A0 lea edx,dword ptr ss:[ebp-0x60] 00403A98 . 51 push ecx 00403A99 . 8D45 B0 lea eax,dword ptr ss:[ebp-0x50] 00403A9C . 52 push edx 00403A9D . 8D4D C0 lea ecx,dword ptr ss:[ebp-0x40] 00403AA0 . 50 push eax 00403AA1 . 51 push ecx 00403AA2 . EB 7E jmp Xbjanes_1.00403B22 00403AA4 > 8B35 A4104000 mov esi,dword ptr ds:[<&MSVBVM60.__vbaVa>; MSVBVM60.__vbaVarDup 有東西跳到這里來,往上翻看看是哪里跳轉過來這里的 00403AAA . B9 04000280 mov ecx,0x80020004 00403AAF . 894D 98 mov dword ptr ss:[ebp-0x68],ecx 00403AB2 . B8 0A000000 mov eax,0xA 00403AB7 . 894D A8 mov dword ptr ss:[ebp-0x58],ecx 00403ABA . BF 08000000 mov edi,0x8 00403ABF . 8D95 50FFFFFF lea edx,dword ptr ss:[ebp-0xB0] 00403AC5 . 8D4D B0 lea ecx,dword ptr ss:[ebp-0x50] 00403AC8 . 8945 90 mov dword ptr ss:[ebp-0x70],eax 00403ACB . 8945 A0 mov dword ptr ss:[ebp-0x60],eax 00403ACE . C785 58FFFFFF>mov dword ptr ss:[ebp-0xA8],bjanes_1.004>; UNICODE "Correct serial!" 00403AD8 . 89BD 50FFFFFF mov dword ptr ss:[ebp-0xB0],edi 00403ADE . FFD6 call esi ; <&MSVBVM60.__vbaVarDup> 00403AE0 . 8D95 60FFFFFF lea edx,dword ptr ss:[ebp-0xA0] 00403AE6 . 8D4D C0 lea ecx,dword ptr ss:[ebp-0x40] 00403AE9 . C785 68FFFFFF>mov dword ptr ss:[ebp-0x98],bjanes_1.004>; UNICODE "Good job, tell me how you do that!" 00403AF3 . 89BD 60FFFFFF mov dword ptr ss:[ebp-0xA0],edi 00403AF9 . FFD6 call esi 00403AFB . 8D55 90 lea edx,dword ptr ss:[ebp-0x70] 00403AFE . 8D45 A0 lea eax,dword ptr ss:[ebp-0x60] 00403B01 . 52 push edx 00403B02 . 8D4D B0 lea ecx,dword ptr ss:[ebp-0x50] 00403B05 . 50 push eax 00403B06 . 51 push ecx 00403B07 . 8D55 C0 lea edx,dword ptr ss:[ebp-0x40] 00403B0A . 53 push ebx 00403B0B . 52 push edx 00403B0C . FF15 30104000 call dword ptr ds:[<&MSVBVM60.#595>] ; MSVBVM60.rtcMsgBox 00403B12 . 8D45 90 lea eax,dword ptr ss:[ebp-0x70]

下面就是顯示正確的消息框。


0040375A . 8985 14FFFFFF mov dword ptr ss:[ebp-0xEC],eax 00403760 . C745 E8 01000>mov dword ptr ss:[ebp-0x18],0x1 ; serial與這個有關 00403767 . FF15 C0104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStr 0040376D . 8D4D D4 lea ecx,dword ptr ss:[ebp-0x2C] 00403770 . FF15 C4104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj 00403776 . 8B35 AC104000 mov esi,dword ptr ds:[<&MSVBVM60.__vbaSt>; MSVBVM60.__vbaStrMove 0040377C > 66:8B8D 14FFF>mov cx,word ptr ss:[ebp-0xEC] ; 這里是下面一個JMP回來的地方 00403783 . 66:394D E8 cmp word ptr ss:[ebp-0x18],cx ; 這里是比較次數,大于9次了就跳往成功 00403787 . 0F8F 17030000 jg bjanes_1.00403AA4 ; 這里是跳到正確的消息框的窗口 0040378D . 8B17 mov edx,dword ptr ds:[edi] 0040378F . 57 push edi


在00403787 跳轉 這個位置下一個斷點,再來一次“check it”,發現沒有OD停下來。往上找一找看看是什么情況:


004036DC . 50 push eax ; /String 004036DD . FF15 08104000 call dword ptr ds:[<&MSVBVM60.__vbaLenBs>; \__vbaLenBstr 004036E3 . 33C9 xor ecx,ecx 004036E5 . 83F8 09 cmp eax,0x9 ; 輸入的serial長度與0x9比較 004036E8 . 0F95C1 setne cl ; 如果eax 不等于 0x9,cl就等于賦值為1 004036EB . F7D9 neg ecx ; ecx取反,如果ecx為0則不變,如果為1則變成0xFFFFFFFF 004036ED . 8BF1 mov esi,ecx ; 賦值給esi到下面比較 004036EF . 8D4D E4 lea ecx,dword ptr ss:[ebp-0x1C] 004036F2 . FF15 C0104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStr 004036F8 . 8D4D D4 lea ecx,dword ptr ss:[ebp-0x2C] 004036FB . FF15 C4104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj 00403701 . 66:3BF3 cmp si,bx ; ebx的值一直為0,所有要si的值也為0 00403704 . 0F85 1A030000 jnz bjanes_1.00403A24 ; 這里跳到顯示錯誤消息的地方 0040370A . 8B17 mov edx,dword ptr ds:[edi]

輸入的長度要9位

然后將“GNUBD”改為“GNUBD1234”,然后“check it”


這次可以看到斷點斷下來了。然后單步走,發現有幾個比較,但是后面都沒有跟跳轉。


00403985 . A8 0D test al,0xD 00403987 . 0F85 1A020000 jnz bjanes_1.00403BA7 0040398D . 8B45 D8 mov eax,dword ptr ss:[ebp-0x28] 00403990 . C745 D8 00000>mov dword ptr ss:[ebp-0x28],0x0 00403997 . 8945 98 mov dword ptr ss:[ebp-0x68],eax 0040399A . 8D45 80 lea eax,dword ptr ss:[ebp-0x80] 0040399D . 50 push eax ; 字符串位置 0040399E . C745 90 08000>mov dword ptr ss:[ebp-0x70],0x8 004039A5 . FF15 B0104000 call dword ptr ds:[<&MSVBVM60.#619>] ; MSVBVM60.rtcRightCharVar 004039AB . 8D8D 30FFFFFF lea ecx,dword ptr ss:[ebp-0xD0] ; 0x8005 004039B1 . 8D55 80 lea edx,dword ptr ss:[ebp-0x80] ; 0x8 004039B4 . 51 push ecx ; /var18 004039B5 . 52 push edx ; |var28 004039B6 . FF15 A0104000 call dword ptr ds:[<&MSVBVM60.__vbaVarTs>; \__vbaVarTstNe 004039BC . 8BF8 mov edi,eax ; 這里是上面兩個位置比較 004039BE . 8D45 D8 lea eax,dword ptr ss:[ebp-0x28] ; 這里是有點疑問的,兩個位置的值是顯然不一樣的,為什么返回值eax為0xFFFFFFFF 004039C1 . 8D4D DC lea ecx,dword ptr ss:[ebp-0x24] ; 下面這些不用看 004039C4 . 50 push eax 004039C5 . 8D55 E0 lea edx,dword ptr ss:[ebp-0x20] 004039C8 . 51 push ecx 004039C9 . 8D45 E4 lea eax,dword ptr ss:[ebp-0x1C] 004039CC . 52 push edx 004039CD . 50 push eax 004039CE . 6A 04 push 0x4 004039D0 . FF15 90104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStrList 004039D6 . 83C4 14 add esp,0x14 004039D9 . 8D4D D4 lea ecx,dword ptr ss:[ebp-0x2C] 004039DC . FF15 C4104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj 004039E2 . 8D4D 80 lea ecx,dword ptr ss:[ebp-0x80] 004039E5 . 8D55 90 lea edx,dword ptr ss:[ebp-0x70] 004039E8 . 51 push ecx 004039E9 . 8D45 A0 lea eax,dword ptr ss:[ebp-0x60] 004039EC . 52 push edx 004039ED . 8D4D B0 lea ecx,dword ptr ss:[ebp-0x50] 004039F0 . 50 push eax 004039F1 . 8D55 C0 lea edx,dword ptr ss:[ebp-0x40] 004039F4 . 51 push ecx 004039F5 . 52 push edx 004039F6 . 6A 05 push 0x5 004039F8 . FF15 0C104000 call dword ptr ds:[<&MSVBVM60.__vbaFreeV>; MSVBVM60.__vbaFreeVarList 004039FE . 83C4 18 add esp,0x18 ; 00403A01 . 66:85FF test di,di ;來到這里,測試di是否為0,不為0則跳 00403A04 . 75 1C jnz Xbjanes_1.00403A22 ; 這跳了就wrong serial 00403A06 . 8B7D 08 mov edi,dword ptr ss:[ebp+0x8] 00403A09 . B8 01000000 mov eax,0x1 ; eax賦值為1 00403A0E . 66:0345 E8 add ax,word ptr ss:[ebp-0x18] ; 將[ebp-0x18]的值加上去 00403A12 . 0F80 94010000 jo bjanes_1.00403BAC ; 00403A18 . 8945 E8 mov dword ptr ss:[ebp-0x18],eax 00403A1B . 33DB xor ebx,ebx 00403A1D .^ E9 5AFDFFFF jmp bjanes_1.0040377C ; 這里是跳回去的,回到0040377C

于是就有個猜想,每次比較一個字符,比較9次,那么與serial比較的字符在哪里呢?

004038F1 > \66:8B45 E8 mov ax,word ptr ss:[ebp-0x18] ; 這里就是剛剛在403760位置賦值的地方,也可以在434A0E找到它 004038F5 . 8B1D 74104000 mov ebx,dword ptr ds:[<&MSVBVM60.#536>] ; MSVBVM60.rtcStrFromVar 004038FB . 66:35 0200 xor ax,0x2 ; 將取出來的值異或0x2,異或后的值就是serial 004038FF . 8D4D A0 lea ecx,dword ptr ss:[ebp-0x60] 00403902 . 0F80 A4020000 jo bjanes_1.00403BAC 00403908 . 51 push ecx 00403909 . 66:8945 A8 mov word ptr ss:[ebp-0x58],ax 0040390D . C745 A0 02000>mov dword ptr ss:[ebp-0x60],0x2 00403914 . FFD3 call ebx ; <&MSVBVM60.#536> 00403916 . 8BD0 mov edx,eax ; 值轉為字符 00403918 . 8D4D D8 lea ecx,dword ptr ss:[ebp-0x28] 0040391B . FFD6 call esi ; 將字符串移動到ecx的地址中 0040391D . 8B45 E4 mov eax,dword ptr ss:[ebp-0x1C] 00403920 . 8D55 C0 lea edx,dword ptr ss:[ebp-0x40] 00403923 . 52 push edx 00403924 . 57 push edi 00403925 . 50 push eax 00403926 . C745 C8 01000>mov dword ptr ss:[ebp-0x38],0x1 0040392D . C745 C0 02000>mov dword ptr ss:[ebp-0x40],0x2 00403934 . FF15 44104000 call dword ptr ds:[<&MSVBVM60.#631>] ; MSVBVM60.rtcMidCharBstr 0040393A . 8BD0 mov edx,eax ; 讀取字符串eax第edi位的值 0040393C . 8D4D E0 lea ecx,dword ptr ss:[ebp-0x20] 0040393F . FFD6 call esi 00403941 . 50 push eax ; /String 00403942 . FF15 1C104000 call dword ptr ds:[<&MSVBVM60.#516>] ; \rtcAnsiValueBstr 00403948 . 8D4D B0 lea ecx,dword ptr ss:[ebp-0x50] 0040394B . 66:8945 B8 mov word ptr ss:[ebp-0x48],ax 0040394F . 51 push ecx 00403950 . C745 B0 02000>mov dword ptr ss:[ebp-0x50],0x2 ; 這里將字符轉為了數值,但是仍然用字符格式保存 00403957 . FFD3 call ebx 00403959 . 8BD0 mov edx,eax ; 轉成了十進制的數 0040395B . 8D4D DC lea ecx,dword ptr ss:[ebp-0x24] 0040395E . FFD6 call esi 00403960 . 50 push eax 00403961 . FF15 84104000 call dword ptr ds:[<&MSVBVM60.__vbaR8Str>; MSVBVM60.__vbaR8Str 00403967 . DC25 D8104000 fsub qword ptr ds:[0x4010D8] ; 轉成double再減去48,'0'的字符編碼為48 0040396D . 8D55 90 lea edx,dword ptr ss:[ebp-0x70] ; 00403970 . 6A 01 push 0x1 00403972 . 52 push edx ;

顯然可以看出[ebp-0x18]的值取出來eax,然后將異或0x2后的結果與輸入的serial比較,相同就繼續往下,又因為每次jmp之前[ebp-0x18]的值都會加1且[ebp-0x18]一開始就是1,所以結果就是:


for(int i = 1;i<=9;i++){printf("%d ",i^2); }


會發現最后面的結果是10和11,又因為serial的長度為9位,所以不可能將10和11輸入進去,再次載入的時候把前面7位輸入正確“3016745”,后面兩位隨便來。在跟隨一次。
還是沒找到程序在哪里將輸入的serial后面兩位與10和11進行了比較,但是仍然可以從10和11的結果中猜出搭配來的。


最后的正確的serial是“301674501”


總結:
1.多留意一下那些運算的指令,可能運算結果就是serial?
2.對應對在對serial進行判斷前有一個跳轉回來的,可以猜測是對serial的循環判斷。在跳回來之前會改變比較的對象,可以從中看出每一次是用誰來進行比較、


總結

以上是生活随笔為你收集整理的160 - 14 bjanes.1的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。