How is game code encrypted?

Discussion in 'iOS Programming' started by happycamper66, Oct 26, 2009.

  1. happycamper66 macrumors newbie

    Oct 26, 2009

    I just wanted to know how exactly the Apps are encrypted once they go on the App store, i have made a good few Apps now and its just something i am thinking about.

    When i go in Apps i own, i can .zip them and see the contents but where is the .xcodeproj with the files in it? I mean if i own the Apps, or i send out my App, then for it to run there is the source code for it to install and work on the iPhone. But that is nowhere in the zip extracted files? is there any way to make them visible or even extract the .xcodeproj onto a mac? and i mean, ANYWAY?

    If you have the App on your machine you can run it on your iPhone then the source code must be somewhere in the package. Albeit encrypted i would imagine..
  2. TodVader macrumors 6502a


    Sep 27, 2005
    Quebec, Canada
    When you build, Xcode creates a binary with your code. No one will ever see that code. The resources are wide open though. Every image and sound you use can be easily copied off the app.
  3. happycamper66 thread starter macrumors newbie

    Oct 26, 2009
    Has there been ANY record of anyone actually "reverse engineering" the code? Getting it back from binary code?
  4. admanimal macrumors 68040

    Apr 22, 2005
    When you compile your code, the objective-c is turned into equivalent ARM machine code instructions. These machine code instructions can be translated directly into ARM assembly instructions, which are slightly more readable by a human than the machine code. It is still pretty tedious to figure out what this code is doing, but it's certainly possible. Your exact objective-c code can't be directly recovered from the machine code.
  5. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
  6. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    You can't reverse engineer "the code" HLL source from the compiled binary exactly, but there are often ways to reverse engineer a form of source code that will pretty much create the same app, even though it may not be structured or easy to read.

    It's a lot easier to reverse compile more restrictive languages such as Java, than for wild spaghetti C code. Objective C is a mix of those two extremes, so it depends on how (badly) you write your source code.

    Objective C apps publish their method names for the language's dynamic dispatch to work. If you don't want method calls to be seen, use straight C functions instead, or even inline macros, and make sure to turn off or strip symbol generation.

    Library headers are easy to extract because they HAVE TO publish the interface names in some form in order to be linked.


Share This Page