getting c code from an existing mexw64 file
30 次查看(过去 30 天)
显示 更早的评论
回答(3 个)
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.
0 个评论
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.
0 个评论
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
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
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 Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!