function PredictNextRandom(RSeed: PInteger; Range: Integer): Integer;
begin
result := RSeed^ * $8088405 + 1;
asm
PUSH EDX
MOV EAX, Range
MUL result
MOV result, EDX
POP EDX
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
ShowMessage(IntToStr(PredictNextRandom(@RandSeed,10)) + '
== '+ IntToStr(Random(10)));
end;