开发者

Is there any concept in c++ like reflector in .Net?

开发者 https://www.devze.com 2023-01-16 09:19 出处:网络
i like to get code from c++ dll ,i know we easily get from .Net dll by reflector. Is there any method available in c++ for t开发者_开发技巧his?

i like to get code from c++ dll ,i know we easily get from .Net dll by reflector. Is there any method available in c++ for t开发者_开发技巧his?

Thanks In Advance


C++ is compiled directly to machine code. There's no intermediary language as in .NET. There are some C++ disassemblers you may take a look at. Hex-Rays decompiler is particularly good.


I believe you are talking about unmanaged C++. In that case, it is not possible. C++ is compiled into machine code unlike the managed languages which compile into an intermediate language which contain the metadata about the code which got compiled.


In short, no. Any 'reflection' must be through some hand coded mechanism.


No, C++ has nothing like RedGate's reflector, and is incapable of such a thing. A disassembler will not come close to what you are looking for.


Code for introspective capabilities can be generated from the output of Gcc-XML, or injected with OpenC++, but the C++ Standard itself doesn't require any particular facilities for this and no facilities/utilities for this are bundled with any popular compilers. It's also possible for a C++ program to read the debugging information in its own executable file, but it's definitely not particularly portable, fast, or likely to make for a robust solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消