Author Topic: Lock a Lisp Routine  (Read 17064 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: 8702
  • 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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lock a Lisp Routine
« Reply #15 on: October 08, 2007, 09:45:37 AM »
You may want to research these threads:
encrypt
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

LE

  • Guest
Re: Lock a Lisp Routine
« Reply #16 on: October 08, 2007, 12:30:15 PM »
Just make sure on providing a way of transferring the application to any other computer, without asking you every time.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8702
  • AKA Daniel
Re: Lock a Lisp Routine
« Reply #17 on: October 08, 2007, 12:48:12 PM »
 I have been thinking about bio fingerprinting, maybe generating some sort of install code from this.


LE

  • Guest
Re: Lock a Lisp Routine
« Reply #18 on: October 08, 2007, 02:07:04 PM »
I been thinking in something like this.... don't know

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8702
  • AKA Daniel
Re: Lock a Lisp Routine
« Reply #19 on: October 08, 2007, 02:15:57 PM »
I been thinking in something like this.... don't know

Oh yeah, now you’re talking, I like it.

LE

  • Guest
Re: Lock a Lisp Routine
« Reply #20 on: October 08, 2007, 02:19:50 PM »
or this....

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8702
  • AKA Daniel
Re: Lock a Lisp Routine
« Reply #21 on: October 08, 2007, 02:22:50 PM »
Well, that would work, if you needed a blood sample for a DNA based key.

LE

  • Guest
Re: Lock a Lisp Routine
« Reply #22 on: October 08, 2007, 02:29:54 PM »
Well, that would work, if you needed a blood sample for a DNA based key.

:)

OK, now in a sem-serious mode I might end up uploading on my show your stuff forum lisp topic, my locklisp project I did using activelock and visual lisp.... one of these days.

chlh_jd

  • Guest
Re: Lock a Lisp Routine
« Reply #23 on: February 25, 2011, 04:31:35 AM »
A way to get Networkadapter MAC , only test OK with XP WSYS
Code: [Select]
;;Test OK with XP
;;Use WMI to Get Networkadapter MAC.
;;Author :  eachy [eachy@xdcad.net]
;;Web    :  http://www.xdcad.net
;;2005.11.22(xdl-MACAddress)
(defun xdl-MACAddress (/ mac WMIobj con lox sn)
  (if (setq WMIobj (vlax-create-object "wbemScripting.SwbemLocator"))
    (progn
      (setq
con (vl-catch-all-apply
     'vlax-invoke
     (list WMIobj 'ConnectServer "." "" "" "" "" "" 128 nil)
   )
      )
      (if (vl-catch-all-error-p con)
(setq
 con (vlax-invoke WMIobj 'ConnectServer "." "" "" "" "" "")
)
      )
      (setq lox (vlax-invoke
 con
 'ExecQuery
 "Select * From Win32_NetworkAdapter"
)
      )
      (vlax-for item lox
(if (vlax-get item 'NetConnectionID)
 (progn
   (setq sn (vlax-get item 'MACAddress))
   (or
     (member sn mac)
     (setq mac (cons sn mac))
   )
 )
)
      )
      (mapcar 'vlax-release-object
     (list lox con WMIobj)
      )
    )
  )
  (reverse mac)
)

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Can't copy
« Reply #24 on: February 25, 2011, 08:10:33 AM »
... but are more frequently harvesters of others' ingenuity.

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

Remember - shiny side *out*.  Foil has two distinct sides for a reason.  Most wear it with the wrong way 'round which just keeps the crazy in rather than out.   :ugly:
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

xiaxiang

  • Guest
Re: Can't copy
« Reply #25 on: February 26, 2011, 03:52:51 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

Aha 8-)  So cool! Can you post your algorithm,Dan?

pkohut

  • Bull Frog
  • Posts: 483
Re: Can't copy
« Reply #26 on: February 26, 2011, 04:15:16 AM »
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

You're in China, better lock down that keyboard and mouse too.

Now tell us you're J/K'ing, cause some might be taking you seriously.
New tread (not retired) - public repo at https://github.com/pkohut

xiaxiang

  • Guest
Re: Can't copy
« Reply #27 on: February 26, 2011, 04:54:54 AM »

You're in China, better lock down that keyboard and mouse too.

Now tell us you're J/K'ing, cause some might be taking you seriously.

Nonsense
« Last Edit: March 09, 2011, 09:25:31 PM by xiaxiang »

pkohut

  • Bull Frog
  • Posts: 483
Re: Can't copy
« Reply #28 on: February 26, 2011, 05:26:12 AM »

You're in China, better lock down that keyboard and mouse too.

Now tell us you're J/K'ing, cause some might be taking you seriously.

What do you mean in this post ? How dare you that ?
So give you a chance to change it...

It has dual meaning, 1) hey dude you forgot 2 other pieces of hardware, 2) reports here state China's software piracy problem is still huge, from 45% to 80% depending on who's reporting, China Daily 2010 or BSA 2009.

No other inference implied.
New tread (not retired) - public repo at https://github.com/pkohut

xiaxiang

  • Guest
Re: Can't copy
« Reply #29 on: February 26, 2011, 08:14:20 AM »

You're in China, better lock down that keyboard and mouse too.

Now tell us you're J/K'ing, cause some might be taking you seriously.

What do you mean in this post ? How dare you that ?
So give you a chance to change it...

It has dual meaning, 1) hey dude you forgot 2 other pieces of hardware, 2) reports here state China's software piracy problem is still huge, from 45% to 80% depending on who's reporting, China Daily 2010 or BSA 2009.

No other inference implied.
:?
Did I misread your post? Did you have more suggestions about Lock a Lisp Routine ? It looks like your code that have been posted works truely well .Any more codes or  ideas? Btw, I just want to talk about this topic ,rather than others.

Xia
« Last Edit: February 26, 2011, 08:24:00 AM by xiaxiang »

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Lock a Lisp Routine
« Reply #30 on: March 09, 2011, 02:20:17 AM »
A simple way to add the lock routine to all your lisps there a DOS command that can help, you can copy two files together to make a third.

You make a batch file you change your serial number etc in one file then its simple
Copy serial+lisp1.lsp protlisp1.lsp
Copy serial+lisp2.lsp protlisp2.lsp

How to stop copying you cant but makes it difficult for them we used serial number and protect, got a phone call asking why the software would not work simple answer was trying to run on a friends computer without paying.
A man who never made a mistake never made anything

xiaxiang

  • Guest
Re: Lock a Lisp Routine
« Reply #31 on: March 10, 2011, 07:53:57 PM »
A simple way to add the lock routine to all your lisps there a DOS command that can help, you can copy two files together to make a third.

You make a batch file you change your serial number etc in one file then its simple
Copy serial+lisp1.lsp protlisp1.lsp
Copy serial+lisp2.lsp protlisp2.lsp

How to stop copying you cant but makes it difficult for them we used serial number and protect, got a phone call asking why the software would not work simple answer was trying to run on a friends computer without paying.


Using copy command in dos mode is a better way to  lock routines.There  is no way to decompile it.And "Copy serial+lisp1.lsp =protlisp1.lsp",this is a good idea.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Lock a Lisp Routine
« Reply #32 on: March 12, 2011, 06:09:50 PM »
Use AutoCAD's loginname as the password to activate the code.
I know it can be easily gotten around...but what a hassle to do so.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64