From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 12 Jul 2015 06:54:43 -0500 Newsgroups: comp.lang.ada Subject: Re: Self-modifying code From: anon References: User-Agent: Xnews/5.04.25 Message-ID: Date: Sun, 12 Jul 2015 06:54:52 -0500 X-Trace: sv3-ACBvMAH47Hg0ezgkWY9Qi7zuCQmgX2xe6mP0jKIH1ATkJ8jjzBjLAujPwwK7j1wjApoFaoKeZEC9FCJ!IFwu3c7mrntKI3K4QnO7uUFHAulyaStmhFGi+2D0Q5lZT9DEJYwQO5kA1XQSANwyeJmuJNtdhxNo!YjqZnsUyWZ3x X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2272 Xref: news.eternal-september.org comp.lang.ada:26793 Date: 2015-07-12T06:54:52-05:00 List-Id: ferrariv65@gmail.com wrote in news:eb2440ca-06d4-4192-bdca-0444c2953eb9@googlegroups.com: > Is it possible to write self-modifying code in Ada? > More in detail: is it possible compile some code at runtime and inject > it into the running program, on the fly? The ability to remove that > code after it is no longer needed would also be important, to prevent > hogging up the system memory which may result. Thank you > > Serg > This question comes up once or twice a year, and with USA network cable channel showing "Mr. Robot" this question is on every hackers mind. How to hide code and build a "Rootkit" or "Virus" during run-time. Ada was designed with a number of overriding concerns, One being program reliability and maintenance. That means it was designed to prevent "Erroneous Execution" such as self-modifying code, So the RM by its definition of "Erroneous Execution" means that self-modifying code is illegal in Ada. So, except for shared (loaded at runtime) or dynamic (loaded on demand) libraries, the answer is NO! And, I hope that the maintainers of Ada never wants Ada to be associated with "Rootkits" or "Viruses" type of code. So, the answer should always be NO! Note: Dynamic libraries are normally a complete sub-system of routines not just a simple single function type plug-in.