Find Programming Language Used

2019-01-10 08:39发布

Whats the easiest way to find out what programming language an application was written in? I would like to know if its vb or c++ or delphi or .net etc from the program exe file.

14条回答
小情绪 Triste *
2楼-- · 2019-01-10 09:20

In general, you can't.

If you can load it into Reflector, you know it is a managed assembly.

查看更多
混吃等死
3楼-- · 2019-01-10 09:26

You could try using Depends to see what runtime dependancies it has, which might give some clues.

查看更多
趁早两清
4楼-- · 2019-01-10 09:27

There is an art to detecting what language a program was written in. It is possible but there are no hard and fast rules. It takes a lot of experience (and it also leads to the question "Why would you want to..." but here are a few ideas on how to go about it.

What you're looking for is a "signature". The signature could be a certain string that is included by the compiler, a reference to an API that is quite common in the programming tool being used, or even a style of programing that is common to the tools being used, visible in the strings contained in the application.

In addition, there are styles to how an application is deployed: various configuration files found in the deployment directory, dlls and assemblies and even images, directories or icons.

Java applications wrapped in a self-launching executable will contain references to java libs, and will likely have certain libraries or files included in the same directory that indicate that it's java.

As indicated in other answers a managed assembly will show certain signs as well: you can open it in Reflector etc. While it is correct that c# and VB are "interchangable" once compiled, it is not true that they are identical. If you use Reflector to disassemble VB code you will quite often see that the assembly references the Microsoft.VisualBasic.dll assembly. You'll be able to tell the difference between Mono applications because they will most likely contain references to the mono assemblies.

Many compilers assemble and link code in certain ways, and leave footprints behind. For example, examining a window executable using "strings: tab in Process Explorer, you'll see a lot of strings. Using these you may be able to determine programming styles, methods called, error or trace methods withint the exe.

An example is that compilers use different mechanisms for localization: Microsoft stores localized strings in XML files or resource files. Other compilers will use a different tactic.

Another example is c++ name mangling. The CodeWarrior compiler uses a different algorithm to mangle the names of the member variables and functions of a call than Visual Studio.

I suppose you could write a book on the subject of accurately determining the lineage of any executable. This subject would probably be called "programming archeology".

查看更多
甜甜的少女心
5楼-- · 2019-01-10 09:30

Try PEiD

of course if they used a packer, some unpacking will need to be done first :)

查看更多
贼婆χ
6楼-- · 2019-01-10 09:30

The easiest way is to ask the developer of the program. It does not require any knowledge and utility programs.

查看更多
趁早两清
7楼-- · 2019-01-10 09:30

you can check is that a .net assembly or not by trying to open with ildasm.exe tool

查看更多
登录 后发表回答