How much self modifying code was there and did it do anything?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
ketmar
Manic Miner
Posts: 713
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: How much self modifying code was there and did it do anything?

Post by ketmar »

that unlocked some old memory. back than, when we in xUSSR used pirated ZX software, many pirated copies had custom loaders, and layers upon layers upon layers of xor encryption. usually with all kind of tricks: code that overwrites itself, using R register as a key, sometimes even using interrupts as breaks/exits/key modifiers. and it all was done by pirates, so other pirates won't "steal" their work — i.e. won't simply replace message in the loader and pass that around.

it was quite fun to see pirates removing program protection (and many of them did that without cheap tricks like multiface snapshots), only to replace it with their own. and it was REALLY ANNOYING, 'cause there was no way to stop the loader and insert some infinite lives poke there.
User avatar
Morkin
Bugaboo
Posts: 3277
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: How much self modifying code was there and did it do anything?

Post by Morkin »

catmeows wrote: Mon Jan 22, 2024 4:54 pm As HL is decreasing, it will rewrite second byte of JR instruction. Since series of multiple xors over chunk are deterministic, you can choose start value in A register such that result of XOR will change parameter of JR to jump outside the loop.
Ah thanks. That's quite cunning...
My Speccy site: thirdharmoniser.com
Post Reply