Decrypt 1999 lisp routine I created

Decrypt 1999 lisp routine I created

Anonymous
Not applicable
4,817 Views
24 Replies
Message 1 of 25

Decrypt 1999 lisp routine I created

Anonymous
Not applicable

I've read into the idea of decrypting lisp routines so I don't have high hopes of a solution. I wrote some routines back in the late 1990's but I failed to save the ascii version and all I have are the AutoCAD Protected versions. Is there a means to decrypt these older protected lisp files of mine?

0 Likes
Accepted solutions (1)
4,818 Views
24 Replies
Replies (24)
Message 21 of 25

ronjonp
Advisor
Advisor

@pbejse Here is a version that will create your DCL on the fly 🙂

(defun c:nebula	(/ _writefile lm:rand dch lm:randrange a d f ms p sp)
  ;; 	ronjonp | pbe | Lee Mac    ;;
  ;; http://www.lee-mac.com/random.html
  ;; Rand  -  Lee Mac
  ;; PRNG implementing a linear congruential generator with
  ;; parameters derived from the book 'Numerical Recipes'
  (defun lm:rand (/ a c m)
    (setq m   4294967296.0
	  a   1664525.0
	  c   1013904223.0
	  $xn (rem (+ c
		      (* a
			 (cond ($xn)
			       ((getvar 'date))
			 )
		      )
		   )
		   m
	      )
    )
    (/ $xn m)
  )
  (defun _writefile (fn l / f)
    (cond ((and (eq 'str (type fn)) (setq f (open fn "w")))
	   (foreach x l (write-line x f))
	   (close f)
	   fn
	  )
    )
  )
  (defun lm:randrange (a b) (+ (min a b) (fix (* (lm:rand) (1+ (abs (- a b)))))))
  (or initval (setq initval '(("size" "250000") ("dcnt" "2000") ("scnt" "100") ("srot" "0"))))
  (foreach var initval
    (if	(setq dflt (eval (read (car var))))
      dflt
      (set (read (car var)) (cadr var))
    )
  )
  ;; RJP added DCL creation
  (or (findfile (setq f (strcat (getenv "TEMP") "Galaxy 2.0.dcl")))
      (_writefile
	f
	'("dcl_settings : default_dcl_settings { audit_level = 3; }"
	  "ed : edit_box {\tfixed_width = true; width = 6; alignment = right;}"
	  "tx : text {alignment = left; height = 0.1;}"
	  ""					       "Nebula : dialog {"
	  "//label = \"Create virtual galaxy\";"       "\tkey = \"mine\";"
	  " : boxed_column {"			       "\tlabel = \"Quantities of...\";"
	  "\t: row {"				       " \t: column {"
	  " \tspacer_0 ;"			       " \t: tx { label = \"\\tGalaxy Size:\" ; }"
	  " \t: tx { label = \"\\tDust particles:\" ; }"
	  "\t: tx { label = \"\\tStars:\" ; }"
	  "\t: tx { label = \"\\tStar axis rotation increment:\" ; }"
	  " \t\t}"				       "\t: column {"
	  "\t   : ed { key = \"size\"; } "	       "\t   : ed { key = \"dcnt\"; } "
	  "\t   : ed { key = \"scnt\"; }"	       "\t   : ed { key = \"srot\"; }"
	  "\t   \t}"				       "\t   \t}"
	  "\tspacer ;  "			       "\t}//bc1"
	  "  spacer_1;"				       "  ok_cancel;"
	  "}"
	 )
      )
  )
  (cond	((<= (setq dch (load_dialog f)) 0) (princ "\nUnable to find/load Nebula.dcl file."))
	((not (new_dialog "Nebula" dch)) (princ "\nUnable to display dialog."))
	((set_tile "mine" (strcat (getvar 'loginname) "'s Galaxy"))
	 (foreach key '("size" "dcnt" "scnt" "srot")
	   (set_tile key (eval (read key)))
	   (action_tile key (vl-prin1-to-string (quote (set (read $key) (get_tile $key)))))
	 )
	 (mode_tile "srot" 1)
	 (action_tile "accept" "(done_dialog 1)")
	 (action_tile "cancel" "(done_dialog 0)")
	 (setq flag (start_dialog))
	)
  )
  (if (< 0 dch)
    (unload_dialog dch)
  )
  (if (zerop flag)
    (princ "\n<<< User cancelled >>>")
    (progn (setq ms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
	   (setq d (distof size))
	   (setq a (lm:randrange 1 (/ d 20.))) ;<-- we will do this later	;;
	   ;;	For now we are using 3DSolid 					;;
	   (repeat (atoi scnt)
	     (setq p (list (lm:randrange (- d) d) (lm:randrange (- d) d) (lm:randrange (- d) d)))
	     (if (setq sp (vlax-invoke ms 'addsphere p (lm:randrange 1 a)))
	       (vla-put-color sp (lm:randrange 1 255))
	     )
	   )
	   (repeat (atoi dcnt)
	     (setq p (list (lm:randrange (- d) d) (lm:randrange (- d) d) (lm:randrange (- d) d)))
	     (entmake (list '(0 . "POINT") (cons 10 p) (cons 62 (lm:randrange 1 255))))
	   )
    )
  )
  (princ)
)
Message 22 of 25

Anonymous
Not applicable
Did I spot the cube at .53 into the clip? Validation at last! 😉
0 Likes
Message 23 of 25

rddarger5LLC2
Community Visitor
Community Visitor

How did you get the skins on the planets?

0 Likes
Message 24 of 25

bibitzky
Community Visitor
Community Visitor

...

 

0 Likes
Message 25 of 25

eskis
Community Visitor
Community Visitor

hi, is it possible to email me the autodc.exe?  morteza.adib@gmail.com

 

0 Likes