Software > Computer programming

Compiled Code Question


Friend of mine hit me up asking if there was a way to compile code and have it unable to be decompiled?

Last I knew there was no way to block someone from decompiling especially in grabbing it from memory addresses where it can all be exposed to its inner workings.

Figured I'd check here to see if I am wrong and there is a way. Then I will get back to him on this.

Yes, it can be done.
However, when people work together they try to make it easy, not hard to de compile and debug. I recall some 'tricks' that are used to make code more dense and it also makes it harder to debug. One is to use instructions that are not documented in the standard literature.This is done at the machine code level, or by an assembly make for that kind for trickery.  ;D
Another is to enter a procedure at a point that should be wrong. Some modes do not allow that, but older CPU designs did allow that kind of foolishness.

An other is to use some instructions that will change the flags in the accumulator. This will confuse anybody wanting to understand the logic.  :-\
More extreme is encrypted code that unlocks itself just before it is used  and then goes back to the way it was. I I knew how that is done I could not tell you because they would kill me when they found out who I am. :-X

Another is to have a special custom CPU that is made for super secret aplications.
It looks like a normal CPU but...
Wait... Somebody is pounding on the door - be back in a jiff.

No. You can obfuscate it or encrypt it to make it more difficult, but it isn't possible to make it be completely unable to be decompiled. The program has to be run by the machine and the machine needs machine code instructions, and machine code instructions can always be mapped to assembly language identifiers. Even in the case of encrypted code blocks at some point it must be decrypted and in memory so that it can be executed.

Personally, I think at a wider scale, obfuscation, preventing decompiling, etc. is putting resources in the wrong direction. It tends to cause problems for legitimate customers and that time could arguably be put towards real-world features in the software.

Cool... TY both for input on this and if Geek never returns we will know that he said too much.  :P

--- Quote ---Even in the case of encrypted code blocks at some point it must be decrypted and in memory so that it can be executed.
--- End quote ---

Yeah that is what my thought was on trying to hide the code was that the computer has to have the information structured pretty much the same as an unprotected program, and poking around in memory to see what is there is too easy for someone with skills/tools to be able to see its structure.

Will share this with him when I see him tomorrow.


[0] Message Index

Go to full version