Jump to content

Rolf Kalbermatter

Members
  • Posts

    3,837
  • Joined

  • Last visited

  • Days Won

    259

Everything posted by Rolf Kalbermatter

  1. That's not scripting but an intentional feature when properties were introduced. There isn't much else you can do on a running VI if it's not done in a control as data change.
  2. I'm not sure how this stuff is implemented, but could it be simply so that the according license file is added as a resource to the executable? In that case it should be possible to hack the resulting LabVIEW executable to include this resource in its resource directory. Finding out the resource type and ID would then be the only challenge left to do.
  3. If you happen to include the VISA runtime installer into the application installer you have to make sure to also add the NI-Measurement & Automation Explorer in the Additional Installs settings. DAQmx allows to select several different Install Types with most of them including MAX. VISA runtime only contains the runtime but at least in newer LabVIEW versions you can select MAX as an extra component.
  4. There is the hardware limitation for sure. A device oriented USB connector should be a USB-B connector not an USB-A connector. I haven't seen a single computer hardware with USB-B connectors so far. Electrically there is not really any difference but the software stack is again different. I'm pretty sure that it would be possible to write a USB device stack for XP but that involves going into kernel mode. Maybe, just maybe, it could be possible to emulate the device stack in user space on top of a library like libUSB or the native Windows USB device driver API, but that only would alleviate the device driver debugging issue, not the whole trouble of implementing a valid USB device stack.
  5. Your reasoning mixes again two rather unrelated things. That of hacking password protected VIs and that of hacking the LabVIEW license. For both you do need to to dig into disassembly if you don't want to go the brute force attack through GPU path, but they are not directly related to each other. I haven't looked at the details for some time, but from what I saw earlier the license generators you could find were always tied to very specific LabVIEW versions. I think the license technic hasn't changed since about LabVIEW 7.1 so it might be possible to generate a key generator that works across versions, but I don't know. I'm not sure if there is a single person who knows how to open password protected VIs in all possible LabVIEW versions, but I'm certain there exist people who can open password protected VIs in certain versions of LabVIEW. And they don't work for NI, as NI has of course the ability to work on the source code directly to circumvent such protection. This means, don't trust your super secret 5 million dollar idea to password secured VIs but also don't expect or require NI to provide such a possibility. It is technically simply not feasable to create a really secure protection without at the same time throwing away the advantage of not having to remove the diagram and making a VI only readable in the specific version and platform it was created in.
  6. It's a violation of the license agreement indeed, though I doubt a hacker feels much bothered by that . The other issue is that you need to do disassemble and that is not trivial. It is made extra hard by the sheer size of the LabVIEW executable nowadays. Even a very good disassembler takes a few hours to get a raw disassembly for such a huge executable. And then you can sift through million lines of assembly code to find the places where the MD5 hash is checked. And looking at assembly for even a 100k DLL is already a rather boring job. The fact that every half year a new executable is released makes the task even more hopeless. So while I'm sure there exist hackers who have hacked one or two versions of LabVIEW to that extend they really won't keep on doing that over the years as the gain of this is minimal. There is very little you can really see from most password protected VIs. Bragging rights don't apply because if someone does that, he might get a cease and desist letter or even worse, signed by the legal department of NI. I have at some point looked at the possibility to simply modify the VI and that seemed just as hopeless. Especially with VI libraries involved, which contain also a password whose hash is even out in the clear in the library XML code. And those passwords even seem to be interwoven with each other. As to the licensing. I believe there exist Key generators to fake-license LabVIEW installations. Never mind that most of those key generators have also some stealth load inside, that packs a few viruses and/or troyans on every computer they are executed on. After all why should a hacker who doesn't respect intellectual property respect someones privacy?
  7. In order to deal with LabVIEW Variants on the C side of the fence you need an API that exists but is undocumented so far for people not working at NI. LabVIEW Variants are really C++ type objects so with just flattening or whatever you won't get far. And the way to pass variants to the Call Library Node is not as Interface To Data but simply as LabVIEW data. So any of the other three options though it won't really make any difference which you chose as they don't apply to data other than arrays or handles.
  8. Where does the licensing scheme even remotely touch password security of VIs? Anything license related is really handled in the LabVIEW kernel itself so not sure what the ability to unlock a password protected VI would do there. Following is not directed at you Shaun but at anyone being high in the arms about the insufficient protection password protected VIs give them to protect their oh so precious IP: Password protection of diagrams is not meant to protect your IP. There exists only one really secure way to protect your IP, and that is to put it in a heavy steel safe, destroy all copies of your idea and dump the safe in the North Pacific above the Mariana Trench. Save of some alian race with super high tech, nobody will be able to get at those secrets. Chances are however high that someone else has already developed the same idea independently and will go to market with it and earn some money with it. Another slightly less secure means is to hire a whole army of lawyers who will involve anybody into a legal battle who might even just appearing to try to steal that IP, so that they can fight for the rest of their life, robbing them of any time to invest into monetizing the stolen idea. Both of them are highly unpractical and costly! Get over it and accept that password protection of diagrams is only to keep out the nosy. If you do need to protect your IP don't distribute the source at all! Bite the bullet and remove at least the diagram. Yes it's inconvenient as such VIs can only be loaded into the LabVIEW version in which it was created and also only on that platform but anything else means LabVIEW has to be able to get at the diagram somehow without knowing the password (or worse yet store the password in the VI somehow too) and that also means that anybody with enough determination will be able to circumvent any kind of protection the LabVIEW developers can come up with to prevent others than LabVIEW itself to get at that diagram. I think the best long term protection in that respect is actually the semi annual release cycle of LabVIEW as it obsoletes any of the more promising hacking solutions each time.
  9. I have used in the past HelpMaker from vizacc.com. It used to be a free tool but there was some hickup in who is going to maintain it some time ago. Not sure about the current state, it got confusing and I haven't used the tool in a while.
  10. I'm not sure this is turned off by default, but I don't like autoinserted feedback nodes at all. Yes they are equivalent to shift registers, (since about 8.5 even in performance) but I prefer the more familiar shift register added explicitedly by myself than an automagic feedback node that is in my case in 99% not what I want.
  11. Occurrences work a bit more complicated. I have to admit that my memory is a little foggy about the exact details of this, as it has been several years that I struggled with this for a rather complicated infrastructure, involving use of occurrences also in external C code. But from what I remember, once an occurrence has triggered it is in the set state (to use a more common concept of ResetableEvent as analogy). When a WoO executes for the first time it looks at the state and when ignore previous is true it will USUALLY wait even when the occurence is currently in the triggered state. When it is false it will just continue when the occurrence is in the triggered state. In any case when WoO returns without timeout it will reset the state of the occurrence for this instance of WoO only. Next time around this WoO will use its local state to detect previous triggers when ignore previous is false. Other WoO instances will not influence the behaviour of this WoO in respect to detecting previous triggers. But a specific WoO can only wait once on a trigger eventhough you may have ignore previous set to false. What I encountered sometimes was that the occurrence could get triggered the first round around even when ignore previous was true AND the trigger event had clearly occurred before the wait executed. My solution was to use the occurence as an indication that something might have happened and when WoO returned without timeout to actually check for the data to have arrived and if it didn't so far treat it as timeout anyhow, usually looping once more for an event. This was back in LabVIEW 6 or 7 days and I have since always used occurrence in a way that was tolerant to this behavior. At first I considered it a bug of the occurrence but some discussions let me believe that it was an artifact of concurrent programming that can't be completely avoided and use of this should always be prepared for this possibility. NI might have changed something in the occurrence handling since and it may not behave exactly that way anymore, but I wouldn't really notice as my implementation is tolerant to the old behavior but of course won't break on an improved behavior of the occurrence. As to a case where occurrences have an advantage over the other asynchronous objects in LabVIEW: If you want to be able to trigger an event from external C code the only native LabVIEW objects that are to my knownledge available for this are Occurrences since LabVIEW 3 or 4 and User Events since LabVIEW 7.1. None of this is well documented but there are for both semi offical NI examples floating around. Wait on Occurrence had that as long as I can remember. (But my long term memory is sometimes a bit fuzzy so it may not have been there in LabVIEW 3. It's definitely there as far back as LabVIEW 5.1, I just checked. ) Using (undocumented) LabVIEW manager calls, one can create dynamic occurrence refnums. I have done so in the past for a data logging application, giving every single channel tag its own occurrence so clients could wait on value changes easily. Worked like a charm even for several 100 channels. All the LabVIEW refnums created (except those created by the LabVIEW manager calls directly unless you use some other manager calls to register those refnums for automatic cleanup) are suspectible to automatic cleanup on termination of the hierarchy that created them. So they do get cleaned up eventually. Static refnums vs. dynamic refnums has always pros and cons on both sides. Try to execute Create Occurrence in a loop to create several occurrences for a varying number of objects. It won't work as expected. So while dynamic refnums do require extra care from a programmer to properly cleanup after use, they also offer much more flexibility. For the same reasons you could vote that string constants should be static to avoid a LabVIEW user creating memory hogs by wiring it to an autoindexing loop boundary of an infinite loop. But that would possibly render LabVIEW even turing incomplete as you could not deal with a lot of common situations anymore. Yes notifiers and occurrences are similar but a notifier can have a data item attached to it, while an occurrence only carries the notification event itself.
  12. On a sidenote on this. I just noticed that the luaview mailinglist at luaforge was shutdown as part of the downsizing of that site to a mostly static project directory. Do any people here have recommendations for a mailinglist provider, that we could use for a replacement? Until we have something else in place as a public mailing list the email addresses luaview-info(at)citengineering.com and luaview-bug(at)citeengineering.com can serve as an intermediate solution, but I would prefer to have a public accessible mailing list for the longer run. Running our own forum solution is unfortunately a to heavy-weight solution for such a project .
  13. Occurrences are the underlaying functionality of all LabVIEW asynchronous operations. However they have a few limitations in itself. 1) They don't allow for any data to be associated to them 2) They have somewhat confusing semantics 3) You can get a triggered occurrence from set occurrence invocations that happened before the wait occurrence was called even when ignore previous is true. This can be worked around easily by checking for the actual event in some other ways and reentering a wait if the event wasn't really true, but one needs to be aware of it.
  14. I don't think a wire stores any data in LabVIEW. However you may want to look into custom probes. They basically do what you want, though you have to place them manually (well maybe scripting supports them too :-) )
  15. You didn't happen to go from one platform to another? Remember Windows 32 bit and Windows 64 bit are completely different platforms when compiled code is concerned and CINs are simply compiled object code. Change between Mac, Windows, Linux and VxWorks are anyhow different platforms. As long as you stay in the same platform, CINs should still load fine in LabVIEW. However I don't beleive CIN tools have been ported to Win 64 Bit so don't expect to be able to create CINs for that platform. To port a CIN you would anyhow need the source code as you need to recompile it. Even if they wanted they couldn't. The actual CIN is just as different as a DLL for different platforms. There exists no good translation to convert a 32 bit DLL to a 64 bit DLL, that I would know of. The solution is to take the source code and recompile. Without source code it's a though cookie.
  16. It's a bug in the sense of a user error. It's not really a bug in LabVIEW itself as it does perfectly right what it is supposed to do.
  17. Yes I do happen to know about LuaVIEW and its future. We haven't yet defined an exact timeframe of when and what things will happen, but expect LuaVIEW to be maintained and even improved in the future. A few things in the pipeline though no promises they will all be released: - Fix some minor errors in newer LabVIEW versions with the unit tests - Make the LuaVIEW core a shared library instead of a CIN - Provide direct VISA and .Net interfaces in LuaVIEW from a script - Make it's distribution VIPM compatible - Get it Lua 5.1 compatible - Add additional targets (x86 Mac, x64 Mac, x64 Windows, possibly cRIO VxWorks)
  18. And just to add a bit to it. Even if you find that location where the password is checked, things get a lot more complicated if you take password protected libraries (and maybe classes) into the picture. Those do not use the same code paths to check for password protection and the passwords of each are actually used in the hash of the other.
  19. Yes you are not supposed to do that and I can't guarantee that it works for 64 Bit OSes. I treated it so far simply as a NumericArray of 32 bit integers for 32 bit OS and 64 bit integer for 64 bit OS, but never really tested any code on a 64 bit system so far. As to handles passed by value: Yes you can assume that they are not null, as you rightly have reasoned that you could not resize them in your code then. It still means that the pointer inside the handle can be null but DSSetHandleSize() should be able to deal with that correctly.
  20. The VI in VI lib should work. It may use a different API internally, if NI hasn't updated it, but should in fact do the same. Early on when networking was really sort of an addon API in LabVIEW (~ V 4) there existed a function to retrieve all kinds of internal parameters. One of them was to get the associated network socket of a network refnum. But that function ultimately called the predecessor of NCGetRawNetObject() which wasn't exported back then. Being a standard VI lib function it should solve your source code control issues.
  21. The rules are simple C programming rules. If you pass an array of handles to C code and resize the array size, you are fully responsible to deallocate any elements that are occupied by the previous array beyond its new size and to allocate any elements thathaven't existed before in the array. Additionally you have to make sure to resize any existing handle to the required size before you modify its contents. And your last remark about that who allocated it also needs to deallocate it, that is ambiguous at least. In C the caller is usually responsible for both since there is no standrad way of passing ownership of memory between caller and callee, but APIs can decide to change that, by allocating and returning memory, but that has to be specifically documented by the API and such an API better provides a function to allow the caller to deallocate that memory later on, since the malloc/free from the API may not be compatible and not even refer to the same heap than the malloc/free of the caller. In LabVIEW the situation is different. LabVIEW uses a standardized memory manager throughout, so this limitation does not exist. Whoever holds onto a handle is responsible to manage and eventually release it and all of its contents. For a C function being called by LabVIEW with native handles, this means you may get in a handle, you may modify it and allocate/deallocate any handles therein, provided you also keep the related information such as the array size consistent. If you then pass the array back (which you basically always do if it is in a value parameter, and usually also if it is a reference parameter, you pass on ownership of that handle back to LabVIEW and it will need to manage it from thereon. An additional tidbit you should know is that LabVIEW uses for performance reasons often a null handle when an empty handle is required, but treats an empty handle also correctly. So your C code needs to be prepared to handle an array of 1000 empty strings to be really an array of 1000 null handles, meaning when you want to write something into these strings you can not just do a DSSetHandleSize() as that will crash on a null handle. Instead use NumericArrayResize() with element type uB, as this function gets the handle passed by reference and will correctly allocate a new handle if it was null.
  22. Well there are two open sources projects you can try to find and check out. The first one is libopenSRTP and the second one is Visual HMI, both from the same author. There also used to be a GEFCOMM Visual Basic example around from someone from GE Fanuc support but not sure if this is still available anywhere. I found the VB example here: http://forums.mrplc.com/index.php?app=downloads&showfile=574
  23. It might work! I'm not sure about the array of pointer sized integers though. On the LabVIEW diagram they are always 64 Bits, but possiby LabVIEW does the right thing here and only converts to a 64 Bit value when passing it to an indicator. That should be indicated with a coercion dot IMO, but it isn't.
  24. You need to write a C wrapper function for that. LabVIEW strings are not the same as a char*, so creating an array of LabVIEW strings does something quite different than char**. Besides, char ** is rather ambiguous anyways. It could be an array of string pointers as your API expects it or it could be also a reference to a string pointer. Basically you need to write a C function that increases every LabVIEW handle in the array with one character annd fill in the terminating 0 char there, then create an array of pointers where you fill in the string pointer extracted from the LabVIEW handle. Something like this: typedef struct { int32 len; LStrHandle elm[];} **LStrArrHdl;yourtype LVfunctionWrapper(....., LStrArrHdl arr, ....){ int32 i ; char **ptr = malloc((*arr)->len * sizeof(*char)); if (!ptr) bailout; for (i = 0; i < (*arr)->len; i++) { int32 len = LStrLen(*((*arr)->elm[i])); LStrHandle h = (*arr)->elm[i]; err = DSSetHandleSize(h, len + 1); if (err) bailout; ptr[i] = LStrBuf(*h); *(ptr[i] + len) = 0; } retval = yourfunction(......, ptr, ......); free(ptr); return retval;}
  25. I had created a 64 Bit version last year already using the Windows SDK command line compiler but it crashed somewhere. And I still need to get a 64bit development version of Visual Studio installed to do some useful debugging. So that will take some time and probably some fiddling around to get working properly.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.