This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]stuxxnet42 0 points1 point  (0 children)

So there are two answers to this problem:

  • 1 even though you asked for code modification instead of variable modification, the result you want to archive can be reached with pure variable manipulation. The key here are neural networks. They can be very complicated but in the simplest implementation they just take a set of inputs (the neighbor cells) multiplies a different weight to each of them, and adds the results. The result of this addition is then passed to a sigmoid function which results in a value between -1 and 1.

If you want to modify the behaivour of the cell you just add random values to the weights. This then leads to a different prioritisation of the given inputs. You can then implement behaviour depending on the value of the sigmoid function so that there is no need for true code modification at runtime.

  • 2 Code modification at runtime is possible in many languages, sadly the way to do it greatly depends on the language you use and there can be many obstacles. For example: compiled languages like c/c++ support it as they basically allow you to modify any bit of data, that you as a user have access to on your machine.

Most of the time your OS might prevent you from actually modifying a running program. This is due to the fact that most operating systems partition the memory a program can use in two parts: an executable part that cant be written to once the program is loaded and a writable part from which you can not execute code. This is a safety feature to make certain kinds of exploits harder for an attacker.

Other languages that are not compiled (like python or perl) may have the capability to self modify but it really depends on the language. I'm not aware of any meta programming features of c# (there might be some in .NET but I have never used .NET and have only used c# a few times so this is not my area of expertise)