用bochs调试mbr-初步调试

来源:互联网 发布:李咏主持功力知乎 编辑:程序博客网 时间:2024/05/21 07:49

bochs调试过程

(0) [0x00000000fffffff0] f000:fff0 (unk. ctxt): jmp far f000:e05b         ; ea5be000f0<bochs:1> b 0x7c00<bochs:2> c(0) Breakpoint 1, 0x0000000000007c00 in ?? ()Next at t=14090316(0) [0x0000000000007c00] 0000:7c00 (unk. ctxt): xor ax, ax                ; 33c0<bochs:3> sNext at t=14090317(0) [0x0000000000007c02] 0000:7c02 (unk. ctxt): mov ss, ax                ; 8ed0<bochs:4> sNext at t=14090318(0) [0x0000000000007c04] 0000:7c04 (unk. ctxt): mov sp, 0x7c00            ; bc007c<bochs:5> sNext at t=14090319(0) [0x0000000000007c07] 0000:7c07 (unk. ctxt): sti                       ; fb<bochs:6> sNext at t=14090320(0) [0x0000000000007c08] 0000:7c08 (unk. ctxt): push ax                   ; 50<bochs:7> sNext at t=14090321(0) [0x0000000000007c09] 0000:7c09 (unk. ctxt): pop es                    ; 07<bochs:8> sNext at t=14090322(0) [0x0000000000007c0a] 0000:7c0a (unk. ctxt): push ax                   ; 50<bochs:9> sNext at t=14090323(0) [0x0000000000007c0b] 0000:7c0b (unk. ctxt): pop ds                    ; 1f<bochs:10> sNext at t=14090324(0) [0x0000000000007c0c] 0000:7c0c (unk. ctxt): cld                       ; fc<bochs:11> sNext at t=14090325(0) [0x0000000000007c0d] 0000:7c0d (unk. ctxt): mov si, 0x7c1b            ; be1b7c<bochs:12> sNext at t=14090326(0) [0x0000000000007c10] 0000:7c10 (unk. ctxt): mov di, 0x061b            ; bf1b06<bochs:13> sNext at t=14090327(0) [0x0000000000007c13] 0000:7c13 (unk. ctxt): push ax                   ; 50<bochs:14> sNext at t=14090328(0) [0x0000000000007c14] 0000:7c14 (unk. ctxt): push di                   ; 57<bochs:15> sNext at t=14090329(0) [0x0000000000007c15] 0000:7c15 (unk. ctxt): mov cx, 0x01e5            ; b9e501<bochs:16> sNext at t=14090330(0) [0x0000000000007c18] 0000:7c18 (unk. ctxt): rep movsb byte ptr es:[di], byte ptr ds:[si] ; f3a4<bochs:17> pNext at t=14090815(0) [0x0000000000007c1a] 0000:7c1a (unk. ctxt): retf                      ; cb<bochs:18> pNext at t=14090816(0) [0x000000000000061b] 0000:061b (unk. ctxt): mov bp, 0x07be            ; bdbe07<bochs:19> sNext at t=14090817(0) [0x000000000000061e] 0000:061e (unk. ctxt): mov cl, 0x04              ; b104<bochs:20> sNext at t=14090818(0) [0x0000000000000620] 0000:0620 (unk. ctxt): cmp byte ptr ss:[bp], ch  ; 386e00<bochs:21> sNext at t=14090819(0) [0x0000000000000623] 0000:0623 (unk. ctxt): jl .+9 (0x0000062e)       ; 7c09<bochs:22> sNext at t=14090820(0) [0x000000000000062e] 0000:062e (unk. ctxt): mov si, bp                ; 8bf5<bochs:23> sNext at t=14090821(0) [0x0000000000000630] 0000:0630 (unk. ctxt): add si, 0x0010            ; 83c610<bochs:24> sNext at t=14090822(0) [0x0000000000000633] 0000:0633 (unk. ctxt): dec cx                    ; 49<bochs:25> sNext at t=14090823(0) [0x0000000000000634] 0000:0634 (unk. ctxt): jz .+25 (0x0000064f)      ; 7419<bochs:26> sNext at t=14090824(0) [0x0000000000000636] 0000:0636 (unk. ctxt): cmp byte ptr ds:[si], ch  ; 382c<bochs:27> sNext at t=14090825(0) [0x0000000000000638] 0000:0638 (unk. ctxt): jz .-10 (0x00000630)      ; 74f6<bochs:28> sNext at t=14090826(0) [0x0000000000000630] 0000:0630 (unk. ctxt): add si, 0x0010            ; 83c610<bochs:29> sNext at t=14090827(0) [0x0000000000000633] 0000:0633 (unk. ctxt): dec cx                    ; 49<bochs:30> sNext at t=14090828(0) [0x0000000000000634] 0000:0634 (unk. ctxt): jz .+25 (0x0000064f)      ; 7419<bochs:31> sNext at t=14090829(0) [0x0000000000000636] 0000:0636 (unk. ctxt): cmp byte ptr ds:[si], ch  ; 382c<bochs:32> sNext at t=14090830(0) [0x0000000000000638] 0000:0638 (unk. ctxt): jz .-10 (0x00000630)      ; 74f6<bochs:33> sNext at t=14090831(0) [0x0000000000000630] 0000:0630 (unk. ctxt): add si, 0x0010            ; 83c610<bochs:34> sNext at t=14090832(0) [0x0000000000000633] 0000:0633 (unk. ctxt): dec cx                    ; 49<bochs:35> sNext at t=14090833(0) [0x0000000000000634] 0000:0634 (unk. ctxt): jz .+25 (0x0000064f)      ; 7419<bochs:36> sNext at t=14090834(0) [0x0000000000000636] 0000:0636 (unk. ctxt): cmp byte ptr ds:[si], ch  ; 382c<bochs:37> sNext at t=14090835(0) [0x0000000000000638] 0000:0638 (unk. ctxt): jz .-10 (0x00000630)      ; 74f6<bochs:38> sNext at t=14090836(0) [0x0000000000000630] 0000:0630 (unk. ctxt): add si, 0x0010            ; 83c610<bochs:39> sNext at t=14090837(0) [0x0000000000000633] 0000:0633 (unk. ctxt): dec cx                    ; 49<bochs:40> sNext at t=14090838(0) [0x0000000000000634] 0000:0634 (unk. ctxt): jz .+25 (0x0000064f)      ; 7419<bochs:41> sNext at t=14090839(0) [0x000000000000064f] 0000:064f (unk. ctxt): mov byte ptr ss:[bp+16], cl ; 884e10<bochs:42> sNext at t=14090840(0) [0x0000000000000652] 0000:0652 (unk. ctxt): call .+70 (0x0000069b)    ; e84600<bochs:43> pNext at t=14092545(0) [0x0000000000000655] 0000:0655 (unk. ctxt): jnb .+42 (0x00000681)     ; 732a<bochs:44> sNext at t=14092546(0) [0x0000000000000681] 0000:0681 (unk. ctxt): cmp word ptr ds:0x7dfe, 0xaa55 ; 813efe7d55aa<bochs:45> sNext at t=14092547(0) [0x0000000000000687] 0000:0687 (unk. ctxt): jz .+11 (0x00000694)      ; 740b<bochs:46> sNext at t=14092548(0) [0x0000000000000694] 0000:0694 (unk. ctxt): mov di, sp                ; 8bfc<bochs:47> sNext at t=14092549(0) [0x0000000000000696] 0000:0696 (unk. ctxt): push ds                   ; 1e<bochs:48> sNext at t=14092550(0) [0x0000000000000697] 0000:0697 (unk. ctxt): push di                   ; 57<bochs:49> sNext at t=14092551(0) [0x0000000000000698] 0000:0698 (unk. ctxt): mov si, bp                ; 8bf5<bochs:50> sNext at t=14092552(0) [0x000000000000069a] 0000:069a (unk. ctxt): retf                      ; cb

里面有个call我直接跳过了,试着跟进去看了一下,实在是看不懂,而且代码和ida分析的完全不一样,放弃放弃,直接跳过,大体的思路还是出来了

原创粉丝点击