0

My book says the following:

"Clients of a class do not need access to the class’s source code in order to use the class. The clients do, however, need to be able to link to the class’s object code (i.e., the compiled version of the class). This encourages independent software vendors (ISVs) to provide class libraries for sale or license. The ISVs provide in their products only the headers and the object modules. No proprietary information is revealed—as would be the case if source code were provided. The C++ user community benefits by having more ISV-produced class libraries available."

Can't you just decompile the .o files to obtain their implementation?

RandomPleb
  • 424
  • 1
  • 5
  • 20
  • Yes you can decompile binary files but you lose a lot of the original structure of the program – aaronman Oct 05 '13 at 23:48
  • @aaronman You don't lose *that much* when you know what you're doing and use modern tools like IDA (looks like it's called HexRays nowadays). Security through obscurity is a myth, we all know that, but what's really sad is that some people seem to be still teaching it as a viable solution (if I am to believe OP's question). – syam Oct 06 '13 at 00:00
  • @syam Yes, this is taught in the book "C++ How to Program (8th Edition)" and we are using it for my OOP course. Were you taught otherwise when you first started learning or did you come to find out another way? – RandomPleb Oct 06 '13 at 01:26
  • 1
    @user1644964 Truth be told, as far as programming is concerned I never went to school, I learned everything through practice (and sadly it still shows). Concerning the subject at hand, I found out by decompiling programs myself, way before there were any handy tools like IDA/HexRays, and even then it was easy enough for me to realize that binaries are no safer than plain source code, they just take a bit more time to understand that's all. Anyone motivated enough can and will reverse-engineer your binary, so relying on obscurity is nothing but a delusion. – syam Oct 06 '13 at 01:36
  • I appreciate any practical advice I can get. Seems like there's so much to learn through experience alone, and I'm merely getting started with the basics. Thanks for sharing - I will remember this. – RandomPleb Oct 06 '13 at 10:58

1 Answers1

1

You can, but generally it's hard to understand the decompiled code.

However, there exist good disassemblers -- HexRays produces quite understandable code, but is very expensive.

Buddy
  • 10,874
  • 5
  • 41
  • 58