[PR #3955] Refactor OrbisFiber to match PS4 layout and obfuscation #3822

Open
opened 2026-02-27 22:05:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3955
Author: @w1naenator
Created: 1/24/2026
Status: 🔄 Open

Base: mainHead: gr2fix


📝 Commits (10+)

  • ac9d816 Refactor OrbisFiber to match PS4 layout and obfuscation
  • da7d52c Merge branch 'main' into gr2fix
  • 8a01876 Add Ulobjmgr integration and enhance fiber management
  • a7b4ba4 clang
  • fc9cde2 Merge branch 'gr2fix' of https://github.com/w1naenator/shadPS4 into gr2fix
  • 19ce9ac Add Mach-O support for fiber switching and stack management
  • 90e075e Enhance Mach-O fiber switching functions with visibility attributes
  • 7b41512 clang
  • 63f07a8 Enhance Mach-O fiber switching functions with externally visible attributes
  • c1cabf8 Update fiber handling for Mach-O with visibility attributes and adjust compile options for Apple

📊 Changes

11 files changed (+644 additions, -164 deletions)

View changed files

📝 CMakeLists.txt (+3 -0)
📝 src/common/logging/filter.cpp (+1 -0)
📝 src/common/logging/types.h (+1 -0)
📝 src/core/libraries/fiber/fiber.cpp (+492 -76)
📝 src/core/libraries/fiber/fiber.h (+65 -32)
📝 src/core/libraries/fiber/fiber_context.s (+59 -54)
📝 src/core/libraries/kernel/memory.h (+2 -0)
📝 src/core/libraries/kernel/threads/pthread.h (+2 -0)
📝 src/core/libraries/razor_cpu/razor_cpu.h (+4 -1)
📝 src/core/libraries/ulobjmgr/ulobjmgr.cpp (+5 -0)
📝 src/core/libraries/ulobjmgr/ulobjmgr.h (+10 -1)

📄 Description

  • Redesign OrbisFiber struct to match PS4's internal layout, including new fields, padding, and explicit size/alignment checks.
  • Store entry, arg_on_initialize, and name in obfuscated (XORed) form; add helper functions for encoding/decoding.
  • Replace plain name string with XORed byte array and per-fiber randomization.
  • Add random_pad field, filled with pseudo-random data on init.
  • Use atomic helpers for fiber state transitions instead of direct atomic access.
  • Update all code to use new accessors for obfuscated fields.
  • Improve stack overflow and context size margin checks.
  • Zero-initialize OrbisFiberOptParam in its initializer.
  • Add and includes for new memory operations.
  • Miscellaneous bug fixes and code cleanup.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3955 **Author:** [@w1naenator](https://github.com/w1naenator) **Created:** 1/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `gr2fix` --- ### 📝 Commits (10+) - [`ac9d816`](https://github.com/shadps4-emu/shadPS4/commit/ac9d816db5022a5188703063d50547c0fd4b25f0) Refactor OrbisFiber to match PS4 layout and obfuscation - [`da7d52c`](https://github.com/shadps4-emu/shadPS4/commit/da7d52c7c920bb1cb7b840d1bcadab6c55e5d052) Merge branch 'main' into gr2fix - [`8a01876`](https://github.com/shadps4-emu/shadPS4/commit/8a0187685d25ee753856811ec91d77bdac90d80d) Add Ulobjmgr integration and enhance fiber management - [`a7b4ba4`](https://github.com/shadps4-emu/shadPS4/commit/a7b4ba469f4082142dfd7c16f2f4df4b2f7c0ff8) clang - [`fc9cde2`](https://github.com/shadps4-emu/shadPS4/commit/fc9cde2f51d9a7232957d368ecccf58824fce948) Merge branch 'gr2fix' of https://github.com/w1naenator/shadPS4 into gr2fix - [`19ce9ac`](https://github.com/shadps4-emu/shadPS4/commit/19ce9ac146b07ac54a9548e00511de80cd327ec2) Add Mach-O support for fiber switching and stack management - [`90e075e`](https://github.com/shadps4-emu/shadPS4/commit/90e075ea52598f6902ecb5d69c702d0b18362bb2) Enhance Mach-O fiber switching functions with visibility attributes - [`7b41512`](https://github.com/shadps4-emu/shadPS4/commit/7b41512f9c317b64ca06fd000d5262b6fac5303b) clang - [`63f07a8`](https://github.com/shadps4-emu/shadPS4/commit/63f07a83032c2101ab6d467676941a39b712320e) Enhance Mach-O fiber switching functions with externally visible attributes - [`c1cabf8`](https://github.com/shadps4-emu/shadPS4/commit/c1cabf872b2579521653dced56ebcbdac0d692d9) Update fiber handling for Mach-O with visibility attributes and adjust compile options for Apple ### 📊 Changes **11 files changed** (+644 additions, -164 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+3 -0) 📝 `src/common/logging/filter.cpp` (+1 -0) 📝 `src/common/logging/types.h` (+1 -0) 📝 `src/core/libraries/fiber/fiber.cpp` (+492 -76) 📝 `src/core/libraries/fiber/fiber.h` (+65 -32) 📝 `src/core/libraries/fiber/fiber_context.s` (+59 -54) 📝 `src/core/libraries/kernel/memory.h` (+2 -0) 📝 `src/core/libraries/kernel/threads/pthread.h` (+2 -0) 📝 `src/core/libraries/razor_cpu/razor_cpu.h` (+4 -1) 📝 `src/core/libraries/ulobjmgr/ulobjmgr.cpp` (+5 -0) 📝 `src/core/libraries/ulobjmgr/ulobjmgr.h` (+10 -1) </details> ### 📄 Description - Redesign OrbisFiber struct to match PS4's internal layout, including new fields, padding, and explicit size/alignment checks. - Store entry, arg_on_initialize, and name in obfuscated (XORed) form; add helper functions for encoding/decoding. - Replace plain name string with XORed byte array and per-fiber randomization. - Add random_pad field, filled with pseudo-random data on init. - Use atomic helpers for fiber state transitions instead of direct atomic access. - Update all code to use new accessors for obfuscated fields. - Improve stack overflow and context size margin checks. - Zero-initialize OrbisFiberOptParam in its initializer. - Add <cstring> and <cstddef> includes for new memory operations. - Miscellaneous bug fixes and code cleanup. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3822
No description provided.