Author Topic: Protect Lisp Using Motherboard Serial key  (Read 222 times)

0 Members and 1 Guest are viewing this topic.

sandunmadushan

  • Mosquito
  • Posts: 1
Protect Lisp Using Motherboard Serial key
« on: September 14, 2021, 02:59:47 AM »
Hello. i have this lisp for protect lisp by using motherboard serial  key. but have some issue with that. if any one can fix that code.
thank you.

VovKa

  • Swamp Rat
  • Posts: 1369
  • Ukraine
Re: Protect Lisp Using Motherboard Serial key
« Reply #1 on: September 14, 2021, 08:43:13 AM »
it is not clear what are you to trying to protect

BIGAL

  • Swamp Rat
  • Posts: 820
  • 30 + years of using Autocad
Re: Protect Lisp Using Motherboard Serial key
« Reply #2 on: September 14, 2021, 10:50:08 PM »
I have used this with multiple lisps in old days with protect you now use FAS. It is a simple method of having your getserialnumber and a variable with that number in a small lisp

Code: [Select]
(defun MAINBOARDSERIAL ( /  ITEM METH1 METH2 S SERX WMI) ;MOTHER BORD
(VL-LOAD-COM )
(setq WMI (vlax-create-object "WbemScripting.SWbemLocator"))
(setq METH1 (vlax-invoke WMI 'CONNECTSERVER NIL NIL NIL NIL NIL NIL NIL NIL))
(setq METH2 (vlax-invoke METH1 'EXECQUERY "select SerialNumber from Win32_BaseBoard"))
(setq S 
                     (vlax-for ITEM METH2
                        (progn 
                        (setq SERX (LIST (vlax-get ITEM 'SERIALNUMBER)))
                              (LIST (vlax-get ITEM 'SERIALNUMBER))
                           )
   )
)
(vlax-release-object METH1)
(vlax-release-object METH2)
(vlax-release-object WMI)
(if (= "123456789" s)
(princ "all ok")
(progn
(alert "Incorrect serial number please contact Santa Clause for correct number\n will now exit)")(EXIT)
)
)

)

Ok now for the smart part and you have to be old and know dos you can do the following at cmd line

COPY PROTECT.lsp+mylisp1.lsp C:\newlisps\Mylisp1.lsp

so this will add the protect.lsp at the start of the code, then do a lisp compile to FAS.

You can batch run all your lisps
COPY PROTECT.lsp+mylisp1.lsp C:\newlisps\Mylisp1.lsp
COPY PROTECT.lsp+mylisp2.lsp C:\newlisps\Mylisp2.lsp
COPY PROTECT.lsp+mylisp3.lsp C:\newlisps\Mylisp3.lsp

(VL-LOAD-COM)
(setq loads (list "Lisp1" "Lisp2" "Lisp3"))
(setq loc1 "F:\\") ;;change dirs to where ever you want them saved
(setq loc2 "F:\\Compiled Lisp\\")
(foreach lisp loads
(vlisp-compile 'st (strcat loc1 lisp ".lsp") (strcat loc2 lisp ".fas"))
)

A man who never made a mistake never made anything

d2010

  • Newt
  • Posts: 199
Re: Protect Lisp Using Motherboard Serial key
« Reply #3 on: September 15, 2021, 08:14:27 AM »
My MotherBoard do not have SerialNumber.
I capture the screen$desktop step-by-step
The S=""
I rename the (defun MAINBOARDSERIAL with (defun C:MIB
Men in Black.

« Last Edit: September 15, 2021, 08:24:42 AM by d2010 »