Self-Modifying Code Algorithm

some programs generate executable code at runtime. that is, a computer virus packed binary. this makes static analysis very difficult.

besides packing algorithms, is there any general algorithm for self-healing code generation? or compiler support? where can i get the relevant documentation or document? and what is the difference between self-modifying code and polymorphic code?

I am curious.

thank you in advance.

+3


source to share


1 answer


As mentioned, any program is just data until the processor tries to run it.

To apply self-modifying code, follow these steps:

  • copy notepad.exe

    tonotepad_orig.exe

  • start notepad_orig.exe

  • open notepad.exe

    notepad in the window that opens
  • enter what you want.
  • save and close


This might be a stupid example, but nothing else happens here. Notepad takes an external data source (you!) To change its code.

If you are looking for algorithms, I suggest that you look for an infrastructure that provides automatic updates for your application. This is the only practical example I can think of that is not illegal.

In response to your comment, you can of course encrypt part of your application and decrypt it before using it. However, for the application to run, it must exist in memory in its decrypted form and be readable. You will probably only simplify your application.

0


source







All Articles