# Code morphing

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Code_morphing
> Markdown URL: https://mediated.wiki/source/Code_morphing.md
> Source: https://en.wikipedia.org/wiki/Code_morphing
> Source revision: 1303661682
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Approach used in obfuscating software}}
{{more citations needed|date=January 2021}}
'''Code morphing''' is an approach used in [obfuscating software](/source/obfuscating_software) to protect [software](/source/software) applications from [reverse engineering](/source/reverse_engineering), [analysis](/source/analysis), modifications, and [cracking](/source/Online_piracy). This technology protects intermediate level code such as compiled from Java and .NET languages ([Oxygene](/source/Oxygene_(programming_language)), [C#](/source/C_Sharp_(programming_language)), [Visual Basic](/source/Visual_Basic), etc.) rather than binary [object code](/source/object_file). Code morphing breaks up the protected code into several processor commands or small command snippets and replaces them by others, while maintaining the same end result. Thus the protector obfuscates the code at the intermediate level.<ref>{{Cite journal|title=The Transmeta Code Morphing™ Software: using speculation, recovery, and adaptive retranslation to address real-life challenges|url=https://dl.acm.org/doi/10.5555/776261.776263|journal=CGO '03: Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization|date=23 March 2003 |pages=15–24 |isbn=978-0-7695-1913-5 |via=ACM}}</ref>

Code morphing is a multilevel technology containing hundreds of unique code transformation patterns. In addition this technology transforms some intermediate layer commands into [virtual machine](/source/virtual_machine) commands (like [p-code](/source/P-code_machine)). Code morphing does not protect against runtime tracing, which can reveal the execution logic of any protected code.

Unlike other code protectors, there is no concept of code [decryption](/source/Cryptography) with this method.  Protected code blocks are always in the executable state, and they are executed (interpreted) as transformed code. The original intermediate code is absent to a certain degree, but deobfuscation can still give a clear view of the original code flow.

Code morphing is also used to refer to the [just-in-time compilation](/source/just-in-time_compilation) technology used in [Transmeta](/source/Transmeta) processors such as the [Crusoe](/source/Transmeta_Crusoe) and [Efficeon](/source/Transmeta_Efficeon) to implement the [x86](/source/x86) instruction set architecture.

Code morphing is often used in obfuscating the [copy protection](/source/copy_protection) or other checks that a program makes to determine whether it is a valid, authentic installation, or an [unauthorized copy](/source/Copyright_infringement_of_software), in order to make the removal of the copy-protection code more difficult than would otherwise be the case.

==See also==
* [Intermediate language](/source/Intermediate_language)

== References ==
{{Reflist}}

{{DEFAULTSORT:Code Morphing}}
Category:Software obfuscation
Category:Source code
Category:Warez

---
Adapted from the Wikipedia article [Code morphing](https://en.wikipedia.org/wiki/Code_morphing) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Code_morphing?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
