Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Decrypt 1999 lisp routine I created

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
mautensmith
2269 Views, 21 Replies

Decrypt 1999 lisp routine I created

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?

21 REPLIES 21
Message 2 of 22
john.uhden
in reply to: mautensmith

There used to be a decrypt or unencrypt executable decades ago.

I'm gonna guess that my copy went by the way of my Gateway 386.

Wait... OMG, I still have it!  AUTODC.EXE.

Send me a private message with your e-mail address and I'll send it to you.

John F. Uhden

Message 3 of 22
mautensmith
in reply to: john.uhden

Thanks John. I believe I sent my email addy via private message. Let me know if that is not the case. 386, eh, that would be around R11?

Message 4 of 22
john.uhden
in reply to: mautensmith

I started with what I think was R2.67 (2.76?) on a 286 I think in 1988.  The next step was R9.  I remember falling asleep waiting for AutoCAD to trim one polyline contour.

John F. Uhden

Message 5 of 22
Sea-Haven
in reply to: mautensmith

Kelvinator and Protect come to mind, both had a undo. The issue will be running the exe looked at some of the win 10 emulators to run old programs followed instructions then the do this just did not match my version, still have my last 2 laptops hopefully can get hard wired network connect to work. 

Message 6 of 22
pbejse
in reply to: mautensmith


@mautensmith wrote:

..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. 


It's more fun to rewrite the code, especially after you have gain more experience throughout the years. 

For starters, you can pick one and let us try replicate the program. 

 

 

Message 7 of 22
mautensmith
in reply to: pbejse

I don't know if I'm that ambitious these days. A few of the routines are small enough to start over on but there are a couple of them that were complex enough that getting into the original code would be very helpful. I do have the DCL files to provide some hints as to the user supplied variables and for the most part, the routines do run in ADT 2004 on Win10 OS. Thanks for taking an interest.
Message 8 of 22
mautensmith
in reply to: pbejse

Okay, there is only 1 routine I would put time into at this point, and it is totally for fun. The routine created two entity types, points/nodes and a mesh sphere. It then ran though a random number generator for the x, y, & z insertion points. The sphere object got a sizing multiplier and an axis rotation as well. That's it, it would generate a cheesy (cube) galaxy of how ever many entities you called out for and it would be to a very large scale across the x, y, and z, axis's. I'll see if I can supply the DCL and the protect lisp file along with a DWG of a sample galaxy. I have found that I need to manually create the layers, "dust" and "stars" in order for it to work.

 

The forum is taking issue with the galaxyv1.lsp content (encrypted) not matching the file extension type. I'm giving it an shx extension to see if that uploads to this post. If so, you will have to rename, galaxyv1.shx to galaxyv1.lsp.

Message 9 of 22
john.uhden
in reply to: mautensmith

You don't have to rename files to *.lsp to load them.
(load "test.xyz") works just fine.

John F. Uhden

Message 10 of 22
pbejse
in reply to: mautensmith


@mautensmith wrote:

Okay, there is only 1 routine I would put time into at this point, and it is totally for fun. The routine created two entity types, points/nodes and a mesh sphere. It then ran though a random number generator for the x, y, & z insertion points. The sphere object got a sizing multiplier and an axis rotation as well. 

 


I take it the cube is always the same size as it is not included on the items on the dcl ?

pbejse_0-1625239766774.png

I also think that you ran the program at least 3 times on the attached drawing sample and change the layers of the previous build.

 

Good thing is, i've seen a program like this before way back 2014/15 , and i think i saved a copy of the code. if only i can find it again. 

 

And you wrote this at least 2  decades ago. That's mighty impressive 🙂.

 

Let's see what we can do .

[ searching for the code ... ]

 

 

 

Message 11 of 22
mautensmith
in reply to: pbejse

Correct on the number of times I ran the code in the sample dwg. I ran it, changed the layer names, then created new dust and stars layers. The cube size is dependent on the random multiplier number and the distances from corner points gets in the scientific notation e6 or something like that. There is one particle application from the routine and that is to provide a visual idea of distance in space...by connecting points with a line and then use the 3d Orbit to inspect the line(s).
Message 12 of 22
ronjonp
in reply to: mautensmith

Here's a quick start with hardcoded numbers. It uses Lee's random number generator.

 

(defun c:foo (/ lm:rand lm:randrange a d ms p sp)
  ;; 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 lm:randrange (a b) (+ (min a b) (fix (* (lm:rand) (1+ (abs (- a b)))))))
  (if (progn (initget 6) (or (setq d (getdist "\nEnter distance to fill: <2000>")) (setq d 2000.)))
    (progn (setq ms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
	   (setq a (lm:randrange 1 (/ d 8.)))
	   (repeat (fix (/ d 12))
	     (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 (fix d)
	     (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 13 of 22
diagodose2009
in reply to: mautensmith

I decode your programe, work fine. 

;;Creates random points and spheres in 3d. 
 
(defun c:gal (/ D-CNT S-CNT S-ROT do_next entnu10 incr modu mult ptorg pt10 ptnu10 ptx pty ptz ptxyz seed
   acr1 arc2 axs axs1 cent ent1 ent2 incr)
 (setq DCL_ID (load_dialog "galaxy.dcl")) ;dcl open

 

 

 

 

Message 14 of 22
diagodose2009
in reply to: Sea-Haven

You can customize from sphere3D to ac3Dsolid-triangles.

You can fly with command 3dorbitsnapshot.gif

Message 15 of 22
pbejse
in reply to: mautensmith


@mautensmith wrote:
The cube size is dependent on the random multiplier number and the distances from corner points gets in the scientific notation e6 or something like that. 

Lets start with the cube first, now it creates solids and points but of different colors, no layers yet, no rotation on z axis for now.

Using @ronjonp's working code and an updated dialog 

pbejse_1-1625294725568.png

 

(defun c:Nebula ( / lm:rand dch lm:randrange a d 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 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))
      )
)	       
(cond
       (   (<= (setq dch (load_dialog "Galaxy 2.0.dcl")) 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)
)

 

DCL Code (to be saved as Galaxy 2.0.dcl):

 

dcl_settings : default_dcl_settings { audit_level = 3; }
ed : edit_box {	fixed_width = true; width = 6; alignment = right;}
tx : text {alignment = left; height = 0.1;}

Nebula : dialog {
//label = "Create virtual galaxy";
	key = "mine";
 : boxed_column {
	label = "Quantities of...";
	: row {
 	: column {
 	spacer_0 ;
 	: tx { label = "\tGalaxy Size:" ; }
 	: tx { label = "\tDust particles:" ; }
	: tx { label = "\tStars:" ; }
	: tx { label = "\tStar axis rotation increment:" ; }
 		}
	: column {
	   : ed { key = "size"; } 
	   : ed { key = "dcnt"; } 
	   : ed { key = "scnt"; }
	   : ed { key = "srot"; }
	   	}
	   	}
	spacer ;  
	}//bc1
  spacer_1;
  ok_cancel;
}

 

 


@mautensmith wrote:
There is one particle application from the routine and that is to provide a visual idea of distance in space...by connecting points with a line and then use the 3d Orbit to inspect the line(s).

We will deal with that later, we need to know the requirements for the connection

 

HTH

 

Message 16 of 22
pbejse
in reply to: diagodose2009


@diagodose2009 wrote:

I decode your programe, work fine. 


That is so nice of you to do that @diagodose2009 

Since @mautensmith  IS the author, then send it over to the OP. 

Save us the trouble of figuring out the rest of the code 🙂

 

Better yet, share the file to decrypt [ protect.exe ? AUTODC.EXE ? , whatever ] the protected lisp code with the OP, 

Of course if its a program that you created, then its a different story 😆

 

Message 17 of 22
mautensmith
in reply to: diagodose2009

Bel CADD is me. It is no longer in business. I don't recall putting any of the personal/business info in that rountine...it's weird to see it...like who is/was that guy? Thanks for cracking that time-capsule of a file open. I look forward to re-thinking in galaxy whys.
Message 18 of 22
mautensmith
in reply to: pbejse

So fantastic to see it. It is faster and better. You all are amazing!

 

I captured a one minute screen shot and posted it here: https://youtu.be/sefx4PW3NbY

 

Can you fill me in on your findings?

 

Best,

 

Martin

Message 19 of 22
pbejse
in reply to: mautensmith



@mautensmith wrote:

So fantastic to see it. It is faster and better. You all are amazing!

...

Can you fill me in on your findings?


Glad you like it. @ronjonp  did all the work really, saves me time looking for the lisp file, but  i would have coded it in a similar way anyways as i do recall how it was done.

 

As for my findings, we know the file is already decrypted so there's no point in continuing, I just hope my appeal to @diagodose2009 to send you the raw file will be heard. 🙂

 

A friend of mine has a copy of protect.exe but i was told it will not work on 64bit version of windows. 

 

Message 20 of 22
pbejse
in reply to: mautensmith

Fun Fact:

In the 4th century BCE Greece, philosophers developed the geocentric model, based on astronomical observation; this model proposed that the center of the Universe lies at the center of a spherical, stationary Earth, around which the Sun, Moon, planets, and stars rotate.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost