Sorry to hear about your laptop, hopefully you get something new soon.
Good news, I figured out how to exploit the PC version
I discovered today chocobo betting on PC 100% does get it's initial random value from the system clock. And how do I know this?
Well although I couldn't hook all the time functions in windows. There is a program for linux that is well developed called libfaketime.
But ff7 isn't on linux, how'd you get around that?
I compiled a 32bit libfaketime and installed ff7 1998 in 32bit wine on ubuntu 22.04.
I was able to set a clock time at load and the races were always one of three sets of chocobos.
I'm guessing this is because there are slight differences to loading time.
Code: [Select]
Code:
ubuntu@ubuntu:~/.wine/drive_c/Program Files/Square Soft, Inc/Final Fantasy VII$ WINEARCH=win32 LDFLAGS=-m32 LD_PRELOAD=/home/ubuntu/libfaketime32/src/libfaketime.so.1 FAKETIME="@2000-01-01 11:12:13" FAKETIME_DONT_RESET=1 /home/ubuntu/wine-7.0-4-proton-x86/bin/wine ff7.exe
I got the idea from here:
https://github.com/wolfcw/libfaketime -> To compile as 32bit you need to add -m32 to CFLAG and LDFLAGS in src/Makefile
The version of Wine I used was prebuilt and I got it's libraries from `apt install wine winetricks`.
https://github.com/Kron4ek/Wine-Builds/releases/download/7.0-4-proton/wine-7.0-4-proton-x86.tar.xz
Installing ff7 was not easy. Here's some guides I needed.
https://appdb.winehq.org/objectManager.php?sClass=version&iId=10317
https://www.ff7catalog.com/threads/8005/
https://www.codeweavers.com/support/wiki/linux/faq/videomemorysize
One thing to note, winetricks didn't like some of the download links for the dependencies, so some of them had to be manually added to the winetricks cache folder.
With this new knowledge you might be excited to learn, libfaketime is actually not even needed, setting the date and then immediately starting the game has the same effect.
Code: [Select]
Code:
date -s "9 NOV 2022 18:00:00" && WINEARCH=win32 /home/ubuntu/wine-7.0-4-proton-x86/bin/wine ff7.exe
Even running the commands back to back with a split second in between works.
On windows you can disable automatic time updates, set a time from command prompt, and pretty quickly press the play button.
Code: [Select]
On an xbox you can go offline, reboot the xbox.
Now from settings you can set a time, start the game, kill the game, set a time, start the game, and you will get the same result.
I'm really surprised they didn't use a higher precision of time or use uptime.
If someone was really inclined you could probably set up a dns server, to redirect the ntp client of whatever device you are using to a server you control and do the same trick.
A container running
https://github.com/btfak/sntp and dnsmasq could easily do the job.