From b6429edf0975f54c533a4a46a7fe332396a3a781 Mon Sep 17 00:00:00 2001 From: André Zwing Date: Sun, 25 May 2025 17:45:51 +0200 Subject: [WOW64] Implement get_random32 and get_random64 --- src/os/my_cpuid_wine.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/os/my_cpuid_wine.c b/src/os/my_cpuid_wine.c index c2d24b1c..16aab3f1 100644 --- a/src/os/my_cpuid_wine.c +++ b/src/os/my_cpuid_wine.c @@ -2,6 +2,9 @@ #include "my_cpuid.h" +NTSYSAPI ULONG WINAPI NtGetTickCount(VOID); +NTSYSAPI ULONG NTAPI RtlRandom(ULONG *seed); + const char* getBoxCpuName() { return NULL; @@ -18,12 +21,13 @@ uint32_t helper_getcpu(x64emu_t* emu) { uint32_t get_random32(void) { - // FIXME - return 0; + ULONG seed = NtGetTickCount(); + return RtlRandom(&seed); } uint64_t get_random64(void) { - // FIXME - return 0; -} \ No newline at end of file + ULONG seed = NtGetTickCount(); + uint64_t tmp = RtlRandom(&seed); + return RtlRandom(&seed) | (tmp << 32); +} -- cgit 1.4.1