mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
Use g_fxo for LoadedNpdrmKeys_t
Rename to loaded_npdrm_keys
This commit is contained in:
parent
a85a8796d3
commit
54952f6ad6
7 changed files with 10 additions and 10 deletions
|
@ -14,7 +14,7 @@ constexpr u32 EDAT_FLAG_0x10 = 0x00000010;
|
||||||
constexpr u32 EDAT_FLAG_0x20 = 0x00000020;
|
constexpr u32 EDAT_FLAG_0x20 = 0x00000020;
|
||||||
constexpr u32 EDAT_DEBUG_DATA_FLAG = 0x80000000;
|
constexpr u32 EDAT_DEBUG_DATA_FLAG = 0x80000000;
|
||||||
|
|
||||||
struct LoadedNpdrmKeys_t
|
struct loaded_npdrm_keys
|
||||||
{
|
{
|
||||||
std::array<u8, 0x10> devKlic{};
|
std::array<u8, 0x10> devKlic{};
|
||||||
std::array<u8, 0x10> rifKey{};
|
std::array<u8, 0x10> rifKey{};
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
: edata_file(std::move(input)), rif_key(rif_key), dev_key(dev_key) {}
|
: edata_file(std::move(input)), rif_key(rif_key), dev_key(dev_key) {}
|
||||||
|
|
||||||
~EDATADecrypter() override {}
|
~EDATADecrypter() override {}
|
||||||
// false if invalid
|
// false if invalid
|
||||||
bool ReadHeader();
|
bool ReadHeader();
|
||||||
u64 ReadData(u64 pos, u8* data, u64 size);
|
u64 ReadData(u64 pos, u8* data, u64 size);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public:
|
||||||
stats.mtime = -1;
|
stats.mtime = -1;
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
bool trunc(u64 length) override
|
bool trunc(u64 length) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ s32 npDrmIsAvailable(vm::cptr<u8> k_licensee_addr, vm::cptr<char> drm_path)
|
||||||
return CELL_ENOENT;
|
return CELL_ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto npdrmkeys = fxm::get_always<LoadedNpdrmKeys_t>();
|
auto npdrmkeys = g_fxo->get<loaded_npdrm_keys>();
|
||||||
|
|
||||||
npdrmkeys->devKlic.fill(0);
|
npdrmkeys->devKlic.fill(0);
|
||||||
npdrmkeys->rifKey.fill(0);
|
npdrmkeys->rifKey.fill(0);
|
||||||
|
|
|
@ -357,7 +357,7 @@ error_code sys_fs_open(ppu_thread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<
|
||||||
file.seek(0);
|
file.seek(0);
|
||||||
if (magic == "NPD\0"_u32)
|
if (magic == "NPD\0"_u32)
|
||||||
{
|
{
|
||||||
auto edatkeys = fxm::get_always<LoadedNpdrmKeys_t>();
|
auto edatkeys = g_fxo->get<loaded_npdrm_keys>();
|
||||||
auto sdata_file = std::make_unique<EDATADecrypter>(std::move(file), edatkeys->devKlic, edatkeys->rifKey);
|
auto sdata_file = std::make_unique<EDATADecrypter>(std::move(file), edatkeys->devKlic, edatkeys->rifKey);
|
||||||
if (!sdata_file->ReadHeader())
|
if (!sdata_file->ReadHeader())
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ static error_code overlay_load_module(vm::ptr<u32> ovlmid, const std::string& vp
|
||||||
src.open(path);
|
src.open(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ppu_exec_object obj = decrypt_self(std::move(src), fxm::get_always<LoadedNpdrmKeys_t>()->devKlic.data());
|
const ppu_exec_object obj = decrypt_self(std::move(src), g_fxo->get<loaded_npdrm_keys>()->devKlic.data());
|
||||||
|
|
||||||
if (obj != elf_error::ok)
|
if (obj != elf_error::ok)
|
||||||
{
|
{
|
||||||
|
|
|
@ -299,7 +299,7 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr<sys_exit2_param> ar
|
||||||
|
|
||||||
vm::temporary_unlock(ppu);
|
vm::temporary_unlock(ppu);
|
||||||
|
|
||||||
Emu.CallAfter([path = std::move(path), argv = std::move(argv), envp = std::move(envp), data = std::move(data), disc = std::move(disc), klic = fxm::get_always<LoadedNpdrmKeys_t>()->devKlic]() mutable
|
Emu.CallAfter([path = std::move(path), argv = std::move(argv), envp = std::move(envp), data = std::move(data), disc = std::move(disc), klic = g_fxo->get<loaded_npdrm_keys>()->devKlic]() mutable
|
||||||
{
|
{
|
||||||
sys_process.success("Process finished -> %s", argv[0]);
|
sys_process.success("Process finished -> %s", argv[0]);
|
||||||
Emu.SetForceBoot(true);
|
Emu.SetForceBoot(true);
|
||||||
|
|
|
@ -157,7 +157,7 @@ static error_code prx_load_module(const std::string& vpath, u64 flags, vm::ptr<s
|
||||||
src.open(path);
|
src.open(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ppu_prx_object obj = decrypt_self(std::move(src), fxm::get_always<LoadedNpdrmKeys_t>()->devKlic.data());
|
const ppu_prx_object obj = decrypt_self(std::move(src), g_fxo->get<loaded_npdrm_keys>()->devKlic.data());
|
||||||
|
|
||||||
if (obj != elf_error::ok)
|
if (obj != elf_error::ok)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ void sys_spu_image::load(const fs::file& stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
type = SYS_SPU_IMAGE_TYPE_KERNEL;
|
type = SYS_SPU_IMAGE_TYPE_KERNEL;
|
||||||
|
|
||||||
nsegs = sys_spu_image::get_nsegs(obj.progs);
|
nsegs = sys_spu_image::get_nsegs(obj.progs);
|
||||||
|
|
||||||
const u32 mem_size = nsegs * sizeof(sys_spu_segment) + ::size32(stream);
|
const u32 mem_size = nsegs * sizeof(sys_spu_segment) + ::size32(stream);
|
||||||
|
@ -184,7 +184,7 @@ error_code sys_spu_image_open(ppu_thread& ppu, vm::ptr<sys_spu_image> img, vm::c
|
||||||
|
|
||||||
sys_spu.warning("sys_spu_image_open(img=*0x%x, path=%s)", img, path);
|
sys_spu.warning("sys_spu_image_open(img=*0x%x, path=%s)", img, path);
|
||||||
|
|
||||||
const fs::file elf_file = decrypt_self(fs::file(vfs::get(path.get_ptr())), fxm::get_always<LoadedNpdrmKeys_t>()->devKlic.data());
|
const fs::file elf_file = decrypt_self(fs::file(vfs::get(path.get_ptr())), g_fxo->get<loaded_npdrm_keys>()->devKlic.data());
|
||||||
|
|
||||||
if (!elf_file)
|
if (!elf_file)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue