self-modifying Questions

9

Solved

I'm looking at writing a JIT compiler for a hobby virtual machine I've been working on recently. I know a bit of assembly, (I'm mainly a C programmer. I can read most assembly with reference for op...
Rwanda asked 27/1, 2011 at 4:53

4

Solved

I've been told and have read from Intel's manuals that it is possible to write instructions to memory, but the instruction prefetch queue has already fetched the stale instructions and will execute...
Gentianaceous asked 30/6, 2013 at 22:52

4

I want to create python script which can modify code in that script itself using Python Language Services or using any other way. e.g. A script which keep track of its count of successfull executio...
Uniaxial asked 18/7, 2017 at 19:38

3

I am writing a JIT on ARM Linux that executes an instruction set that contains self-modifying code. The instruction set does not have any cache flush instructions (similar to x86 in that respect). ...
Veery asked 6/5, 2010 at 0:50

11

I want to write a piece of code that changes itself continuously, even if the change is insignificant. For example maybe something like for i in 1 to 100, do begin x := 200 for j in 200 down...
Hotblooded asked 16/9, 2011 at 15:31

3

Solved

It is commonly said that a static variable initialization is wrapped in an if to prevent it from being initialized multiple times. For this, and other one-off conditions, it would be more efficient...
Sport asked 24/8, 2020 at 21:33

2

I have a program that generates self-modifying code (see https://tigress.wtf/selfModify.html in case you're interested). It runs on x86 Darwin and Linux. On Darwin, I compile with gcc -g -segprot ...
Southwesterly asked 2/3, 2020 at 23:7

15

Solved

Is there any real use for self modifying code? I know that they can be used to build worms/viruses, but I was wondering whether there is some good reason that a programmer may have to use se...
Myrta asked 5/2, 2009 at 16:34

14

Solved

I am recently thinking about writing self-modifying programs, I think it may be powerful and fun. So I am currently looking for a language that allows modifying a program's own code easily. I read...
Osvaldooswal asked 16/6, 2010 at 21:59

1

Solved

In dynamic languages like JavaScript/Python, it's possible to overwrite or "modify" functions during run-time. For example, in order to modify the alert function in JS, one could do: const _prev_a...
Yonder asked 29/8, 2018 at 23:11

1

Solved

I have written a short program to read a windows obj file and find the .text section and run the code in it. To do this I make the following Windows API function calls (Full code [gist.github.com],...

3

Solved

i found an article about self modifying code and tried to do some examples, but i get always segmentation faults. As fas as i can understand, there is a violation in memory permissions. The code se...
Cicerone asked 12/11, 2010 at 21:54

2

Solved

Motivation: https://stackoverflow.com/questions/28120689/create-self-modifying-html-page-on-box Bug: String escaping , formatting html , js generated by initial edited , saved html , js e.g., a...
Upholsterer asked 31/5, 2015 at 21:59

1

Solved

I'm trying to write self modifying asm code. At some point, I try the following : (NASM compiler) start_of_code: ; ... snip ... cmp byte [rax], 0x66 jae above_label add byte[rax], 0x20 ; ... sn...
Smite asked 13/3, 2015 at 22:0

1

Could you list the possibilities for Java code to modify itself? The scenario in which this is going to be used is a learning program. In response to user input the program learns a new algorithm: ...

16

Solved

Can you think of any legitimate (smart) uses for runtime code modification (program modifying it's own code at runtime)? Modern operating systems seem to frown upon programs that do this since th...

2

Solved

I am asking this since I don t have the tool or time to test this right now, but the idea is bothering me. I ll answer this myself when I ll have the time to play with it. In node.js, how does req...
Curvaceous asked 29/11, 2013 at 15:39

5

Solved

I like examples, so I wrote a bit of self-modifying code in c... #include <stdio.h> #include <sys/mman.h> // linux int main(void) { unsigned char *c = mmap(NULL, 7, PROT_READ|PROT_WR...
Devonadevondra asked 12/6, 2012 at 1:10

4

I'm trying to speed up a variable-bitwidth integer compression scheme and I'm interested in generating and executing assembly code on-the-fly. Currently a lot of time is spent on mispredicted indir...
Pavia asked 19/7, 2013 at 4:33

1

Solved

This is a follow up to my previous question. I’m not convinced that Lisp code is as Homoiconic as machine code on a Von Neumann architecture. It seems obvious to me that in both cases code is...
Cutcherry asked 4/6, 2013 at 9:54

4

Solved

I have a file module.hpp struct ModuleBase { virtual void run() = 0; }; and a main.cpp program int main() { cout << ...?...; // here should go the contents of module.hpp } What can I ...
Sussman asked 20/12, 2012 at 10:53

2

Solved

I'm saving my data in the executable file of the program. I copy it to a temporary file, overwrite a part starting at a 'magic string' and rename it to the original. I know this is a bad idea, but ...
Terrence asked 15/2, 2012 at 2:17

2

Solved

I've been just wondering - how does one disassemble self-modifying binary? I guess you can't use olly or IDA because they are static disassemblers, correct? What happens with disassembler if you ju...
Limiter asked 25/4, 2012 at 18:35

1

Solved

First I am sorry about the length of this post, but I wanted to explain the problem clearly. I try to write a kind of small self modifying program in C but I have some troubles and I don't know ex...
Folkestone asked 11/4, 2012 at 17:16

4

Solved

I will be forward in admiting that my knowledge of Lisp is extremely minimal. However I am extremely interested in the language and plan to begin seriously learning it in the near future. My unders...
Musketry asked 13/12, 2011 at 14:12

© 2022 - 2025 — McMap. All rights reserved.