VOGONS


First post, by kolano

User metadata
Rank Oldbie
Rank
Oldbie

I'm wondering if it would be possible to falsify certain system timers in DOSBox (or perhaps DOS in general) to cause programs with randomized startup parameters to repeatedly start in the same way. I'm guessing most programs initialize a random seed based off a timer at startup. It seems like it might be a bit tricky to me, but I don't have much clarity. I imagine there might be some variability in things like program startup times that might be unavoidable, etc.

Eyecandy: Turn your computer into an expensive lava lamp.

Reply 1 of 1, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

If the programs in question are using a PRNG then you'd want to control the seed value. If the seed is based on timer data from INT 1A/00 or INT 21/2C then it's a simple matter to use those interrupt functions to feed specific values, but if the timer ticks are read directly from 0x46c then the problem is more complicated. Setting the timer tick counter to a particular value and then freezing it is possible by setting up an alternate IRQ 0 handler that doesn't increment the ticks, but that could cause problems for programs that rely on the tick counter for timing (in addition to using it for a seed value). Of course you can also hack the program to use a particular seed value or source.