Author Topic: can increase the difficulty ?  (Read 3055 times)

0 Members and 1 Guest are viewing this topic.

77077

  • Guest
can increase the difficulty ?
« on: July 20, 2015, 01:19:14 PM »
Establishes authorization of our routines.

Sometimes ,I see Some .Vlx programs require authorization to run ,e.g CAD_KITS

Usually, password is encrypt from  MAC address or user name  etc.

This is a simple example
Code - Auto/Visual Lisp: [Select]
  1. (defun Register(/ bb dcl_re f fname fsys jqm n zcm)
  2.   (defun jy (jqm)    
  3.   (itoa (fix (expt (+ (atoi jqm) 144356842) 0.89))))
  4.   (setq fsys (vlax-create-object "Scripting.FileSystemObject"))
  5.   (if (/= (vlax-invoke-method fsys "DriveExists" "C") :vlax-false)
  6.   (setq jqm (itoa (vlax-get-property (vlax-invoke-method fsys "GetDrive" "C") "SerialNumber"))))
  7.   (setq zcm (vl-registry-read "HKEY_CURRENT_USER\\Software\\mytools\\" "Number"))
  8.   (if (/= zcm (jy jqm))
  9.     (progn
  10.       (setq fname (vl-filename-mktemp "zhuc.dcl") f (open fname "w"))
  11.       (write-line "zhuc:dialog{ label=\"Register info\";" f)
  12.       (write-line ":edit_box{label=\" Request\";key=\"e01\";edit_width=18;}" f)
  13.       (write-line ":edit_box{label=\" Activation\";key=\"e02\";edit_width=18;}" f)
  14.       (write-line ":row{:button {label=\"OK\";key=\"e03\";is_default=true;}" f)
  15.       (write-line ":button {label=\"Cancel\";is_cancel=true;}}}" f)
  16.       (close f)
  17.       (new_dialog "zhuc" (setq dcl_re (load_dialog fname)))
  18.       (set_tile "e01" jqm)
  19.       (set_tile "e02" "CAD-tools")
  20.       (action_tile "e03" "(setq zcm  (get_tile \"e02\")) (done_dialog 1)")
  21.       (if (= (start_dialog) 1)(vl-registry-write "HKEY_CURRENT_USER\\software\\mytools\\" "Number" zcm))
  22.       (unload_dialog dcl_re)
  23.       (vl-file-delete fname)
  24.       (if (/= zcm (jy jqm))
  25. (progn  (alert "Register failed !") (exit))
  26. (alert "Register successfully!"))))
  27.   (princ)
  28. )
  29.  
use for our routine like this.

Code - Auto/Visual Lisp: [Select]
  1. ;;http://www.theswamp.org/index.php?topic=47781.msg527933#msg527933
  2. (defun c:addlengths (/ _getlength i n)
  3.   (Register);;put in here
  4.   (defun _getlength (ename / ep)
  5.     (if (vl-catch-all-error-p (setq ep (vl-catch-all-apply 'vlax-curve-getendparam (list ename))))
  6.       0.0
  7.       (vlax-curve-getdistatparam ename ep)
  8.     )
  9.   )
  10.   (if (setq ss (ssget '((0 . "ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE"))))
  11.     (progn (setq n 0)
  12.            (repeat (setq i (sslength ss)) (setq n (+ n (_getlength (ssname ss (setq i (1- i)))))))
  13.            (alert (vl-princ-to-string n))
  14.     )
  15.   )
  16.   (princ)
  17. )
  18.  

package : Register.fas + addlengths.fas  ==> mytools.vlx
 
Now ,The question is :
 
 Can use WINHEX easy revert to  Register.fas + addlengths.fas

 So ,Create a new lisp :
Code - Auto/Visual Lisp: [Select]
  1. (defun Register ()
  2.   (princ "\nThat's easy!")
  3.   )
  4.  
Make this lisp to Register.fas
 Than package this Register.fas and addlengths.fas to mytools.vlx
 SO.....Cracked Simply .
 
How to increase the difficulty .

 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?

Any advice  ? Thanks a lot.
« Last Edit: July 20, 2015, 08:12:17 PM by ANJALI »

ChrisCarlson

  • Guest
Re: can increase the difficulty ?
« Reply #1 on: July 20, 2015, 01:23:57 PM »
So you want to make a "harder" form of registration? Does it need to be local only? Have you looked into remote auth?

77077

  • Guest
Re: can increase the difficulty ?
« Reply #2 on: July 20, 2015, 01:27:51 PM »
So you want to make a "harder" form of registration? Does it need to be local only? Have you looked into remote auth?

local only .no need remote.


 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: can increase the difficulty ?
« Reply #3 on: July 20, 2015, 01:43:29 PM »
So you want to make a "harder" form of registration? Does it need to be local only? Have you looked into remote auth?

local only .no need remote.


 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?
Compile your code.


You can also call it like so, but IMO does not do much other than make it not blatantly apparent what's running ... also throws a red flag for anyone that has half decent coding skills.
Code - Auto/Visual Lisp: [Select]
  1. (eval (read (apply 'strcat (mapcar 'chr '(40 114 101 103 105 115 116 101 114 41)))))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: can increase the difficulty ?
« Reply #4 on: July 20, 2015, 01:59:30 PM »
How to increase the difficulty .

 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?

Any advice  ? Thanks a lot.
(defun c:addlengths (/ _getlength i n Register)
  (defun Register......)
  (Register);;
)

77077

  • Guest
Re: can increase the difficulty ?
« Reply #5 on: July 20, 2015, 09:02:36 PM »
So you want to make a "harder" form of registration? Does it need to be local only? Have you looked into remote auth?

local only .no need remote.


 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?
Compile your code.


You can also call it like so, but IMO does not do much other than make it not blatantly apparent what's running ... also throws a red flag for anyone that has half decent coding skills.
Code - Auto/Visual Lisp: [Select]
  1. (eval (read (apply 'strcat (mapcar 'chr '(40 114 101 103 105 115 116 101 114 41)))))

ronjonp , I'm so sorry . I just wanted to give an example. I  forget to remark .Regret .Now I change the that...

Thanks you for your advice .
But the question remains,
Code - Auto/Visual Lisp: [Select]
  1. (defun c:test ()
  2.  (eval (read (apply 'strcat (mapcar 'chr '(40 114 101 103 105 115 116 101 114 41)))));;put here
  3.  .....
  4.   here is your routine....
  5.  

Just As Mentioned Above. (OP)
Can use WINHEX easy revert to  Register.fas + test.fas
So, appload test.fas and call command "test" ,It will return :error: no function definition: REGISTER

So ,can create a new lisp ,and compile to Register.fas
Code - Auto/Visual Lisp: [Select]
  1. (defun Register ()
  2.   (princ "\nThat's easy!")
  3.   )
  4.  

use this  Register.fas  replace our Register.fas............SO.....Cracked Simply .






ronjonp

  • Needs a day job
  • Posts: 7529
Re: can increase the difficulty ?
« Reply #6 on: July 20, 2015, 09:12:49 PM »
No worries :). .. I think vovka answered you ?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

77077

  • Guest
Re: can increase the difficulty ?
« Reply #7 on: July 20, 2015, 09:14:33 PM »
How to increase the difficulty .

 (defun c:addlengths (/ _getlength i n)
  (Register);;Here is too simple ,can increase the difficulty ?

Any advice  ? Thanks a lot.
(defun c:addlengths (/ _getlength i n Register)
  (defun Register......)
  (Register);;
)



VovKa.
You are right . If can do this, of course, it is the best. But,

our Register routine is very big . maybe 20~30kb . then Each routine need add in ?


77077

  • Guest
Re: can increase the difficulty ?
« Reply #8 on: July 20, 2015, 09:55:01 PM »
No worries :). .. I think vovka answered you ?

Hi ronjonp. if Register routine is very big. maybe not a good idea...
Quote
VovKa.
You are right . If can do this, of course, it is the best. But,
our Register routine is very big . maybe 20~30kb . then Each routine need add in ?

77077

  • Guest
Re: can increase the difficulty ?
« Reply #9 on: July 21, 2015, 03:21:35 AM »
hunt for any advice . Thanks a lot.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: can increase the difficulty ?
« Reply #10 on: July 21, 2015, 06:49:35 AM »
our Register routine is very big . maybe 20~30kb . then Each routine need add in ?
then do all the checks not in each routine but upon loading your app
(defun Register......)
(Register)
(defun c:addlengths ..............)
(defun c:blahblahblah1 ..............)
(defun c:blahblahblah2 ..............)

ChrisCarlson

  • Guest
Re: can increase the difficulty ?
« Reply #11 on: July 21, 2015, 07:59:44 AM »
Honestly, I'd either look into remote auth or utilize the AutoDesk exchange. All of these will only keep honest people honest. With that said I would not use the function "register"

77077

  • Guest
Re: can increase the difficulty ?
« Reply #12 on: July 21, 2015, 08:19:41 AM »
our Register routine is very big . maybe 20~30kb . then Each routine need add in ?
then do all the checks not in each routine but upon loading your app
(defun Register......)
(Register)
(defun c:addlengths ..............)
(defun c:blahblahblah1 ..............)
(defun c:blahblahblah2 ..............)

Hi VovKa
Thanks for your advice .
you mean All in one ?

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: can increase the difficulty ?
« Reply #13 on: July 21, 2015, 09:38:30 AM »
you mean All in one ?
yes
merge all you functions into one file