Hi, because VB6 is a bit dodgy I need to write a launcher program for a "Blitz game" that does not use VB6.
I've tried the demo of PB to see if PB can use asprotect... this is what I have done but It dont work.. probably cus i've done it wrong. I've seen a few posts about asprotect and from what I've read PB can be protected with ASProtect.
The problem here is not ASProtect but the fact you are using CallFunction wrong.
The parameters used in CallFunction are for sending variables to the DLL. The result returned is a variable or a pointer to a variable or memory address containing any returned data.
Syntax
Result = CallFunction(#Library, FunctionName$ [,Parameter1 [, Parameter2...]])
Read help file for more details (under Library command)
; VB declares
; Declare Function apiGetRegistrationBuffer Lib "asprotect.dll" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
; Declare Function apiGetHardwareID Lib "asprotect.dll" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
; Declare Function apiGetTrialDays Lib "asprotect.dll" () As Long
; Declare Function apiGetTrialExecs Lib "asprotect.dll" () As Long
MessageRequester("Test","Info",0)
lib=OpenLibrary(0,"c:\programme\asprotect\asprotect.dll")
If lib
apiGetTrialExecs=IsFunction(0,"apiGetTrialExecs")
apiGetTrialDays=IsFunction(0,"apiGetTrialDays")
apiGetHardwareID=IsFunction(0,"apiGetHardwareID")
If apiGetTrialDays
result=CallFunctionFast(apiGetTrialDays)
MessageRequester("Test apiGetTrialDays",Str(result),0)
EndIf
If apiGetTrialExecs
result=CallFunctionFast(apiGetTrialExecs)
MessageRequester("Test apiGetTrialExecs",Str(result),0)
EndIf
If apiGetHardwareID
HardwareKey.s = Space(255) ;String$(255, 0)
LenGetHardwareKey = CallFunctionFast( apiGetHardwareID,HardwareKey )
MessageRequester("Test apiGetHardwareID",Left(HardwareKey.s,LenGetHardwareKey ),0);
EndIf
CloseLibrary(0)
Else
MessageRequester("Test","DLL ?",0)
EndIf
coffeebean wrote:Thanks 4 all your help.... did that work for you... it didn't work for me. :roll:
I protected the exe with 30 days trial and 42 executes. (using trial version of asprotect also).
It returned -1 days, -1 executes and the hardware key was "123456789".
Im using the Demo version of PB 3.90... dont know if thats the problem.
i have exactly the same results.
For more Info you should contact 'ASProtect's service i think.(send them these files, they can evaluate it with the Demo-version)
It has nothing to do that you are evaluating the DEMO-version of Purebasic.
To work with these functions while developing the application ASProtect.dll is used. It replaces protection functions when the application is not processed by ASProtect.
Asprotect.dll uses asprotect.ini file, in which you can specify different parameters of protection for debugging puproses.
When processing the application with ASProtect all calls to ASProtect.dll are replaced with internal function calls and including of ASProtect.dll to the final distribution is not required.
When using the .ini file the values returned are correct but after running ASProtect on the file the calls to the dll should be replaced, but it looks like they are not when using PureBasic. I've emailed their support to see if they can help.
Does anyone use ASProtect successfully with PureBasic? If so could you give some examples please?