I think I have all the info I need to make a nice little protection scheme. Thank you to everyone that contributed code. It is really cool to have such a wealth of experience available.
The final chapter (you all hope and pray!) of this oddesy has to do with what Scott said:
snip:
Guys, all of this is interesting but if you do ANYTHING in your code like this:
lReg = CheckifRegistered(blah blah)
Any good cracker is going to make a crack, a ONE time SIMPLE JMP command to BYPASS that and set a flag to 1.
So in my code I have:
IF TodaysDate > ExpDate THEN
MSGBOX "This program has expired"
EXIT FUNCTION
END IF
If I were a craker, I would look for the last conditional statement and jump over it with my first attempt or in this case:
IF TodaysDate > ExpDate THEN
MSGBOX "This program has expired"
EXIT FUNCTION
ELSE
'rest of my progam
'
'
END IF
THe second attempt would be to switch the outcome of the conditional statement to the ELSE portion
SO,
How about using SELECT instead:
'----------------------------------------------------
FUNCTION Bogus() AS LONG
FOR i = 1 TO 100
Result = Encrypt(nonsense) ' some fast long winded procedure with a few conditional statements
FOR j = 1 TO 100000
IF Result = 42 THEN
Var1 = 42
END IF
NEXT j
NEXT i
'---------------------------------------------------
FUNCTION PBMAIN
'
' beginning code
'
'
SELECT CASE TodaysDate ' or NumLaunches or some other criteria that changes each time an attempted launch is made
'
' more case statements befor
'
CASE ExpDate - 5
CALL Bogus ' execute alot of conditional statements to cloud the trail
CALL MainCode ' function containing the main code of the app
CASE ExpDate - 4
CALL Bogus
CALL MainCode
CASE ExpDate - 3
CALL Bogus
CALL MainCode
CASE ExpDate - 2
CALL Bogus
CALL MainCode
CASE ExpDate - 1
CALL Bogus
CALL MainCode
CASE ExpDate
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 1
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 2
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 3
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 4
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 5
CALL Bogus
EXIT FUNCTION
'
' and so on
'
'
END SELECT
'
'
'
END FUNCTION
'-------------------------------------------------------------------------------
Can anyone see if this would this be as easy to jump over or around ?
------------------
Kind Regards
Mike
The final chapter (you all hope and pray!) of this oddesy has to do with what Scott said:
snip:
Guys, all of this is interesting but if you do ANYTHING in your code like this:
lReg = CheckifRegistered(blah blah)
Any good cracker is going to make a crack, a ONE time SIMPLE JMP command to BYPASS that and set a flag to 1.
So in my code I have:
IF TodaysDate > ExpDate THEN
MSGBOX "This program has expired"
EXIT FUNCTION
END IF
If I were a craker, I would look for the last conditional statement and jump over it with my first attempt or in this case:
IF TodaysDate > ExpDate THEN
MSGBOX "This program has expired"
EXIT FUNCTION
ELSE
'rest of my progam
'
'
END IF
THe second attempt would be to switch the outcome of the conditional statement to the ELSE portion
SO,
How about using SELECT instead:
'----------------------------------------------------
FUNCTION Bogus() AS LONG
FOR i = 1 TO 100
Result = Encrypt(nonsense) ' some fast long winded procedure with a few conditional statements
FOR j = 1 TO 100000
IF Result = 42 THEN
Var1 = 42
END IF
NEXT j
NEXT i
'---------------------------------------------------
FUNCTION PBMAIN
'
' beginning code
'
'
SELECT CASE TodaysDate ' or NumLaunches or some other criteria that changes each time an attempted launch is made
'
' more case statements befor
'
CASE ExpDate - 5
CALL Bogus ' execute alot of conditional statements to cloud the trail
CALL MainCode ' function containing the main code of the app
CASE ExpDate - 4
CALL Bogus
CALL MainCode
CASE ExpDate - 3
CALL Bogus
CALL MainCode
CASE ExpDate - 2
CALL Bogus
CALL MainCode
CASE ExpDate - 1
CALL Bogus
CALL MainCode
CASE ExpDate
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 1
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 2
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 3
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 4
CALL Bogus
EXIT FUNCTION
CASE ExpDate + 5
CALL Bogus
EXIT FUNCTION
'
' and so on
'
'
END SELECT
'
'
'
END FUNCTION
'-------------------------------------------------------------------------------
Can anyone see if this would this be as easy to jump over or around ?
------------------
Kind Regards
Mike
Comment