I made a program using VB and I lost the source code but I have the exe file. How can I extract the code from the exe file?
Assuming your exe is a .NET assembly (you tagged the question as VB.NET), you can reverse engineer your exe using tools such as Reflector.
If it's VB.NET you can use the RedGate Reflector tool and the FileDisassemler plugin to generate the source code. That is if the exe was not obfuscated
Since you tagged your question vb.net you might be able to retrieve quite some portions of your code using a .NET disassembler. For example try Lutz Roeder's .Net Reflector or MS ildasm which comes with the .NET compiler.
Use Reflector (assuming .NET) to dissassemble the exe back into code. You will need to create your own class structure, but you can recover the code as any of the supported CLR languages.
Have you tried Salamander, or one of the many other .net decompilers?
Trey VB Decompiler and see if that works.
Related
I heard that it's possible to import a c# file and use it's functions in a vb.net application? I have a C# file with a lot of functions, that I want to use, however, I don't want to convert it to vb.net (would take time). Is it possible? Thanks. HOw?
Compile it, and reference the DLL.
Is one able to compile VB 6 code in Visual Studio.NET ? In other words, is it backwards compatible with older VB code?
Since I know there is a difference between managed code (.NET) and unmanaged code, I am wondering if Visual Studio.NET is able to compile unmanaged code as well?
Kind regards,
Kris
While you cannot compile vb6 in the .net Visual Studios, you may use interop libraries to allow vb.6 to utilize managed code
http://msdn.microsoft.com/en-us/library/kew41ycz%28VS.71%29.aspx
No, you can't compile VB6 code in any VS.NET version.
You can open a VB6 .vbp project file in Visual Studio. This automatically invokes the project converter, it will try to translate your VB6 code into VB.NET. The translator does a fairly decent job of it but the VB.NET language has changed pretty drastically. It depends on how 'clean' your VB6 code was.
After the conversion is completed, you'll have to walk through the list of warnings and errors you'll get. Getting none at all is rare. There might be hundreds or thousands. If you're in that boat, it starts making sense to rewrite the code.
Anyhoo, just try and see what hits the fan. You'll have a good idea what you're in for in about ten minutes. Don't forget to copy the project before you start the conversion.
No it is not compatible. I think there is an upgrade wizard, but you will end up fixing some stuff manually.
Does VB.NET have anything similar to Java's JDK source code? When I used to work in Eclipse, I could right click and view the generated code, or "look under-the-hood" so to speak. I found this feature very helpful in understanding what was happening behind the scenes, and it helped me to write better, more simplified code.
I have so far been working with Visual Studio 2010's Object Browser, and I have also been looking at the generated designer files, but these often do not drill down far enough.
The best program to do this is called .NET Reflector and you can download it from here: http://www.red-gate.com/products/reflector/
It lets you see executables and DLL's under the hood
ScottGu has an old blog post about this:
http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx
You can also use the .NET Reflector to peek into the code for any .NET dll, but keep in mind it won't look like the code in Visual Studio :)
http://www.red-gate.com/products/reflector/
When I add my vb classes to my C# project in vs 2008 they are readily available to be used in my c# classes. But for some reason 2010 can't see them. I could be missing something simple but i couldn't make it work in the past hour. Any ideas?
Are you sure you had them included with action compile and not just action content?
CSharp and VB use two differnt MSBuild targets file and I've never heard of mixing them in the same project file. Different project types in the same solution - sure, but not what I think you are saying.
Of course it's a strange world so maybe someone will come by and suprise me with something I never thought possible outside of ILMerge after the build.
you can't mix 2 code languages. like you can add vb and vb, c# and c# but not vb and c# together.
If you do want to mix, use a code converter like c# - vb or something. Here is one to try instead of re coding it all again: Vb.net --> C# converter.
It may not be 100% working but at least you'll convert some code.
I have some C# source code that I got off the Internet and I want it in VB.NET. How would you convert it because I don't know C#.
I found multiple translators after performing a simple search, but this one looks kind of cool. No installation necessary!... though I have never used it.
Another way is compiling it to, dragging the assembly to Reflector and then decompiling it to VB.NET
If I recall correctly, you can have multiple source languages in the same project. They just have to be in different files. You should be able to call the c# class from a vb.net class without any major problems. This may not be the prettiest option, but it might work for your situation.
You can have a VB project in the same solution as a C# project, and use classes from either from the other, but you can't have both VB and C# source files compiled in the same project.