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

5

6

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 this?

Thanks In Advance

Myoglobin answered 15/9, 2010 at 7:11 Comment(0)
K
16

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.

Katherinkatherina answered 15/9, 2010 at 7:14 Comment(1)
+1 as well for Hex-Rays! Just watched the vid (at their website) and it really looks like something I have long been searching for! Thanks!Castellanos
B
6

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.

Bike answered 15/9, 2010 at 7:15 Comment(0)
B
1

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

Benito answered 15/9, 2010 at 7:15 Comment(1)
I think Qt supports something like this.Osorio
E
1

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.

Epistle answered 15/9, 2010 at 7:16 Comment(0)
C
1

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.

Call answered 15/9, 2010 at 7:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.