mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Notification for encrypted SPU modules
This commit is contained in:
parent
5e954f4f76
commit
ed0918d097
2 changed files with 31 additions and 5 deletions
|
@ -15,11 +15,17 @@
|
|||
#include "Emu/SysCalls/lv2/sys_mmapper.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwcond.h"
|
||||
#include "Loader/ELF.h"
|
||||
#include "Crypto/unself.h"
|
||||
#include "Emu/Cell/RawSPUThread.h"
|
||||
#include "sysPrxForUser.h"
|
||||
|
||||
Module *sysPrxForUser = nullptr;
|
||||
|
||||
void sys_initialize_tls()
|
||||
{
|
||||
sysPrxForUser->Log("sys_initialize_tls()");
|
||||
}
|
||||
|
||||
int _sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_heap_create_heap(heap_addr=0x%x, align=0x%x, size=0x%x)", heap_addr, align, size);
|
||||
|
@ -49,11 +55,6 @@ u32 _sys_heap_memalign(u32 heap_id, u32 align, u32 size)
|
|||
return (u32)Memory.Alloc(size, align);
|
||||
}
|
||||
|
||||
void sys_initialize_tls()
|
||||
{
|
||||
sysPrxForUser->Log("sys_initialize_tls()");
|
||||
}
|
||||
|
||||
s64 _sys_process_atexitspawn()
|
||||
{
|
||||
sysPrxForUser->Log("_sys_process_atexitspawn()");
|
||||
|
@ -117,6 +118,18 @@ int sys_raw_spu_load(s32 id, vm::ptr<const char> path, vm::ptr<be_t<u32>> entry)
|
|||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
SceHeader hdr;
|
||||
hdr.Load(f);
|
||||
|
||||
if (hdr.CheckMagic())
|
||||
{
|
||||
sysPrxForUser->Error("sys_raw_spu_load error: '%s' is encrypted! Decrypt SELF and try again.", path.get_ptr());
|
||||
Emu.Pause();
|
||||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
f.Seek(0);
|
||||
|
||||
ELFLoader l(f);
|
||||
l.LoadInfo();
|
||||
l.LoadData(RAW_SPU_BASE_ADDR + RAW_SPU_OFFSET * id);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Emu/FS/vfsStreamMemory.h"
|
||||
#include "Emu/FS/vfsFile.h"
|
||||
#include "Loader/ELF.h"
|
||||
#include "Crypto/unself.h"
|
||||
#include "sys_spu.h"
|
||||
|
||||
static SysCallBase sys_spu("sys_spu");
|
||||
|
@ -48,6 +49,18 @@ s32 sys_spu_image_open(vm::ptr<sys_spu_image> img, vm::ptr<const char> path)
|
|||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
SceHeader hdr;
|
||||
hdr.Load(f);
|
||||
|
||||
if (hdr.CheckMagic())
|
||||
{
|
||||
sys_spu.Error("sys_spu_image_open error: '%s' is encrypted! Decrypt SELF and try again.", path.get_ptr());
|
||||
Emu.Pause();
|
||||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
f.Seek(0);
|
||||
|
||||
u32 entry;
|
||||
u32 offset = LoadSpuImage(f, entry);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue