win7 sp1 mbr.asm

来源:互联网 发布:股票交易模拟软件 编辑:程序博客网 时间:2024/06/05 19:04

看到的记录

; Input MD5   : 526310D6B6734D0959C7ECFD0BF97E0D; Input CRC32 : 0F847F65; Load in 0000h:7C00h; ss:sp = 0000h:0400h, ds = 0040h (BIOS  data area); Memory layout:; 0000:0000 - 0000:0FFF: Interrupt vector table & BIOS data; 0000:1000 - 0000:6FFF: Real mode stack area; 0000:7000 - 0000:7FFF: Cmdline (multiboot); 0000:8000 - xxxx:xxxx: FreeLoader program & data area; xxxx:xxxx - 7000:7FFF: Random memory allocation heap; 7000:8000 - 7000:FFFF: Protected mode stack area; 8000:0000 - 8000:FFFF: File system read buffer; 9000:0000 - 9000:FFFF: Disk read buffer for BIOS Int 13h; A000:0000 - FFFF:FFFF: reservedorg 7c00h0600                 xor     ax, ax                ; ax = 00602                 mov     ss, ax                ; ss = 00604                 mov     sp, 7C00h             ; sp = 7C00h0607                 mov     es, ax                ; es = 00609                 mov     ds, ax                ; ds = 0060B                 mov     si, 7C00h             ; si = 7C00h060E                 mov     di, 600h              ; di = 600h0611                 mov     cx, 200h              ; cx = 200h0614                 cld                           ; df = 00615                 rep movsb                     ; ds:si = es:di0617                 push    ax0618                 push    61Ch                  ; jump to 61Ch061B                 retf      ; ---------------------------------------------------------------------------061C                 sti                           ; df = 1061D                 mov     cx, 4                 ; cx = 40620                 mov     bp, 7BEh              ; bp = 7BEh0623      ;    0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15      ;    BI SH SS SC ID EH ES EC L0 L1 L2 L3 S0 S1 S2 S3      ;1BE 00 20 21 00 07 AA 28 82 00 08 00 00 00 00 20 00      ;1CE 80 AA 29 82 07 FE FF FF 00 08 20 00 00 28 80 07      ;1DE 00 FE FF FF 0F FE FF FF 00 38 A0 07 00 A8 A2 1D      ;1EE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00      ;1FE 55 AA0623 _CheckPTBHead:                                ; CODE XREF: seg000:0630j0623                 cmp     byte ptr [bp+0], 00627                 jl      short loc_634         ; if bp < 0 jmp 6340629                 jnz     _InvalidPTB           ; if bp != 0 jmp _InvalidPTB062D                 add     bp, 10h               ; bp += 10h0630                 loop    _CheckPTBHead               ; loop0632                 int     18h                   ; TRANSFER TO ROM BASIC0632                                               ; causes transfer to ROM-based BASIC (IBM-PC)0632                                               ; often reboots a compatible      ; often has no effect at all06340634 loc_634:                                      ; CODE XREF: seg000:0627j0634                                               ; seg000:06AEj0634                 mov     [bp+0], dl0637                 push    bp0638                 mov     byte ptr [bp+11h], 5063C                 mov     byte ptr [bp+10h], 00640                 mov     ah, 41h0642                 mov     bx, 55AAh0645                 int     13h                   ; DISK - Check for INT 13h Extensions0645                                               ; BX = 55AAh, DL = drive number0645                                               ; Return: CF set if not supported0645                                               ; AH = extensions version0645                                               ; BX = AA55h0645                                               ; CX = Interface support bit map0647                 pop     bp0648                 jb      short loc_659064A                 cmp     bx, 0AA55h064E                 jnz     short loc_6590650                 test    cx, 10654                 jz      short loc_6590656                 inc     byte ptr [bp+10h]06590659 loc_659:                                      ; CODE XREF: seg000:0648j0659                                               ; seg000:064Ej ...0659                 pushad065B                 cmp     byte ptr [bp+10h], 0065F                 jz      short loc_6870661                 push    large 00667                 push    large dword ptr [bp+8]066B                 push    0066E                 push    7C00h0671                 push    10674                 push    10h0677                 mov     ah, 42h0679                 mov     dl, [bp+0]067C                 mov     si, sp067E                 int     13h                   ; DISK - IBM/MS Extension - EXTENDED READ (DL - drive, DS:SI - disk address packet)0680                 lahf0681                 add     sp, 10h0684                 sahf0685                 jmp     short loc_69B0687       ; ---------------------------------------------------------------------------06870687 loc_687:                                      ; CODE XREF: seg000:065Fj0687                 mov     ax, 201h068A                 mov     bx, 7C00h068D                 mov     dl, [bp+0]0690                 mov     dh, [bp+1]0693                 mov     cl, [bp+2]0696                 mov     ch, [bp+3]0699                 int     13h                   ; DISK - READ SECTORS INTO MEMORY0699                                               ; AL = number of sectors to read, CH = track, CL = sector0699                                               ; DH = head, DL = drive, ES:BX -> buffer to fill0699                                               ; Return: CF set on error, AH = status, AL = number of sectors read069B069B loc_69B:                                      ; CODE XREF: seg000:0685j069B                 popad069D                 jnb     short loc_6BB069F                 dec     byte ptr [bp+11h]06A2                 jnz     short loc_6B006A4                 cmp     byte ptr [bp+0], 80h06A8                 jz      _ErrorLoadingOS06AC                 mov     dl, 80h06AE                 jmp     short loc_63406B0       ; ---------------------------------------------------------------------------06B006B0 loc_6B0:                                      ; CODE XREF: seg000:06A2j06B0                 push    bp06B1                 xor     ah, ah06B3                 mov     dl, [bp+0]06B6                 int     13h                   ; DISK - RESET DISK SYSTEM06B6                                               ; DL = drive (if bit 7 is set both hard disks and floppy disks reset)06B8                 pop     bp06B9                 jmp     short loc_65906BB       ; ---------------------------------------------------------------------------06BB06BB loc_6BB:                                      ; CODE XREF: seg000:069Dj06BB                 cmp     word ptr ds:7DFEh, 0AA55h06C1                 jnz     short _MissingOS06C3                 push    word ptr [bp+0]06C6                 call    sub_75606C9                 jnz     short loc_6E206CB                 cli06CC                 mov     al, 0D1h06CE                 out     64h, al               ; 8042 keyboard controller command register.06CE                                               ; Write output port (next byte to port 60h):06CE                                               ; 7:  1=keyboard data line pulled low (inhibited)06CE                                               ; 6:  1=keyboard clock line pulled low (inhibited)06CE                                               ; 5:  enables IRQ 12 interrupt on mouse IBF06CE                                               ; 4:  enables IRQ 1 interrupt on keyboard IBF06CE                                               ; 3:  1=mouse clock line pulled low (inhibited)06CE                                               ; 2:  1=mouse data line pulled low (inhibited)06CE                                               ; 1:  A20 gate on/off06CE                                               ; 0:  reset the PC (THIS BIT SHOULD ALWAYS BE SET TO 1)06D0                 call    sub_75606D3                 mov     al, 0DFh06D5                 out     60h, al               ; 8042 keyboard controller data register.06D7                 call    sub_75606DA                 mov     al, 0FFh06DC                 out     64h, al               ; 8042 keyboard controller command register.06DC                                               ; Pulse output port.06DC                                               ; Bits 0-3 indicate ports to pulse.06DE                 call    sub_75606E1                 sti06E206E2 loc_6E2:                                      ; CODE XREF: seg000:06C9j06E2                 mov     ax, 0BB00h06E5                 int     1Ah                   ; Trusted Computing Group call - TCG_StatusCheck06E5                                               ; Return: EAX = 0 if supported06E5                                               ; EBX = 41504354h ('TCPA')06E5                                               ; CH:CL = TCG BIOS Version06E5                                               ; EDX = BIOS TCG Feature Flags06E5                                               ; ESI = Pointer to Event Log06E5                                               ;06E7                 and     eax, eax06EA                 jnz     short loc_72706EC                 cmp     ebx, 41504354h06F3                 jnz     short loc_72706F5                 cmp     cx, 102h06F9                 jb      short loc_72706FB                 push    large 0BB07h0701                 push    large 200h0707                 push    large 8070D                 push    ebx070F                 push    ebx0711                 push    ebp0713                 push    large 00719                 push    large 7C00h071F                 popad0721                 push    00724                 pop     es0725                 int     1Ah                   ; Trusted Computing Group call - TCG_StatusCheck0725                                               ; Return: EAX = 0 if supported0725                                               ; EBX = 41504354h ('TCPA')0725                                               ; CH:CL = TCG BIOS Version0725                                               ; EDX = BIOS TCG Feature Flags0725                                               ; ESI = Pointer to Event Log0725                                               ;07270727 loc_727:                                      ; CODE XREF: seg000:06EAj0727                                               ; seg000:06F3j ...0727                 pop     dx0728                 xor     dh, dh072A                 jmp     far ptr 0:7C00h072F       ; ---------------------------------------------------------------------------072F                 int     18h                   ; TRANSFER TO ROM BASIC072F                                               ; causes transfer to ROM-based BASIC (IBM-PC)072F                                               ; often reboots a compatible      ; often has no effect at all0731       ; Missing operating system0731 _MissingOS:                                   ; CODE XREF: seg000:06C1j0731                 mov     al, ds:byte_7B7       ; al = 9Ah0734                 jmp     short _ShowMessage0736       ; ---------------------------------------------------------------------------0736       ; Error loading operating system0736 _ErrorLoadingOS:                              ; CODE XREF: seg000:06A8j0736                 mov     al, ds:byte_7B6       ; al = 7Bh0739                 jmp     short _ShowMessage073B       ; ---------------------------------------------------------------------------073B       ; Invalid partition table073B _InvalidPTB:                                  ; CODE XREF: seg000:0629j ax = 0073B                 mov     al, ds:byte_7B5       ; al = 63h073E073E _ShowMessage:                                      ; CODE XREF: seg000:0734j073E                                               ; seg000:0739j073E                 xor     ah, ah                ; ah = 00740                 add     ax, 700h              ; ax = al + 700h0743                 mov     si, ax                ; si = ax07450745 _DisplayMessage:                              ; CODE XREF: seg000:0751j0745                 lodsb0746                 cmp     al, 00748                 jz      short _Halt074A                 mov     bx, 7074D                 mov     ah, 0Eh074F                 int     10h                   ; - VIDEO - WRITE CHARACTER AND ADVANCE CURSOR (TTY WRITE)074F                                               ; AL = character, BH = display page (alpha modes)074F                                               ; BL = foreground color (graphics modes)0751                 jmp     short _DisplayMessage0753       ; ---------------------------------------------------------------------------07530753 _Halt:                                        ; CODE XREF: seg000:0748j0753                                               ; seg000:0754j0753                 hlt0754       ; ---------------------------------------------------------------------------0754                 jmp     short _Halt07560756       ; =============== S U B R O U T I N E =======================================075607560756 sub_756         proc near                     ; CODE XREF: seg000:06C6p0756                                               ; seg000:06D0p ...0756                 sub     cx, cx07580758 loc_758:                                      ; CODE XREF: sub_756+8j0758                 in      al, 64h               ; 8042 keyboard controller status register0758                                               ; 7:  PERR    1=parity error in data received from keyboard0758                                               ;    +----------- AT Mode ----------+------------ PS/2 Mode ------------+0758                                               ; 6: |RxTO    receive (Rx) timeout  | TO      general timeout (Rx or Tx)|0758                                               ; 5: |TxTO    transmit (Tx) timeout | MOBF    mouse output buffer full  |0758                                               ;    +------------------------------+-----------------------------------+0758                                               ; 4:  INH     0=keyboard communications inhibited0758                                               ; 3:  A2      0=60h was the port last written to, 1=64h was last0758                                               ; 2:  SYS     distinguishes reset types: 0=cold reboot, 1=warm reboot0758                                               ; 1:  IBF     1=input buffer full (keyboard can't accept data)0758                                               ; 0:  OBF     1=output buffer full (data from keyboard is available)075A                 jmp     short $+2075C                 and     al, 2075E                 loopne  loc_7580760                 and     al, 20762                 retn0762 sub_756         endp07620762       ; ---------------------------------------------------------------------------0763                 db  49h       ; I Invalid partition table0764                 db  6Eh       ; n0765                 db  76h       ; v0766                 db  61h       ; a0767                 db  6Ch       ; l0768                 db  69h       ; i0769                 db  64h       ; d076A                 db  20h076B                 db  70h       ; p076C                 db  61h       ; a076D                 db  72h       ; r076E                 db  74h       ; t076F                 db  69h       ; i0770                 db  74h       ; t0771                 db  69h       ; i0772                 db  6Fh       ; o0773                 db  6Eh       ; n0774                 db  20h0775                 db  74h       ; t0776                 db  61h       ; a0777                 db  62h       ; b0778                 db  6Ch       ; l0779                 db  65h       ; e077A                 db    0077B                 db  45h       ; E Error loading operating system077C                 db  72h       ; r077D                 db  72h       ; r077E                 db  6Fh       ; o077F                 db  72h       ; r0780                 db  20h0781                 db  6Ch       ; l0782                 db  6Fh       ; o0783                 db  61h       ; a0784                 db  64h       ; d0785                 db  69h       ; i0786                 db  6Eh       ; n0787                 db  67h       ; g0788                 db  20h0789                 db  6Fh       ; o078A                 db  70h       ; p078B                 db  65h       ; e078C                 db  72h       ; r078D                 db  61h       ; a078E                 db  74h       ; t078F                 db  69h       ; i0790                 db  6Eh       ; n0791                 db  67h       ; g0792                 db  20h0793                 db  73h       ; s0794                 db  79h       ; y0795                 db  73h       ; s0796                 db  74h       ; t0797                 db  65h       ; e0798                 db  6Dh       ; m0799                 db    0079A                 db  4Dh       ; M Missing operating system079B                 db  69h       ; i079C                 db  73h       ; s079D                 db  73h       ; s079E                 db  69h       ; i079F                 db  6Eh       ; n07A0                 db  67h       ; g07A1                 db  20h07A2                 db  6Fh       ; o07A3                 db  70h       ; p07A4                 db  65h       ; e07A5                 db  72h       ; r07A6                 db  61h       ; a07A7                 db  74h       ; t07A8                 db  69h       ; i07A9                 db  6Eh       ; n07AA                 db  67h       ; g07AB                 db  20h07AC                 db  73h       ; s07AD                 db  79h       ; y07AE                 db  73h       ; s07AF                 db  74h       ; t07B0                 db  65h       ; e07B1                 db  6Dh       ; m07B2                 db    007B3                 db    007B4                 db    007B5 byte_7B5        db 63h                        ; DATA XREF: seg000:_InvalidPTBr07B6 byte_7B6        db 7Bh                        ; DATA XREF: seg000:_ErrorLoadingOSr07B7 byte_7B7        db 9Ah                        ; DATA XREF: seg000:_MissingOSr07B8                 db    007B9                 db    007BA                 db    007BB                 db    007BC                 db    007BD                 db    007BE                 db    0       ; partition 107BF                 db    007C0                 db    007C1                 db    007C2                 db    007C3                 db    007C4                 db    007C5                 db    007C6                 db    007C7                 db    007C8                 db    007C9                 db    007CA                 db    007CB                 db    007CC                 db    007CD                 db    007CE                 db    0       ; partition 207CF                 db    007D0                 db    007D1                 db    007D2                 db    007D3                 db    007D4                 db    007D5                 db    007D6                 db    007D7                 db    007D8                 db    007D9                 db    007DA                 db    007DB                 db    007DC                 db    007DD                 db    007DE                 db    0       ; partition 307DF                 db    007E0                 db    007E1                 db    007E2                 db    007E3                 db    007E4                 db    007E5                 db    007E6                 db    007E7                 db    007E8                 db    007E9                 db    007EA                 db    007EB                 db    007EC                 db    007ED                 db    007EE                 db    0       ; partition 407EF                 db    007F0                 db    007F1                 db    007F2                 db    007F3                 db    007F4                 db    007F5                 db    007F6                 db    007F7                 db    007F8                 db    007F9                 db    007FA                 db    007FB                 db    007FC                 db    007FD                 db    007FE                 db  55h07FF                 db 0AAh07FF                 end
原创粉丝点击