Page 2 of 2

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

Posted: Tue Jan 23, 2024 8:07 am
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.

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

Posted: Tue Jan 23, 2024 11:08 am
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...