有什么意义吗? 我手头有一个DLL 只有3072字节。你可以看看它的代码,什么用也没有,却是一个
真正的DLL。
.386
.model flat,stdcall
option casemap:none
include /masm32/include/windows.inc
include /masm32/include/user32.inc
include /masm32/include/kernel32.inc
includelib /masm32/lib/user32.lib
includelib /masm32/lib/kernel32.lib
.data
AppName db "DLL Skeleton",0
HelloMsg db "这是DLL 里的输出函数,外部程序在调用它。",0
LoadMsg db "系统在装载DLL。。。",13,"响应reason值DLL_PROCESS_DETACH",13,"----注释",0
UnloadMsg db "系统在卸载DLL",13,"DLL作出响应。",13,"响应reason值DLL_PROCESS_DETACH",0
ThreadCreated db "A thread is created in this process",13,"响应reason值DLL_THREAD_ATTACH",0
ThreadDestroyed db "A thread is destroyed in this process",13,"响应reason值DLL_THREAD_DEATTACH",0
.code
DllEntry proc hInstance:HINSTANCE, reason
WORD, reserved1
WORD
.if reason==DLL_PROCESS_ATTACH
invoke MessageBox,NULL,addr LoadMsg,addr AppName,MB_OK
.elseif reason==DLL_PROCESS_DETACH
invoke MessageBox,NULL,addr UnloadMsg,addr AppName,MB_OK
.elseif reason==DLL_THREAD_ATTACH
invoke MessageBox,NULL,addr ThreadCreated,addr AppName,MB_OK
.else ; DLL_THREAD_DETACH
invoke MessageBox,NULL,addr ThreadDestroyed,addr AppName,MB_OK
.endif
mov eax,TRUE
ret
DllEntry Endp
TestHello proc
invoke MessageBox,NULL,addr HelloMsg,addr AppName,MB_OK
ret
TestHello endp
End DllEntry