Code : Tout sélectionner
ProcedureDLL AttachProcess(Instance)
EndProcedure
; Called when the program release (free) the DLL
;
ProcedureDLL DetachProcess(Instance)
EndProcedure
; Both are called when a thread in a program call or release (free) the DLL
;
ProcedureDLL AttachThread(Instance)
EndProcedure
ProcedureDLL DetachThread(Instance)
EndProcedure
; Real code start here..
;
Global encrypt$ = ""
Global version.l = 1
Global decrypt$ = ""
ProcedureDLL.l About()
ProcedureReturn version.l
EndProcedure
ProcedureDLL.s Encrypt(str$, len)
For x = 1 To len
char$ = Mid(str$, x, 1)
ascii = Asc(char$)
ascii = ascii + 57
xchar$ = Chr(ascii)
encrypt$ = encrypt$+xchar$
Next x
ProcedureReturn encrypt$
EndProcedure
ProcedureDLL.s Decrypt(xstr$, len)
For x = 1 To len
xchar$ = Mid(xstr$, x, 1)
ascii = Asc(xchar$)
ascii = Int(Abs(ascii - 57))
char$ = Chr(ascii)
decrypt$ = decrypt$+char$
Next x
ProcedureReturn decrypt$
EndProcedure
If OpenLibrary(0, "MOW.dll")
CallFunction(0, "About")
CallFunction(0, "Encrypt", str$)
CallFunction(0, "Decrypt", xstr$)
CloseLibrary(0)
EndIf
Merci d'avance
