stub.asm

来自「Windows PE 文件在 DOS 下运行一般会显示:This program」· 汇编 代码 · 共 34 行

ASM
34
字号
;stub.asm
dos_header: 
    e_magic     dw "MZ"
    e_cblp      dw 0x0090
    e_cp        dw 0x0001
    e_crlc      dw 0x0000
    e_cparhdr   dw 0x0004
    e_minalloc  dw 0x0010
    e_maxalloc  dw 0xFFFF
    e_ss        dw 0x0000
    e_sp        dw 0x00b8
    e_csum      dw 0x0000
    e_ip        dw 0x0000
    e_cs        dw 0x0000
    e_lfarlc    dw dos_stub
    e_ovno      dw 0x0000
    e_res       rw 4
    e_oemid     dw 0x0000
    e_oeminfo   dw 0x0000
    e_res2      rw 10
    e_lfanew    dd PE_header
dos_stub:
    push cs
    pop  ds
    mov  dx, msg-dos_stub
    mov  ah, 0x09
    int  0x21
    mov  ax, 0x4C01
    int  0x21
;Put our string here
    msg  db 'This program cannot be run in DOS mode.',0x0d,0x0d,0x0a,'$'
PE_header:
;End of source code

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?