getting c code from an existing mexw64 file

조회 수: 38 (최근 30일)
Christian
Christian 2011년 8월 24일
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에서 Install Products에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by