Thread: С++ obfuscator

  1. #1
    Registered User
    Join Date
    Oct 2018
    Posts
    18

    С++ obfuscator

    Hi guys!
    Tell me plz which code obfuscators you use? How do you protect your code from decompiling and hacking?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I am said to say my C/C++ does not require an code obfuscator.

    But, in most cases C/C++ does not require code obfuscator. This is most often an Java, C-Sharp or other byte code language need.

    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

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by MasterYoda
    Tell me plz which code obfuscators you use? How do you protect your code from decompiling and hacking?
    Why are you so interested in "code obfuscators" anyway? An optimising compiler would already produce compiled code that cannot be truly "decompiled". If you absolutely must prevent people from trying to dissect your compiled code, opt for a client-server model such that the thin client depends heavily on the server wherein all the heavy lifting code is kept. You then do your best to secure the server.
    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

  4. #4
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Wait.. so it's possible to decompile a .exe file of a c++ program????

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Nwb View Post
    Wait.. so it's possible to decompile a .exe file of a c++ program????
    You can change it into Assembly code without much work; but, restoring it back to your source code is not possible for non simple programs.

    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

  6. #6
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by stahta01 View Post
    You can change it into Assembly code without much work; but, restoring it back to your source code is not possible for non simple programs.

    Tim S.
    Then how do big offline game companies protect their source code? And even online games can't rely on the internet so much can they?

  7. #7
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Quote Originally Posted by Nwb View Post
    Then how do big offline game companies protect their source code? And even online games can't rely on the internet so much can they?
    It might be instructive to read the wikipedia page on decompilers. There are numerous challenges to doing it with any sort of positive outcome. The code that will be spit out is not a thoughtfully structured program in the slightest. It isn't much better than assembly code.

    I won't say bad things can't happen this way, but it's just the sort of ridiculous thing that you can't as an individual really worry about. If closed source does get out, then you (probably - IANAL) have legal avenues to pursue. The law is on the company's side here. It's what end user agreements, laws for copyright, laws against cyber crimes, and so on are for.

  8. #8
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by whiteflags View Post
    It might be instructive to read the wikipedia page on decompilers. There are numerous challenges to doing it with any sort of positive outcome. The code that will be spit out is not a thoughtfully structured program in the slightest. It isn't much better than assembly code.

    I won't say bad things can't happen this way, but it's just the sort of ridiculous thing that you can't as an individual really worry about. If closed source does get out, then you (probably - IANAL) have legal avenues to pursue. The law is on the company's side here. It's what end user agreements, laws for copyright, laws against cyber crimes, and so on are for.
    About those rights, you technically can't be sued if you don't distribute anything or harm the publisher directly.. right?

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Nwb View Post
    About those rights, you technically can't be sued if you don't distribute anything or harm the publisher directly.. right?
    False
    "...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

  10. #10
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by stahta01 View Post
    False
    case (1): A player exploits an exploit - does the company pursue him?
    case (2): A player demonstrates an distributes an exploit which was the company's fault but caused the company a lot of loss - does the company pursue him?
    case (3): A player hacks the game for his own advantage but does not harm anybody - does the company pursue him?

    case (4): An offline game is hacked by a player - how will anybody get to know, and if they were to then would they sue him? I mean seriously for hacking?

    case (5): An innocent boy gets his dad to put Google's logo on his new custom bicycle - is it possible for Google to sue him?

  11. #11
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Bear with me but I don't think these cases are very realistic. 4/5 are about cheating in gaming, which I think you know is wrong and you can be caught all the time and lose the ability to play. Steam is just one easy example of this: Valve Anti-Cheat System (VAC) - Valve Anti-Cheat (VAC) System - Knowledge Base - Steam Support. You've never seen cheaters break their game and go crying to support for help they won't get. It's like you've never seen a company protective of its IP before, or you've never seen someone exposing a security exploit get in trouble.

    There is an element of if you're not caught it's not a crime to all of this, I guess. But the point is that nobody who does these things has clean hands, really.

    I guess part of it depends on your expectations and ethics as well. I mean, read any EULA template and you'll discover that you agreed not to decompile. Those are contracts that are actionable in court. Don't be dumb and expect it never to go there.
    Last edited by whiteflags; 10-19-2018 at 10:21 PM.

  12. #12
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    You can be sued is very different from will you likely be sued!

    And, likely to be sued is different from will the company/person suing likely to win!

    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. #13
    Registered User
    Join Date
    Oct 2018
    Posts
    18
    Quote Originally Posted by Nwb View Post
    Wait.. so it's possible to decompile a .exe file of a c++ program????
    Never heard of such possibility
    Is it even possible?

  14. #14
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    You can decompile an exe back to some functionally equivalent source code that you can recompile.

    But it will not be the original source code with meaningful structure and variable names.

    As a last resort technique for bug fixing, it's occasionally useful.

    But it's never going to be a useful starting point for further development.
    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.

  15. #15
    Registered User
    Join Date
    Oct 2018
    Posts
    18
    I answer some of your questions:
    I read wikipedia and several forums on this issue. Opinions are very different and I began to study this question. A lot of topics are old and tips are no longer relevant. Like some obfuscators. Some of them were popular 3-4 years ago and are no longer supported now.

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