bunhoc_hh Posted April 10, 2023 Posted April 10, 2023 So i make some lisp-cover them to fas. Put all in 1 folder and make 1 mnu file that load with menuload and load all that lisp. But now i want put that in USB and when i load it to autocad, whatever i click in any lisp i want password showup then when i enter password i can use all fuction of it. Every time i open autocad and use them i need reenter password. Any change i can make that? Quote
Steven P Posted April 10, 2023 Posted April 10, 2023 You want a one time password entry? I think you'll have to look into creating a registry key and reading that to check if a password has been used. Note that if you read or modify the wrong thing you can change other settings so make sure what you use is unique it isn't something I do, but others out there could help The other option is one level less secure but perhaps easy to implement, and that is to save a small text file on the users machine containing some text (such as 'password OK") which if the file exists then the LISP can run, and if it doesn't exist, ask for the password. This file could be anywhere of course and if the coding is in the compiled code tricky to find by casual looking. 1 Quote
bunhoc_hh Posted April 10, 2023 Author Posted April 10, 2023 5 hours ago, Steven P said: You want a one time password entry? I think you'll have to look into creating a registry key and reading that to check if a password has been used. Note that if you read or modify the wrong thing you can change other settings so make sure what you use is unique it isn't something I do, but others out there could help The other option is one level less secure but perhaps easy to implement, and that is to save a small text file on the users machine containing some text (such as 'password OK") which if the file exists then the LISP can run, and if it doesn't exist, ask for the password. This file could be anywhere of course and if the coding is in the compiled code tricky to find by casual looking. Thank sir. I think registry key is what i looking for, just say when i click on 1.DANHSTT or any alert showup and i need enter password. After that i can use all function of menu lisp that i make. Every time you plug USB back it will ask password again, some thing like company USB when you need your personal password to enter computer. Can you show me some tutorial on youtube or any web doing this? Quote
BIGAL Posted April 11, 2023 Posted April 11, 2023 (edited) In the registry its easy (setenv & (getenv. (setq alancnt (getenv "xyzabc")) You just need to work out how to do the 1st go and set the Reg variable. Ok better ways is read USB serial number, read Hard disk ID, read IP address. If your supplying usb then you know its serial number. So copy the software to say hard disk will make it not work. (defun UsbDriveSerialNumber ( / fso dr) (setq fso (vlax-create-object "Scripting.FileSystemObject")) (vlax-for d (vlax-get fso 'Drives) (if (= (Vlax-get d 'DriveType) 2) (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr) ) ) ) (vlax-release-object fso) (reverse dr) ) (UsbDriveSerialNumber) You can process multiple lisp files to FAS in one go. Post if need code. Ok a hint for multiple files is using a bat file you can copy passwordfile.lsp+yourlisp1.lsp c:\\myfasfiles\yourlisp1.lsp This allows you to make a tiny lisp that has the test in it and the copy command adds it to the top of the new lisp file., which you compile to fas. This way you can test the code without the security check. Used on 130 files in one go. Edited April 11, 2023 by BIGAL 1 Quote
bunhoc_hh Posted April 11, 2023 Author Posted April 11, 2023 1 hour ago, BIGAL said: In the registry its easy (setenv & (getenv. (setq alancnt (getenv "xyzabc")) You just need to work out how to do the 1st go and set the Reg variable. Ok better ways is read USB serial number, read Hard disk ID, read IP address. If your supplying usb then you know its serial number. So copy the software to say hard disk will make it not work. (defun UsbDriveSerialNumber ( / fso dr) (setq fso (vlax-create-object "Scripting.FileSystemObject")) (vlax-for d (vlax-get fso 'Drives) (if (= (Vlax-get d 'DriveType) 2) (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr) ) ) ) (vlax-release-object fso) (reverse dr) ) (UsbDriveSerialNumber) You can process multiple lisp files to FAS in one go. Post if need code. Ok a hint for multiple files is using a bat file you can copy passwordfile.lsp+yourlisp1.lsp c:\\myfasfiles\yourlisp1.lsp This allows you to make a tiny lisp that has the test in it and the copy command adds it to the top of the new lisp file., which you compile to fas. This way you can test the code without the security check. Used on 130 files in one go. Thank for reply my post. So you mean make bat file so it will compile your password.lsp with yourlisp.lsp and make them become fas file, every fas file now will have tiny code on the top ask for password. And when you want to change password just need to re-code password.lsp and run bat file again with yourlisp.lsp. Can you show me how to do it, thank. Quote
BIGAL Posted April 11, 2023 Posted April 11, 2023 Ok will dig out code 2 parts a Windows command and a lisp to make the Fas files. 2 versionsof the compile lisp, 1st is one at a time. (if (null vlisp-compile) (c:vlide T)) (setq fname (getfiled "Pick lisp to be compiled" "D:\\alan\\lisp" "lsp" 8)) (setq len (strlen fname)) (setq diff (- len (+ 15 3))) (setq fnameout (substr fname 15 diff)) (vlisp-compile 'st fname (strcat "d:\\alan\\compiled\\" fnameout ".fas")) ) (comp) ; must have vlide open to work (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "Vlide ") (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")) ) Will look into the make bat part, copy files. Are the files in one directory ? Should be able to do tomorrow. 1 Quote
bunhoc_hh Posted April 25, 2023 Author Posted April 25, 2023 On 4/11/2023 at 7:02 PM, BIGAL said: Ok will dig out code 2 parts a Windows command and a lisp to make the Fas files. 2 versionsof the compile lisp, 1st is one at a time. (if (null vlisp-compile) (c:vlide T)) (setq fname (getfiled "Pick lisp to be compiled" "D:\\alan\\lisp" "lsp" 8)) (setq len (strlen fname)) (setq diff (- len (+ 15 3))) (setq fnameout (substr fname 15 diff)) (vlisp-compile 'st fname (strcat "d:\\alan\\compiled\\" fnameout ".fas")) ) (comp) ; must have vlide open to work (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "Vlide ") (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")) ) Will look into the make bat part, copy files. Are the files in one directory ? Should be able to do tomorrow. Sorry for late response, busy like hell. Yes they all in one directory. And thank again Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.