diff --git a/modules/libSceRandom/entry.cpp b/modules/libSceRandom/entry.cpp index cf56e7e..849d018 100644 --- a/modules/libSceRandom/entry.cpp +++ b/modules/libSceRandom/entry.cpp @@ -12,8 +12,12 @@ EXPORT const char* MODULE_NAME = "libSceRandom"; EXPORT SYSV_ABI int32_t sceRandomGetRandomNumber(void* buf, uint32_t size) { LOG_USE_MODULE(libSceRandom); - if (buf == nullptr || size > Err::RANDOM_MAX_SIZE) { + if (size > Err::RANDOM_MAX_SIZE) { return EINVAL; + } + for (uint32_t i = 0; i < size; ++i) { + ((uint8_t*)buf)[i] = std::rand() & 0xFF; } + return 0; } } \ No newline at end of file