I have searched considerably for an answer to this without success. In a debugger, one may write instructions and then execute them. This requires special permissions in the executable image. I seek to perform this function without the debugger.
Please show me an ASM "hello world" program that has self-modifying code (perhaps replacing a series of 090H with code to uppercase the 'h' in hello) and the commands necessary to enable its execution. The next 2 lines are the before and after machine code for the h->H replacement.
90 90 90 90 90 90 90 90 90 90 90 ; 11 NOPs
8a 26 50 00 80 e4 df 88 26 50 00 ; MOV AH,[BX]; AND AH,0DFH; MOV [BX],AH;
I have complete competence and confidence constructing iAPX86 machine code. My problem is convincing linux, darwin/yosemite, and windows to allow execution. In the end, I want to be able to construct and modify an executable on-the-fly for a new language I am writing. The architecture of the new language has no parallels in modern practice.
I expect much criticism for flying in the face of convention, but I will proceed with my plans notwithstanding.