Thread: С++ obfuscator

  1. #16
    Registered User
    Join Date
    Oct 2018
    Posts
    4
    Quote Originally Posted by Nwb View Post
    Wait.. so it's possible to decompile a .exe file of a c++ program????
    It is possible to restore the code. Even a student can successfully cope with such a task.
    Decompiled code can be quite working! But it will be completely impossible to expand and maintain it. This happens in other programming languages too.

  2. #17
    Registered User
    Join Date
    Oct 2018
    Posts
    9
    I understood. But what to do to protect my project?
    What's better? Come up with your own algorithm, use ready-made libraries or programs?

  3. #18
    Registered User
    Join Date
    Oct 2006
    Posts
    3,443
    It is not possible to recover the original source code from a compiled C++ program, especially one built with optimizations enabled. End of story. Not possible.

    It is possible to generate functionally equivalent source code from a compiled binary, but it will likely not resemble the original source code in any way.

    Long story made short: it is entirely unnecessary to obfuscate C++ code. It doesn't matter if you use a library or write it yourself. Nobody can extract your code from your compiled binary.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  4. #19
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    26,041
    Quote Originally Posted by MasterYoda
    But what to do to protect my project?
    I posted the answer in post #3. If you cannot do that... well, what are you trying to do that you need to "protect" your project?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #20
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    36,689
    > But what to do to protect my project?
    Protect from whom?

    - kid in a bedroom with few skills, lots of time and free tools.
    - business rivals with less time, but access to $expensive tools to automate the task.
    - state level Three-Letter-Agencies with all the tools and all the time they need.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #21
    Registered User
    Join Date
    Oct 2018
    Posts
    9
    Thank you all for your responses. This discussion has become very interesting for me. I do not want to start a new topic, so I will ask here. I do not understand why everyone is against obfuscation?
    If there is no point in obfuscating the code then:
    Why there are so many tools for hacking?
    Why does reverse engineering exist?

  7. #22
    Registered User
    Join Date
    Sep 2018
    Posts
    150
    What do you intend to do when you say you want to "obfuscate" exactly? From this thread it's clear that there's no need for obfuscating itself.

  8. #23
    Registered User
    Join Date
    Oct 2018
    Posts
    9
    Quote Originally Posted by Nwb View Post
    What do you intend to do when you say you want to "obfuscate" exactly? From this thread it's clear that there's no need for obfuscating itself.
    I mean obfuscation like in wiki:
    "In software development, obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand. Like obfuscation in natural language, it may use needlessly roundabout expressions to compose statements. Programmers may deliberately obfuscate code to conceal its purpose (security through obscurity) or its logic or implicit values embedded in it, primarily, in order to prevent tampering, deter reverse engineering, or even as a puzzle or recreational challenge for someone reading the source code. This can be done manually or by using an automated tool, the latter being the preferred technique in industry."

  9. #24
    Registered User
    Join Date
    Sep 2018
    Posts
    150
    See you are only obfuscating the source code in this case. The output will be the same. And like we have established in this thread, it's not possible to read the source code itself but try to re-engineer the 'purpose' of the source code by learning how it 'reacts' by examining its 'outputs'.

    So whether you 'obfuscate' your source code or not that's not going to deter people who are crazy enough to crack your program in any way.

  10. #25
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    26,041
    Quote Originally Posted by MasterYoda
    I do not understand why everyone is against obfuscation?
    Because it is a hard battle to win for legitimate purposes (i.e., different story if you're writing malware that you're trying to obfuscate to remain undetected, but we won't go there), hence it is usually easier and better to pursue other means, e.g., the client/server model I mentioned, or where this is not feasible, legal means.

    Quote Originally Posted by MasterYoda
    If there is no point in obfuscating the code then:
    Why there are so many tools for hacking?
    Your question doesn't really make sense (unless you're writing malware, but it is obvious as to why we would be against that) as "hacking" is something else.

    Quote Originally Posted by MasterYoda
    Why does reverse engineering exist?
    Because there's something valuable to get out of it. That's why I asked 'what are you trying to do that you need to "protect" your project'.
    Last edited by laserlight; 1 Week Ago at 08:54 PM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #26
    Registered User
    Join Date
    Oct 2018
    Posts
    9
    Thank you for such answer! I do not develop malware, if you meant it. I'm just interested in code protection

  12. #27
    Registered User
    Join Date
    May 2009
    Posts
    3,449
    Quote Originally Posted by MasterYoda View Post
    Thank you for such answer! I do not develop malware, if you meant it. I'm just interested in code protection
    Protecting code for a crappy program is usually a waste of time.

    Using code obfuscator on C++ code tends to make the code more crappy; in other words it will almost have to make the code run more slowly.
    Unless, speed is not a important factor in your C++ program you should avoid obfuscator use.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  13. #28
    Registered User
    Join Date
    Sep 2018
    Posts
    150
    Does code obfuscation make sense even then? If it's impossible to actually crack the source code then why would obfuscation be a good idea? Because regardless of how much you obfuscate the code, the outputs aren't going to change and people who try to re-engineer code rely on outputs itself no? They can't see whats actually happening inside the program can they?

  14. #29
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    26,041
    There is more than one way to skin a cat, so if you get to watch a video of a better method, even if it is rather low quality, you might be able to figure out the technique and hence skin cats more efficiently. Obfuscation tries to make that video so bad that you cannot figure it out.

    Disclaimer: I only endorse the humane skinning of cats for shamisen.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #30
    Registered User
    Join Date
    Sep 2018
    Posts
    150
    But are the people who are getting the shamisen able to peep out of a very old dusty window to see how the shamisen is being made or does the place where the shamisens are being made have no windows at all and the only thing the people who get the shamisens are able to analyze is how the shamisen responds to their touch, after they buy it?

    Can somebody see the basic structure of the program like if there was a class declared or something like that? Is that possible? Or can they just see the cout statements? If they can only see the cout statements then how will they know how the cat was skinned?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Developing free .NET obfuscator. Need feedback.
    By ianderf in forum C# Programming
    Replies: 1
    Last Post: 09-10-2014, 04:22 PM
  2. work with files in С99
    By sanda in forum C Programming
    Replies: 4
    Last Post: 05-06-2010, 03:17 AM

Tags for this Thread