LabVIEW - How to shorten the path of a .net Refnum - labview

I am currently having the issue, that my VI can't read a .dll File, because the path is too long.
Is there any way to shorten the path of a .net Refnum?

My Path had a percent symbol in it.
I replaced the symbol with an underscore and now it works. It seems like, that when it comes to opening a .dll file, LabVIEW doesn't like %.

Related

How to avoid long paths in code built with CMake

I am using CMake to link and build my C++ project, and in said project I am using the fstream library to read from a file. However, when passing the path of the file to my code, I am forced to use a long string such as "../../../../folder/folder/folder/file" to properly reference which file I want opened. I presume this is because my .exe that CMake creates is buried deep, "far" away from my source code, which is why I would have to backtrack so much.
I am wondering if there is something I could put in my CMakeLists.txt to potentially allow for the shortening of this inclusion path.
To save myself some time I have not included my file structure as of now, but if it is needed in order for a solution to be formed I certainly can edit and add it in. I do not necessarily need a case-specific solution, rather just a generalized method in which I could go about doing this.
It looks like CMake doesn't provide such functionality , CMake doesn't do much with execution of your application.
So, For solution you have following
can either create a shell script to copy the file into the desired location which can be picked by the executable and shell script can be run while make process
pass it as a commandline argument to your c++ executable.
create a macro with this location and use this macro in the source file : - CMake can help you in this
Using add_compile_definitions( ...)

Add versioning & company info to Mono DLL using Mono Compiler (mcs)

I'm using MCS to compile some code into a DLL. Plain console compilation, no Visual Studio or similar. That works, the DLL works well.
But I'd also like to add some meta data to the DLL, so that (under Windows -> File properties) the company name and version etc. are visible.
I already tried around with .resx files, created some but that didn't help. Maybe I misunderstood the resx-thing.
The way I did it with the resx file: create a new text file, add the lines
# A list of personal data
company=myCompany
So I guess that was wrong.
How can I add such meta data to my DLL?
Thanks, K1

how to edit dll archives?

okay, so i dont really know much about DLLs. but i need to edit some of them. ones that seem like archive files.
such as: firefox's xul.dll, windows/twain_32.dll
when i tried to open them in .NET Reflector, it couldnt open them. and a really downvoted answer on here made me realize they can be opened with 7zip, and seem to have files inside.
i can extract the files, but cant edit the dll, and i dont know how to create a dll like this. i dont have visual c++ or basic, and i dont know if i could do this with them.
thank you in advance, or how to say
A dll file usually contains program code (that is: binary code you can not easily understand). Some dll files may also contain resources, which can be sometimes edited with a resource editor (such as ResourceHacker).
dll files are no archives and their primary usage does not include holding files. Resources normally are rather small data elements such as icons.
Edit: If you open a dll file in 7zip, you will see some virtual files (which are no real files but sections of the binary object file, see symbol table and relocation table in object file for example) along with a virtual folder .rscs (abbreviation for "resources") that contains the mentioned resources you can edit with a resource editor. Again, remember these are not files. 7zip only displays them in a way you may think of files.
The object code inside of .text, .data and .reloc contains binary program code and initialization data along with the reallocation table. It makes no sense to edit those information unless you use a disassembler, can understand the generated assembler code, know about the pitfalls of disassembling, make senseful changes and are able to reassemble the code.
Not that even if you did so, you'd apply the disassembler to the whole object file instead of single sections.

Windb getting .dmp file to work

I have a program that uses different dlls and it crashed.
I am trying to work out the cause of the crash using WinDbg but I am having no luck so far.
I have the .dmp file but I have tried addig that as the symbol path, I have tried adding the dlls in th symbol path also and a few other things but it keeps telling me it could not find myprogram.dmp/symbols etc or just that the symbols could not be found.
What is the right method to get it working with the .dmp file?
Thanks I am new to this and finding online documentation only seems to help for programs that don`t have DLLs and other non built-in DLLs.
Example of some of the errors:
* ERROR: Symbol file could not be found. Defaulted to export symbols for mydll.dll
* ERROR: Module load completed but symbols could not be loaded for myprogram.dll
PDB not found : c:\users\me\desktop\myprogram.dmp\symbols\dll\ole32.pdb
I managed to load the default windows symbols adding the downloaded symbols to the symbols path. Must I add DLLs I am using in my project to the symbols folder or something?
PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS
C:\Users\me\Desktop\Assignments\4. DPI-600 Testing\DumpFileDebugging\symbols
First, set up a path for your private symbols. Let's call it X:\mysymbols. Copy all PDBs into that folder, just as a flat list. In WinDbg, set the symbol path to that folder
.sympath X:\mysymbols
Next, let WinDbg find the Microsoft stuff. Create a folder X:\microsymbols. Put nothing inside and do not use the same folder as X:\mysymbols. Add that folder to the symbol path:
.symfix+ X:\microsymbols
Now that everything is set up correctly, tell the debugger to refresh:
.reload
In rare cases only a
.reload /f; ld *
helps.
If you're still unlucky, try
!sym noisy
so that the debugger tells you what exactly is wrong with the symbols. Look up the error messages and try to fix them.
If it still goes wrong, you might simply not have the correct PDBs. PDBs are correlated to modules (DLLs and EXEs) by a kind of hash / timestamp. So either get the correct PDBs or try
.symopt+ 0x40
which forces the debugger to load whatever he gets without checking the hash. Be aware that callstacks etc. may be misleading if they are too far off.

What is the most easy and fast way to edit PE executable file to make it load specified DLL at startup?

I need to make some exe file to load my DLL at startup...
What is the easiest way to do it?
I need this exactly, no any injectors or starters.
I though about adding one more code section into exe, rewriting to there entry point logic and placing DLL loading code, then NOPing original entry point and calling my custom made entry point function. Will this work?
Are there any other easer ways?
I also thinking about changing one of system dll name in hex editor to name of my DLL. Will this work? If my dll then load that replaced system dll?
Any thoughts?
Adding it to the PE's import table should be enough. Woodman's lists a few tools which can do it:
http://www.woodmann.com/collaborative/tools/index.php/Category:Import_Editors