I hate programming and will furiously smash my monitor if I ever see another oversight of this caliber ever again in my goddamn life

This commit is contained in:
Daniel R. 2024-09-23 18:29:57 +02:00
commit 59c8f3fd9d
No known key found for this signature in database
GPG key ID: B8ADC8F57BA18DBA
3 changed files with 4 additions and 6 deletions

View file

@ -228,8 +228,7 @@ int PS4_SYSV_ABI sceKernelMProtect(const void* addr, size_t size, int prot) {
int PS4_SYSV_ABI sceKernelMTypeProtect(const void* addr, size_t size, int mtype, int prot) { int PS4_SYSV_ABI sceKernelMTypeProtect(const void* addr, size_t size, int mtype, int prot) {
Core::MemoryManager* memory_manager = Core::Memory::Instance(); Core::MemoryManager* memory_manager = Core::Memory::Instance();
Core::MemoryProt protection_flags = static_cast<Core::MemoryProt>(prot); Core::MemoryProt protection_flags = static_cast<Core::MemoryProt>(prot);
return memory_manager->MTypeProtect(std::bit_cast<VAddr>(addr), size, return memory_manager->MTypeProtect(std::bit_cast<VAddr>(addr), size, protection_flags);
static_cast<Core::VMAType>(mtype), protection_flags);
} }
int PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, int flags, OrbisQueryInfo* query_info, int PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, int flags, OrbisQueryInfo* query_info,

View file

@ -348,7 +348,7 @@ int MemoryManager::Protect(VAddr addr, size_t size, MemoryProt prot) {
return ORBIS_OK; return ORBIS_OK;
} }
int MemoryManager::MTypeProtect(VAddr addr, size_t size, VMAType mtype, MemoryProt prot) { int MemoryManager::MTypeProtect(VAddr addr, size_t size, MemoryProt prot) {
std::scoped_lock lk{mutex}; std::scoped_lock lk{mutex};
// Find the virtual memory area that contains the specified address range. // Find the virtual memory area that contains the specified address range.
@ -377,8 +377,7 @@ int MemoryManager::MTypeProtect(VAddr addr, size_t size, VMAType mtype, MemoryPr
return ORBIS_KERNEL_ERROR_EINVAL; return ORBIS_KERNEL_ERROR_EINVAL;
} }
// Change type and protection // Change protection
vma.type = mtype;
vma.prot = prot; vma.prot = prot;
// Set permissions // Set permissions

View file

@ -166,7 +166,7 @@ public:
int Protect(VAddr addr, size_t size, MemoryProt prot); int Protect(VAddr addr, size_t size, MemoryProt prot);
int MTypeProtect(VAddr addr, size_t size, VMAType mtype, MemoryProt prot); int MTypeProtect(VAddr addr, size_t size, MemoryProt prot);
int VirtualQuery(VAddr addr, int flags, ::Libraries::Kernel::OrbisVirtualQueryInfo* info); int VirtualQuery(VAddr addr, int flags, ::Libraries::Kernel::OrbisVirtualQueryInfo* info);