Return from DllEntryPoint and return value

Bare metal programming in PureBasic, for experienced users
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5353
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Return from DllEntryPoint and return value

Post by Kwai chang caine »

Hello at all

There are numerous day, i need a code for forcing a DLL to exit.
FREAK give to me this cool code, for put it in the AtachProcess, like this i can control a password for all the DLL
If the password not good, i use this code and VB6 cannot found the DLL 8)

Code: Select all

!ADD esp, 8     ; remove Instance variable and return address from stack 
!MOV eax, 0     ; set returnvalue to 0 
!RET 12         ; return from DllEntryPoint 
That's works great, but is it possible to return a value in the same time ??
The problem is that VB6 not do the difference between this code ASM and really not found the DLL :(

It's the reason why, i say to me : Is it possible to return an integer value ?
Like this i can detect if the return come of the ASM code, or just VB6 really not found the DLL

Thanks and good day
ImageThe happiness is a road...
Not a destination