Hi,
compile first this code, under name: lok_dll.dll
format PE GUI 4.0 DLL
include '%fasminc%/win32a.inc'
section '.data' data readable writeable
check dd 0
napis db "\\.\mailslot\olal",0
entry EntryDLL
section '.code' code readable executable
proc EntryDLL ,a,b,c
enter
sub esp ,100
mov [esp] ,dword 'info'
mov [esp+4] ,dword '-loa'
mov [esp+8] ,dword 'ded!'
mov [esp+12],dword 0
invoke CreateMailslot,napis,0,0,0
cmp eax,-1
jne dalej
mov [esp+4] ,dword '-Fre'
mov [esp+8] ,dword 'e!!!'
mov [esp+12],dword 0
inc [check]
dalej:
lea eax ,[esp]
invoke MessageBox ,0,eax,eax,0
leave
ret
endp
proc alex,z
enter
return
endp
section '.idata' import data readable writeable
library user32, 'USER32.DLL',\
kernel, 'KERNEL32.DLL'
import user32,\
MessageBox, 'MessageBoxA'
import kernel,\
ExitProcess,'ExitProcess',\
CreateMailslot,'CreateMailslotA'
section '.edata' export data readable
export 'lok_dll.dll',\
alex,'alex'
section '.reloc' fixups data discardable
and then in the same directory plesae compile&run:
include '%fasminc%\win32ax.inc'
.code
start:
invoke LoadLibrary,"lok_dll.dll"
invoke ExitProcess,0
.end start
I dedicated the program to show when the system calls the dllentrypoint.
The result is the msgbox when library is loaded and the second one when is unloaded. The strange thing is the msgbox appearance.
why the both msgboxes have different frames?
regards,
h