Jump to content

Can you protect a LISP routine so no-one can see or modify it?


Recommended Posts

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • irneb

    11

  • BlackBox

    6

  • Lee Mac

    4

  • MSasu

    4

Top Posters In This Topic

Posted

Following on to the theme you can use the DOS COPY command to combine two files together the 1st is your serial numb lisp the 2nd is your lisp1 program just repeat in a BAT file for all lisp the kelvinate them etc also and it creates all new lisp files with the security check embedded.

 

There was another post here a while back and the contributor had a php soloution with some code etc and pretty sure for a very small fee would provide source code for other users obviously diddn,t want everyone to know how it was done. I would go this way next time. Will try to find.

 

Another question can you batch compile using vlide ? Then first suggestion would work well.

Posted
Another question can you batch compile using vlide ? Then first suggestion would work well.
If you use VLIDE's Project you can attach several LSP files into the project. Then the project's properties can be set to Merge into one FAS (default) or one FAS per LSP file.

 

Otherwise it's not a train-smash to use the vlisp-compile function to compile several LSP files to individual FAS files. I.e. you use Lisp to compile Lisp ... strange when thinking about it from another programming language's standpoint, but rather "normal" when Lisping!

Posted

Another question can you batch compile using vlide ?

 

Building on Irneb's comments (if I may)....

 

Once you compile LSP->FAS, You can include the resultant FAS in building (read compiling) a VLX application... however not being able to compile LSP->VLX directly from the VLIDE project is one of the telling signs that Autodesk has left VLIDE (and LISP in general) by the wayside for some time. :sigh:

Posted
Building on Irneb's comments (if I may)....
Of course you may ... :wink:

 

Anyhow, you can use the PRJ file from the project to compile the VLX ... though you still need to go through the File-->Make Application-->New Application Wizard... :roll:

 

Which, BTW, saves to a PRV file which has a lisp-like structure something like this:

;;; Visual LISP make file [V1.0] <<AppName>> saved to:[<<path>>] at:[<<date>>] 
(PRV-DEF (:target . "<<path>>/<<AppName>>.VLX")
    (:active-x . T)
    (:separate-namespace)
    (:protected . T)
    (:load-file-list (:prj "<<ProjectName>>.prj"))
    (:require-file-list (:DCL "<<DCLName>>.DCL"))
    (:ob-directory)
    (:tmp-directory)
    (:optimization . lsa)
) ;_ end of PRV-DEF

;; EOF

So I can't see why such couldn't have been made even through a lisp function in itself. Then all that's needed would be to call the compile on that PRV file.

 

But you're correct! VLIDE hasn't improved in years! Just think: It would have been "awesome" to have features like folding, auto-complete, argument-matching, etc. (Like you get in Visual Studio at least) Never mind a one-click to compile to VLX!

 

BTW, VLX isn't all that perfect. Only the LSP gets compiled. All other files included (DCL, TXT, etc.) is simply appended to it. So that can easily be read by opening the VLX in any text editor. The only way to get those as compiled would be to convert them into LSP (e.g. create a defun to make the DCL instead of simply including it in the VLX). So maybe FAS isn't a bad option even for such files.

Posted (edited)

[gripe]

I agree... I too am disappointed in the lack of VLIDE's enhancement (and that of LISP in general). Admittedly, I am only a beginner with the .NET API, and Visual Studio (Express) for that matter, but I genuinely do find LISP to be simple®, easy to write (due to the lack of declared data types! LoL), and frankly elegant in it's own way.

 

One of the many reasons I am forcing myself to learn .NET, aside from the inability to work with newer AEC* objects (thank you Civil 3D!) using LISP, is that .NET development can be done outside of the world of AutoCAD. Because work is so sloooooowww for us right now, we're being cross trained on an antiquated platform (Microstation, or MS). Yes, it (V8i+GEOPAK) IS antiquated when compared to Civil 3D, don't lie to yourself.

 

Hindering us further, our learning MS is relegated to using my State's Department of Transportation workspace+tools. Being adept at developing with Visual Studio (read .NET), will allow me to hopefully make this tangent less painful for the AutoCAD fanatics in my group, and frankly, give me a skill set that I think is perhaps more valuable in this economy than my knowing AutoCAD, Microstation, or both.

 

I'm planning on going back, and completing my Computer Science degree, which *should* give me some flexibility moving forward. If things get much worse here, I've got to find someth... No. Hopefully, it won't come to that. :sigh:

[/gripe]

Edited by BlackBox
I always spot the typos AFTER I hit the button!
Posted

Yep. Actually after I've looked at Kean Walmsley's Python in Acad, I thought: "How hard could it possibly be for ADesk to simply upgrade AutoLisp to something using ECL (or similar)?" In such case they could make something which can be interpreted and/or "truly" compiled to near C/C++ like optimization. And with the added benefit of enabling CommonLisp's object orientation and thus also making it a lot simpler to link to DotNet namespaces ... or even the ObjectARX classes. Actually the "hardest" part would be to re-implement the AutoLisp- / VisualLisp-only defuns - but those could be implemented in lisp itself, simply linking to the ObjectARX classes (to make the existing LSP files backwards compatible).

 

Then all that's needed is revamping VLIDE into some half-decent editor! And face it, there's literally hundreds of open-source (or otherwise) editors out there which could be used as a base.

Posted

Irneb have you looked at LISP2C I am suprised theres no LISP2net

Posted

That's probably an option, though I'm not too happy with simply converting LSP to C source and then compiling to EXP/ARX. That would probably not work on a Mac then now would it?

 

The ECL has an option to interpret source code, or compile it to bitcodes (similar to what Java does [and what DotNet DLL's is supposed to be] so it then can run on any environment if you've got the BitcodeInterpreter - which is available for Win/Linux/Mac already), or compile to machine code (which is basically the same as converting to C and compiling).

 

It's actually a problem with DotNet: The whole idea was that it would be environment-independent. Thus you should be able to "compile" and have that compiled file run anywhere: 32bit/64bit/Win/etc. But thus far it mostly only runs on flavours of Windows, I've only seen moderate success through Wine on Linux (which is rather defeating the purpose). Anyhow DotNet is just too easy to break apart:

 

So I think the Lisp2Net idea isn't as good as it first appears. At least for the purpose of this thread.

 

Anyhow, you're referring to Lisp2C right? That only seems to have the ability for compiling to R12/13 ... not really much use these days. Otherwise you could look at Lisp2ARX. But again, this means you need to compile for each version of ACad, and it would probably not work on Mac.

 

This is why I've always said: An interpreted/bitcode compiled addon language would make ADesk's life sooooo much simpler than fiddling with ARX and the not-so-portable DotNet. And they've already got one which they simply need to extend in order for it to work with their new entity types. I'm just "proposing" they upgrade that language to be in-line with its big-brother Common-Lisp, which would open a lot of other doors for addon creators! Not to mention it would make the "extending" of AutoLisp a breeze in comparison.

  • 2 weeks later...
Posted

Any little lisp tool I write for our cad users, I have a on thumb drive. All that the users have access to is a bunch of .fas files, including acaddoc.fas. There's a standing wager, anyone that can restore any one of the .fas to the original .lsp will get $100. It's been over a year, and I haven't paid out a dime.

 

There's been attempts by them finding a similar code online, or trying to write a new one. Since I have the originals I can obviously tell if it's right or not.

 

I've not noticed any issues with useablity of the .fas files, they load and run just like .lsp, but our self-proclaimed programmers can't edit my stuff to their individual likings. I have it this way because all lisps are server based; change it for one person and it changes for everyone, unless I filter by user. Which I do for some, but the users don't think that broadly. I know this, cause it's happened.

 

For my dcl's, I took the route that the creator of Mastermind did (Lee Mac?). I use the lisp to create a temporary dcl, then delete it at the end of the routine. This way, I can change the lisp centrally and the user's dcl will always be current. I don't have to worry about checking for a current file, or overwrite, just create/delete. The compile the .lsp to .fas, call it with acaddoc.fas to load, and the user knows nothing except a command.

  • 1 year later...
Posted
Just a suggestion if you can protect your code bury something in it like serial number check smarter is something of pc bios or registry its no good protecting it, if some one can just copy it and use it. There used to be a subtle difference between mac & pc lisp versions but basicly will run on either I would expect now.

 

A true story !!! got phone call software will not work installing on a new computer a couple of questions later sorted out, was trying to install on a different company computer without paying us for the privilidge he got caught out bad trying to pirate.

 

as a start add this to very lisp

(setq run (getvar "_pkser"))
(if (or (= run "440-123456789")(= run "440-123456780"))
(princ "\nSecurity check passed")
(progn
(princ "\nYou have tried to run my software on a non authorised machine")
(princ "\nPlease contact me  123 456 789")
(/e)
)
)

Where to get this code ? "440 to 123,456,789" "440 to 123,456,780"

Posted

That "code" is in fact the serial number of your AutoCAD installation. Just above in code you will see that it is retrieved from an undocumented system variable named _PKSER.

And "-" is just a hyphen joining the two parts of the serial, doesn't have a "to" meaning.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...