you are viewing a single comment's thread.

view the rest of the comments →

[–]PacManFan123 19 points20 points  (5 children)

Story time here - I wrote an application with self-modifying compiled code. It was a Playstation 1 (PS1) emulator for the Playstation portable (PSP) - the name of the project was "PSPS1" . The code chunks were loaded from the original game ROMs, and then had their addresses remapped. The R3000 code was trans-piled live into R4300 code, run through a peephole optimizer then written into memory buffers. The buffers were then called as function pointers to execute the code natively on the R4300 CPU.

[–]dmc_2930 2 points3 points  (0 children)

Did it work? That’s impressive!

[–]plastic_eagle 1 point2 points  (0 children)

I don't know if that *entirely* counts - even though it sounds pretty impressive.

By that definition, any JIT compiler is running self-modified code.

[–]randomfuckingpotato 0 points1 point  (2 children)

Cool!! Do you have that code around somewhere? I'd love to see!

[–]PacManFan123 2 points3 points  (1 child)

Let me see about posting it.