LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

decompiling a program

I have a client who has been running a compiled LV program. They now would like to make some changes to it but can't seem to locate the original LV code. Is there a way to "decompile" the program back to its original LV source?

 

Thanks,

 

Bob

 

0 Kudos
Message 1 of 13
(4,371 Views)

All together now....NO.

 

You can't get the source code from a C++ application.  Why would you expect anything different from LabVIEW?  A executable is nothing but compiled machine language.  There is no code to be had from it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(4,367 Views)
All VIs are compiled. You mean a built application and no, you cannot recover the source code. The block diagram is gone for good.
0 Kudos
Message 3 of 13
(4,365 Views)

I didn't think so but I thought it was worth a try.

 

Thanks,

 

Bob

 

0 Kudos
Message 4 of 13
(4,343 Views)

To be clear, executable do contain VIs (in recent versions, the EXE is basically a zipped folder containing all the VIs), but unless you explicitly set it in the build (something that seems unlikely in this case), all the BDs will be removed as suggested.

 

And while the EXE is basically a zipped folder, I don't think you can simply open in a decompression program any more, although this might work with older versions of LV. It's been a while since I played with it. It is generally also possible to set VI server settings in the app's INI file and use that to connect to it and possibly find some of the structure of the app (although I'm not sure if the specific properties are available from outside), but I would say it's not worth the effort, due to the unlikelihood of the EXE still containing the code.

 

Most likely this means the code will have to be rewritten, but I can say that if they know where the code was and it was simply deleted or moved accidentally, the automatic backup capabilities of a modern OS might help them to recover it (in Windows 7 this is right clicking a folder and selecting Restore previous versions to see the backup history). Alternatively, if they don't do much LV work, the recent projects list in LV might reveal where it is. If they do do much LV work (and even if they don't, actually), a proper backup system is in order (and ideally a proper source code control system).


___________________
Try to take over the world!
0 Kudos
Message 5 of 13
(4,305 Views)

@BobHorn wrote:

I have a client who has been running a compiled LV program. They now would like to make some changes to it but can't seem to locate the original LV code. Is there a way to "decompile" the program back to its original LV source?

 

Thanks,

 

Bob

 


I'm going to go off the reservation here.

 

The code got compiled to a target.  A compiler existed to compile that code for that target.  Certainly there is a way to decompile it!  It might take a jillion engineers years to do so but, there is a way (Probably involving an EULA violation so, don't try)

 

Get the source code!


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 13
(4,284 Views)

Appreciate the info. This was written many years ago by a third party so the client doesn't have any of the source. It's an oil field services company and they never heard about backup or source code control. I've had to redo several of their LV programs because of hardware changes and the programs were password protected but nobody knew the password.

 

Bob

 

0 Kudos
Message 7 of 13
(4,278 Views)

I can help you out if you ever get in a jam with another password protected VI.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 8 of 13
(4,272 Views)

I'll keep that in mind.

 

Bob

 

0 Kudos
Message 9 of 13
(4,264 Views)

Since it's an older version (presumably pre-2009), the EXE is basically a flat LLB. IIRC, you should be able to rename it as an LLB and then open it in LV and see the VIs and even open them and see the hierarchy, which might help you in understanding the structure, but as you describe it, it's likely the code will be better if you start it from scratch.


___________________
Try to take over the world!
0 Kudos
Message 10 of 13
(4,204 Views)