Various fixes (Trophy, Gcm corrections, stack alloc) (#2894)

* Fixed sys_get_random_number generating less bytes than needed, and ceiling the buffer size in 0x1000 instead of failing
* Corrected alignment check in libgcm
* Now calling callback of sceNpManagerRegisterCallback
* Fixed trophies
This commit is contained in:
Ofek 2017-09-02 14:43:44 +03:00 committed by Ivan
parent d3f13ab8a3
commit caab400258
7 changed files with 45 additions and 20 deletions

View file

@ -53,12 +53,14 @@ s32 sys_get_random_number(vm::ptr<u8> addr, u64 size)
{
sysPrxForUser.warning("sys_get_random_number(addr=*0x%x, size=%d)", addr, size);
if (size > 4096)
size = 4096;
for (u32 i = 0; i < (u32)size - 1; i++)
if (size > 0x1000)
{
addr[i] = rand() % 256;
return CELL_EINVAL;
}
for (u32 i = 0; i < (u32)size; i++)
{
addr[i] = rand() & 0xff;
}
return CELL_OK;