Adds thread structure

This commit is contained in:
Putta Khunchalee 2023-07-01 23:10:04 +07:00
parent 999bca2705
commit 3edfbdfc67
6 changed files with 43 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
book

View File

@ -6,6 +6,10 @@ This repository contains informations that was gathered from the reverse enginee
We cannot accept any raw materials like files from the PS4 and the original code that was copied from the PS4.
## Writing the docs
This project use [mdBook](https://rust-lang.github.io/mdBook/) so take a look on its documentation for how to write the docs.
## License
BSD Zero Clause

6
book.toml Normal file
View File

@ -0,0 +1,6 @@
[book]
authors = ["Putta Khunchalee"]
language = "en"
multilingual = false
src = "src"
title = "PS4 reverse engineering"

4
src/SUMMARY.md Normal file
View File

@ -0,0 +1,4 @@
# Summary
- [Kernel](kernel/README.md)
- [Data Structures](kernel/data-structures.md)

1
src/kernel/README.md Normal file
View File

@ -0,0 +1 @@
# Kernel

View File

@ -0,0 +1,27 @@
# Data Structures
## thread
This struct was derived from [FreeBSD](https://github.com/freebsd/freebsd-src/blob/release/9.1.0/sys/sys/proc.h#L204).
| 9.0 | Type | Name | Description |
| ----- | ----------- | ------------- | ----------- |
| 0x008 | proc * | td_proc | The process of this thread. |
| 0x088 | i32 | td_tid | Thread ID. |
| 0x090 | sigqueue | td_sigqueue | Pending signals. |
| 0x0D4 | i32 | td_flags ||
| 0x0D8 | i32 | td_inhibitors ||
| 0x0DC | i32 | td_pflags ||
| 0x0E8 | void * | td_wchan ||
| 0x130 | ucred * | td_ucred ||
| 0x220 | u32 | td_pticks ||
| 0x270 | i32 | td_xsig ||
| 0x284 | char[32] | td_name ||
| 0x2A8 | file * | td_fpop ||
| 0x2B0 | i32 | td_dbgflags ||
| 0x388 | pcb * | td_pcb ||
| 0x390 | i32 | td_state ||
| 0x398 | i64[2] | td_retval | `rax` and `rdx` to return from current syscall. |
| 0x3A8 | callout | td_slpcallout ||
| 0x3E0 | trapframe * | td_frame | User space CPU states. |
| 0x438 | i32 | td_errno ||