DLL 源码如下:
- format PE GUI 4.0 DLL
- entry DllEntryPoint
- include 'win32a.inc'
- section '.data' readable executable
- _cmd_open db 'open cdaudio',0
- _cmd_eject db 'set cdaudio door open',0
- _cmd_play db 'play cdaudio',0
- _cmd_stop db 'stop cdaudio',0
- _cmd_close db 'close cdaudio',0
- section '.code' code readable executable
- proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
- mov eax, TRUE
- ret
- endp
- proc Eject
- invoke mciSendString,_cmd_open,0,0,0
- invoke mciSendString,_cmd_eject,0,0,0
- invoke mciSendString,_cmd_close,0,0,0
- ret
- endp
- proc Play
- ;invoke mciSendString,_cmd_open,0,0,0
- invoke mciSendString,_cmd_play,0,0,0
- ret
- endp
- proc Stop
- invoke mciSendString,_cmd_stop,0,0,0
- ;invoke mciSendString,_cmd_close,0,0,0
- ret
- endp
- section '.idata' import data readable writeable
- library kernel32,'KERNEL32.DLL',\
- user32,'USER32.DLL',\
- winmm,'WINMM.DLL'
- import kernel32,\
- ExitProcess,'ExitProcess'
- import user32,\
- MessageBoxA,'MessageBoxA'
- import winmm,\
- mciSendString,'mciSendStringA'
- section '.edata' export data readable
- export 'CDTRAY.DLL',\
- Eject, 'Eject',\
- Play, 'Play',\
- Stop, 'Stop'
- section '.reloc' fixups data readable discardable
- if $=$$
- dd 0,8 ; if there are no fixups, generate dummy entry
- end if
-
复制代码 |
|