How to identify the Programming Language used to Develop a Software? [duplicate] - reverse-engineering

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Find Programming Language Used
So, I have an application consisting of an executable (exe) file and a DLL. Is there a way I can find out the specific language used to develop this software. I tried opening it in a disassembler but the contents seems garbled. Any ideas?

In principle, the answer is no. In practice, however, there are only a few choices:
If the .dll name looks like something.dll, it's probably a native dll image, which means it was probably written in C or C++.
If the dll name looks like Namespace.Something.dll, it's probably a managed dll, which means it was written in some .NET language (C#, VB.NET, etc.)
You can check the dll imports for more information. If the dll uses mscoree.dll then it's a .NET dll (even if it doesn't follow standard .NET naming conventions). It may also use other language-specific dlls that provide additional clues.

Open the .dll or .exe in a hex editor and search for the word "copyright". Most compilers put the copyright message of the runtime library into the executable in clear text.
Get IDA pro. http://www.hex-rays.com/idapro/ That is the tool to work with binaries or do reverse engineering. It will be able to find out the runtime library and maybe also the language.
Evaulation and freeware versions of the tool can be found here: https://www.hex-rays.com/products/ida/support/download.shtml

Unlikely, unless it has a significant runtime library that gives it away. e.g. VB apps used to require a huge DLL with VB in the name, Visual C++ apps usually require the C++ runtime to be installed. But modern languages target language-independent runtimes. Even Java .class files may have come from a wide variety of source languages.

Related

Load Assembly Sources into IDA

I have a large codebase written in assembly that I need to maintain.
Exploring the existing code is tough with text editor's syntax highlighting being the only helping tool.
I was considering to use IDA tool to assist with this task. It has many nice features for exploring assembly code. So I downloaded the free 5.0 version for evaluation.
Unfortunately, I am unable to locate an option that provide the ability to open an assembly source file. All the "open" options do is to dissasmble binaries, but this is useless to me as I already have the source code inclding all the comments and human readable symbols.
It is hard to believe that a tool with so many features lacks this basic capability. So what am I missing here?
IDA, as stated at its website, is a Disassembler. It was developed to find out what a program does WITHOUT the assistance of the source code, not the other way around. Why should anyone try to employ the complex and time-consuming techniques available in IDA to discover what a binary does if all they have to do is take a peek at the original code?
IDA is NOT a development tool, it is a reverse-engineering tool. You should look for an Assembly IDE for the task you seek to complete. Maybe RadASM provides what you are looking for.

How do you use existing C libraries with the Chrome Native Client?

I'm new to Chrome Application development and the Native Client/PNaCL pipeline. I'm a bit confused over the process of using existing C code/libraries in a chrome application. The FAQs and NaCL official docs suggest that using existing code is easy, and one of the advantages of developing Chrome applications.
However, there is also mention of nacl-ports, an official list of ported C libraries to be used in Native Client apps.
If I have some random C library I've used, what is the process for actually using it in my Chrome application? This question feels silly, but I'm quite confused over the process. Do I have to recompile the source with a NaCL compiler? Where in the SDK can I find this?
The FAQ also mentions that things like forks, file i/o is not allowed in the library, so I will have to rewrite any code that does these things, is that correct?
Bottomline: I have an existing C library. What is the process for using it correctly, and making calls to it, in a Chrome application?
The short answer is that you'll have to recompile your library with a NaCl C compiler.
You may want to take a look at naclports: this repository contains ports of many common C libraries to Native Client. You can browse the source more easily here.
As for File I/O, we often suggest using the nacl_io library when porting existing code. This provides a POSIX interface (e.g. fopen/fclose/fread, etc.) Many ported libraries require no modifications when using nacl_io.

What is the difference between source and binary distributions of mysql

Please let me know how to differentiate source and binary distributions of Mysql?
From internet, I came to know that one is compiled and other is not compiled version.
Not compiled version means, which software or language it uses to compile?
Compiled version means, how it works for different operating systems? is MySql developed in platform independent language?
Sorry for asking this type of question, but I need to get clarified on my doubts.
Thanks in advance.
http://en.wikipedia.org/wiki/MySQL
MySQL is written in C/C++ which are reasonably platform independent - it means a version of MySQL is available for different platforms (versions of operating systems). Binaries are build for different platforms, and you need to download binary version for the platform you have. Windows binary would not work on BSD Unix, etc.
You can see available platforms here: http://dev.mysql.com/downloads/mysql/
Likely with some skills you can build MySQL from sources on many other platforms. Not sure what exactly you want.
If you download source version, you need to have build tools. For example on Windows, you need to install C and C++ compilers and other tools as necessary.
Or you can just download both binaries and sources, and read source for learning experience.
Wikipedia article above has links explaining many more terms, to clear many more of your doubts. :-)
Edit:
C and C++ are considered "platform-independent": they are part of Gnu compiler collection : which provides compilers for many languages ("The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages") for many platforms/operating systems. And of course they power all distributions of Linux. See http://en.wikipedia.org/wiki/GNU_Compiler_Collection and http://en.wikipedia.org/wiki/GNU_Project

How to use library of other languages in Action Script 3?

Is there any way to use the library of other language in Action Script 3 ?
For C/C++
I learned that we can use Alchemy: http://labs.adobe.com/technologies/alchemy/
But for other languages (here I mean Ruby or Java), can I use their libs via AS3 ?
Alchemy is a cross-compiler from LLVM to ABC, if the language you are interested in can compile to LLVM, then, in theory, you can compile to ABC. So, Alchemy supports (with some tweaks) also C# or Java (but you will have to spend some time getting them to work together, there's no out of the box solution).
AIR (which is a desktop variant of Flash) can use something called "NativeProcess" which means that granted the operating system can execute the code in the library, then you can do so by creating a new process that calls the function from the library you need.
In AIR, again, there's a new feature called ANE (AIR Native Extensions) - this allows you to bind AIR more tightly to the native code. But, it doesn't need to be native as in object files only, it should be something the underlying system can execute. But I have to confess, I never tried creating any such extension, so my knowledge of it is theoretical.
No you can not use Ruby or Java code/libraries in Flash. Alchemy only allows you to use C and C++ libraries. The only way is to port those libraries to ActionScript, or maybe the library you want to use has already been ported to AS3.
It is also possible that there is something similar in AS3. You could ask another question here or on an Flash forum if anyone knows if the library you need has an equivalent in flash.

What is the Difference between PHP and ASP?

ASP is a Compiled Language or isnt it? sure it is.
PHP is a Interpreted Language.
I also developed once an asp app with the VS 2008 IDE.
But there is a Big difference between ASP and PHP.
What are the Differences?
ASP is a Compiled Language or isnt it? sure it is.
No, it isn't.
The first reason why ASP is not a compiled language is because there is no such thing as a compiled language. A language is neither compiled nor interpreted. A language just is. A language is a bunch of abstract mathematical rules. Interpretation or Compilation are traits of a language implementation, they have nothing to do with the language. Every language can be implemented by either a compiler or an interpreter; most modern high-performance language implementations actually use both and switch between them depending on which one is faster in a particular context.
The second reason why ASP is not a compiled language is because it is not a language. It is a framework. You can write code for ASP in any language for which an ActiveScripting engine exists (e.g. Ruby via ActiveRuby), but most commonly one would write code in either VBScript or JScript.
Which brings us to the third reason: The implementations of VBScript and JScript that ship with Windows, as well as ActiveRuby and all other ActiveScripting engines that I know of, are pure interpreters, they cannot compile. So, even though I wrote above that any language can be implemented using either a compiler or an interpreter, all the language execution engines that are supported by ASP are interpreted.
PHP is a Interpreted Language.
Again: no, it isn't.
Reason one is the same as above: there simply is no such thing as an interpreted language.
And, in contrast to ASP, the vast majority of PHP implementations actually do contain a compiler. Some even are pure compilers, they don't even have an interpreter. (Phalanger, for example always compiles straight to CIL, with no interpretation whatsoever. P8 can either interpret or compile straight to JVM bytecode or both: interpret, gather profile data while interpreting and then JIT-compile to JVM bytecode.)
But there is a Big difference between ASP and PHP. What are the Differences?
ASP is a (language-independent) framework, PHP is a language. That's a rather big difference. (Actually, PHP contains one small bit that would in other languages usually considered to be part of a web framework: webserver integration.)
PHP is highly portable across operating systems, CPU architectures and webservers: there is a PHP implementation for nearly every execution environment, from the JVM to the CLI to Parrot to running natively on pretty much every operating system under the sun. ASP is pretty tightly bound to Microsoft Internet Information Server, Microsoft Windows and the PC platform. (There were some other implementations but they are pretty obscure and no longer available.)
PHP has lots of different implementations (Phalanger, Quercus, Pipp, PHC, P8, Zend), ASP has only one. (Like I said, the two other ones are no longer available.)
The vast majority of PHP implementations are Open Source (I think the only exception is P8), while all three ASP implementations that I know of are proprietary.
PHP is actively developed and maintained, whereas ASP is largely obsolete and has been superseded by ASP.NET.
You could be more specific with your question.
The biggest difference is of course that ASP is programmed in a .NET language and uses the .NET framework as a basis. PHP of course is programmed in PHP and with it's library.
.NET is compiled into bytecode and that bytecode is interpretted/jitted at runtime. There are also bytecode caches for PHP (e.g. APC) and there is an active project that aims to generate native code from it using LLVM.
ASP is interpreted ASP.NET is compiled. ASP is not a language but a framework, you can code ASP.NET in a bunch of languages. ASP.NET runs only on IIS (unless you use Mono and who remembers Chilisoft ASP here?)
I have noticed when trying to add hosting on GoDaddy.com, PHP is for a Linux package and ASP was for Windows package.
ASP is a proprietary, closed-source implementation, PHP is not.