create an emulator sort of thing?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by CIAwesome526, Apr 1, 2015.

  1. CIAwesome526
    OP

    CIAwesome526 Im ugly and im proud

    Member
    1,242
    2,254
    Mar 25, 2014
    United States
    The Lake, Kalos Region
    so i created a small test app on windows. and i want to change the file extension, and i guess encrypt it? i dont know. anyway, i want to be able to make another application that can open these encrypted files, with the custom extension. i dont want it just view the files, but say it was a game, using the "emulator" would play the file automatically. im sure its not easy, but thats why im asking. im also wondering if the whole encryption thing is possible, so that people cant just easily right click on the file, to view the internals or whatever. kind of like, i guess an nes rom, cant just be opened so you can see all the files... its encrypted, and it has some extension like .nes, then if you open it with an nes emulator on any device, it will play the game. i guess it decrypts then starts the game? im wondering if i can achieve something similar to this: an app that starts an encrypted application.
     
    Margen67 likes this.
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,842
    9,734
    Nov 21, 2005
    United Kingdom
    A NES ROM is not so much encrypted as all compiled into one file and usually without a filesystem to separate things, and assembled/compiled to run on the 6502 processor with a NES memory layout. See incbin or binary include for more on that one.
    Some later systems, like the 3ds and wii, do have encrypted ROMs that do need to be decrypted to work but that is a different matter.

    You could make a script and have it only run when a decoder program looks at it. You would not be the first though and as such there are a few options though I will mainly cover three of them. I do have to warn you though that anti virus programs take a very dim view of this sort of thing -- there is little practical use for it and as such it is mainly malware that does it.

    1) Executable packing

    2) Encryption

    3) Obfuscation

    Obfuscation usually deals more in source code but it does apply to binaries as well. The way you write the code and compile it then means nobody has any idea what it does, at least not without knowing the language inside and out and spending ages looking at it.

    Executable packing is less likely to be flagged by a virus checker but it is still the cause of many a false positive. Originally packing was more to get file sizes down but it does have benefits in preventing the code from being looked at without first unpacking it. You can probably find many examples of this in the commercial software world.

    Some of the higher levels of executable packing will encrypt chunks of the code using actual cryptography rather than compression and more code focused obfuscation. In your initial scenario it sounded like you would have one program run, decode automatically and run the new code. The middle step is something of an issue as you would tend to want to provide your own key to run (be it one you type, a challenge, a USB drive with a unique ID (GPS systems often use this concept) or something more involved.


    All this seems something of a hassle though. For most purposes you would probably be better off with an encrypted zip file, a full drive encryption or a VM you can control to run it in.
     
    Margen67 likes this.