getting c code from an existing mexw64 file

44 次查看(过去 30 天)
is there a way?

回答(3 个)

Jan
Jan 2011-8-25
The most efficient method to get the C-source is asking the author. If he or she hesitates to share the source code, offering a service in return helps usually, e.g. money.
This is not a joke. Sometimes such trivial solutions are overlooked. Extrem experts in programing are sometimes less advanced in interpersonal communication.

Walter Roberson
Walter Roberson 2011-8-24
There are "decompilers" available on the 'net .
Don't bother searching for anything specific to decompiling mexw64 (IMHO) -- the files are object libraries in your operating system's standard format.
Note that any C code that you get back will not be the original source code -- just code that compiles to the same thing. No comments, variable names will differ, internal routines may have different names, the code order might differ a fair bit, and so on.

Desiree
Desiree 2011-8-25
What you are asking for is known as reverse engineering of compiled files. While this is not impossible to do it takes a lot of effort, time and resources to completely reverse engineer a mex file. So this is not impossible but you could think in the dimensions of 20 CIA agents working on this for a year or so to accomplish this. So not really worth the effort. There are decompilers for DLLs (not sure about MEX files though) but there are certain limitations involved when using them (as Walter Roberson mentioned).
  2 个评论
Jan
Jan 2011-8-25
@Desiree: MEX files are standard DLLs. I agree that usually a complete decompilation needs more resources that re-writing the C-function from scratch. But if you look for a certain detail only, a fast success is possible - e.g. to find a CPU-ID check, which restricts the usage of SSE-features.
In addition a reverse-engineering is very often forbidden by the license conditions. So read them carefully before you start.
I do not have the impression, that CIA-man-year is a reliable unit to measure complexity. As far as I remember, CIA agents are faster in finding mass-destruction weapons than the enemy in producing them. (Sorry for this term! I know, that these weapons do not destruct _mass_.)
Desiree
Desiree 2011-8-25
CIA-man-year was just an example to illustrate the amount of effort that may be needed for complete decompilation. I understand what you mean though...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by