Author Topic: Lock a Lisp Routine  (Read 16938 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
Lock a Lisp Routine
« on: September 30, 2007, 07:52:21 PM »
Hi Alls,
I have a program Autolisp, that code just sold to my friend and change fas file too,my question is..is it possible to can't copy to others computer, I hope that code only save at "A" computer, but can't copy to "B" computer.
« Last Edit: October 08, 2007, 09:43:53 AM by CAB »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Can't copy
« Reply #1 on: September 30, 2007, 10:23:12 PM »
I'm confused, I thought you said he was a friend.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Adesu

  • Guest
Re: Can't copy
« Reply #2 on: September 30, 2007, 10:47:06 PM »
That right sold to my friend, but I want after that sold, that code can not copy to others computer , only my friend.
Maybe my friend send to others her friend.

I'm confused, I thought you said he was a friend.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Can't copy
« Reply #3 on: October 01, 2007, 12:01:04 AM »
If I wrote a program for my friend, let's say Mark, with the understanding it was 
solely for his use and not to be copied to other computers, and I clearly expressed
that to him nothing else would be required.

Friend (frĕnd).

1. A person whom one knows, likes, and trusts.
« Last Edit: October 01, 2007, 08:27:53 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Adesu

  • Guest
Re: Can't copy
« Reply #4 on: October 02, 2007, 03:45:51 AM »
The problem not between "me and my friend", but is it possible to can't copy if that code just save at computer "A" and don't copy again at computer "B".
any idea to can't copy or duplicate

hudster

  • Gator
  • Posts: 2848
Re: Can't copy
« Reply #5 on: October 02, 2007, 04:03:24 AM »
I would say no.

If I bought a lisp program, which was registered to me and solely for my use, for me to give copies to anyone else would basically be piracy.

If someone I know wanted a copy of it, I would send them to the website where I bought my copy from so they could purchase a copy for themselves, after all you wouldn't ask him for a copy of his AutoCAD program would you, so why should a commercial lisp program be any different?
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

Adesu

  • Guest
Re: Can't copy
« Reply #6 on: October 02, 2007, 04:14:03 AM »
Hi Andy,
Thanks for your comment, it's clear too.

I would say no.

If I bought a lisp program, which was registered to me and solely for my use, for me to give copies to anyone else would basically be piracy.

If someone I know wanted a copy of it, I would send them to the website where I bought my copy from so they could purchase a copy for themselves, after all you wouldn't ask him for a copy of his AutoCAD program would you, so why should a commercial lisp program be any different?

ASMI

  • Guest
Re: Can't copy
« Reply #7 on: October 02, 2007, 05:35:53 AM »
Is it so secret program?  :-D You can use Hard drive C: serial number:

Code: [Select]
(defun Get_Hard_Serial(Path / fsObj hSn abPth)
  (vl-load-com)
  (if
    (and
      (setq fsObj(vlax-create-object "Scripting.FileSystemObject"))
      (not
(vl-catch-all-error-p
  (setq abPth(vl-catch-all-apply 'vlax-invoke-method
       (list fsObj 'GetAbsolutePathName Path))
       ); end setq
   ); end vl-catch-all-error-p
); end not
  ); end and
    (progn
      (setq cDrv(vlax-invoke-method fsObj 'GetDrive
        (vlax-invoke-method fsObj 'GetDriveName abPth
        ); end vlax-invoke-method
      );end vlax-invoke-method
     ); end setq
     (if
       (vl-catch-all-error-p
  (setq hSn(vl-catch-all-apply 'vlax-get-property
    (list cDrv 'SerialNumber))))
    (progn
      (vlax-release-object cDrv)
      (setq hSn nil)
    ); end progn
       ); end if
    (vlax-release-object fsObj)
    ); end progn
   ); end if
  hSn
  ); end of Get_Hard_Serial

Code: [Select]
Command: (Get_Hard_Serial "c:")
-1066846693

Or AutoCAD serial number...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Can't copy
« Reply #8 on: October 03, 2007, 01:51:32 PM »
Have fun trying to maintain n copies of your software going the drive serial number route.

An aside, I've not seen much lisp code in my 25+ years, million+ lines coded experience that truly warranted protecting.

What I find truly amusing is the folks that frequently pose questions of this nature typically don't contribute code to news groups et al, but are more frequently harvesters of others' ingenuity. The irony kills me.

I'm not slaggin' on Adesu, just a general observation.

In my opinion of course.

:ugly:
« Last Edit: October 03, 2007, 01:54:38 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

LE

  • Guest
Re: Can't copy
« Reply #9 on: October 03, 2007, 02:02:45 PM »
25+ years, million+ lines coded experience that truly warranted protecting.

agreed to what said... x2

now, count to ten.... if you can  :-)

deegeecees

  • Guest
Re: Can't copy
« Reply #10 on: October 03, 2007, 02:04:13 PM »
... but are more frequently harvesters of others' ingenuity.

Ahhh! They're on to me! Must reverse tin-foil hat...

ASMI

  • Guest
Re: Can't copy
« Reply #11 on: October 03, 2007, 02:56:20 PM »
I hold about the same opinions as well as the previous authors. But there are exceptions. For example I know the person which writes really complex programs and in the labour contract has a condition that his programs can be used only inside of firm and he has not the right distribute this code, and also undertakes to arrange against copying by other users. Contract is contract...

Let's not laugh. Probably we really do not know all details.

Adesu

  • Guest
Re: Can't copy
« Reply #12 on: October 08, 2007, 02:30:40 AM »
Hi ASMI,
I have an idea, like this sample.
Code: [Select]
(defun Get_Hard_Serial(Path / fsObj hSn abPth)
  (vl-load-com)
  (if
    (and
      (setq fsObj(vlax-create-object "Scripting.FileSystemObject"))
      (not
(vl-catch-all-error-p
  (setq abPth(vl-catch-all-apply 'vlax-invoke-method
       (list fsObj 'GetAbsolutePathName Path))
       ); end setq
   ); end vl-catch-all-error-p
); end not
  ); end and
    (progn
      (setq cDrv(vlax-invoke-method fsObj 'GetDrive
        (vlax-invoke-method fsObj 'GetDriveName abPth
        ); end vlax-invoke-method
      );end vlax-invoke-method
     ); end setq
     (if
       (vl-catch-all-error-p
  (setq hSn(vl-catch-all-apply 'vlax-get-property
    (list cDrv 'SerialNumber))))
    (progn
      (vlax-release-object cDrv)
      (setq hSn nil)
    ); end progn
       ); end if
    (vlax-release-object fsObj)
    ); end progn
   ); end if
  hSn
  ); end of Get_Hard_Serial

(defun your_code (/ p1 p2 p3 p4)
  (setq p1 '(0 0 0))
  (setq p2 '(10 0 0))
  (setq p3 '(10 5 0))
  (setq p4 '(0 5 0))
  (command "_pline" p1 p2 p3 p4 "c" "")
  (princ)
  )  ; defun


(defun c:test (/ mycom)
  (setq code (Get_Hard_Serial "c:"))
  (setq mycom -126236818)
  (if
    (= mycom code)
    (your_code)
    (alert "\nInvalid computer set, please contact Adesu")
    ) ; if
  (princ)
  )   ; defun 


Is it so secret program?  :-D You can use Hard drive C: serial number:

Code: [Select]
(defun Get_Hard_Serial(Path / fsObj hSn abPth)
  (vl-load-com)
  (if
    (and
      (setq fsObj(vlax-create-object "Scripting.FileSystemObject"))
      (not
(vl-catch-all-error-p
  (setq abPth(vl-catch-all-apply 'vlax-invoke-method
       (list fsObj 'GetAbsolutePathName Path))
       ); end setq
   ); end vl-catch-all-error-p
); end not
  ); end and
    (progn
      (setq cDrv(vlax-invoke-method fsObj 'GetDrive
        (vlax-invoke-method fsObj 'GetDriveName abPth
        ); end vlax-invoke-method
      );end vlax-invoke-method
     ); end setq
     (if
       (vl-catch-all-error-p
  (setq hSn(vl-catch-all-apply 'vlax-get-property
    (list cDrv 'SerialNumber))))
    (progn
      (vlax-release-object cDrv)
      (setq hSn nil)
    ); end progn
       ); end if
    (vlax-release-object fsObj)
    ); end progn
   ); end if
  hSn
  ); end of Get_Hard_Serial

Code: [Select]
Command: (Get_Hard_Serial "c:")
-1066846693

Or AutoCAD serial number...

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Can't copy
« Reply #13 on: October 08, 2007, 04:38:08 AM »
I protect my lisp programs with a key. During the install process, the end user sends me an ‘Install’ code
that’s generated by hardware mapping similar to the Windows Product Activation. The install code is a
136-bit multi-precision integer, which is stored in little endian byte order as a byte array.
The ‘Install’ code can be represented as a sequence of 17 bytes as in

               
Code: [Select]
                  0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX
                  0x94 0xAA 0x46 0xD6 0x0F 0xBD 0x2C 0xC8
                  0x00
Anyway with out getting into too much detail, the bit fields are mapped by

Quote
Volume serial number system volume
Network adapter MAC
CD-ROM drive hardware identification
Graphics adapter hardware identification
CPU serial number
Hard drive hardware identification
SCSI host adapter hardware identification
IDE controller hardware identification
Processor model
RAM
The cryptographic algorithm use to encrypt the ‘Install’ code, is a proprietary four-round Feistel cipher.
The result is five alpha numeric strings separated by an “-“, as in

Code: [Select]
FFFFF-GGGGG-HHHHH-JJJJJ-KKKKK
This would be the key that the end user would enter to activate the product.
There are various check points within the program to verify the machine is authorized.

Dan

Adesu

  • Guest
Re: Can't copy
« Reply #14 on: October 08, 2007, 05:09:25 AM »
Hi Daniel,
it's good info, and good trick.