Archive of https://github.com/itsPLK/ps5-kexp — payload that does post jailbreak related stuff https://github.com/itsPLK/ps5-kexp
  • C 91.7%
  • Shell 3.7%
  • Makefile 2.4%
  • Dockerfile 1.2%
  • Assembly 0.7%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-29 12:51:36 +02:00
.github/workflows build: add manual release workflow and remove obsolete build.yml 2026-05-24 00:14:56 +02:00
include - call loader directly instead of thread spawn 2026-09-29 12:51:36 +02:00
src - call loader directly instead of thread spawn 2026-09-29 12:51:36 +02:00
.clang-format initial commit 2026-05-17 09:56:18 +04:00
.gitignore Update kernel_data_base calculation. 2026-05-17 11:32:45 +04:00
build.sh build: add Docker-based build automation and cross-compilation support 2026-05-23 23:50:43 +02:00
Dockerfile build: add Docker-based build automation and cross-compilation support 2026-05-23 23:50:43 +02:00
LICENSE.md add LICENSE.md 2026-05-17 09:58:44 +04:00
Makefile fix: resolve build issues and make clean all race condition 2026-06-04 03:16:12 +02:00
README.md - call loader directly instead of thread spawn 2026-09-29 12:51:36 +02:00
script.ld build: add Docker-based build automation and cross-compilation support 2026-05-23 23:50:43 +02:00

kexp

How to use

1. Jailbreak from userland process

2. Create executable shared memory region
   exec_fd = jitshm_create(name = "", size = ALIGN_UP(kexp.length, PAGE_SIZE), permissions = RWX)

3. Map executable memory into process space
   entry_addr = mmap(
       address = 0,
       size = ALIGN_UP(kexp.length, PAGE_SIZE),
       permissions = RWX,
       flags = 0,
       fd = exec_fd,
       offset = 0
   )

4. Copy payload machine code into mapped memory
   memcpy(
       destination = entry_addr,
       source = kexp.buffer,
       size = kexp.length
   )

5. Allocate structure for kexp arguments
   kexp_args = allocate(0x28 bytes)

6. Fill kexp argument structure
    kexp_args:
      +0x00 = master_pipe[0]
      +0x04 = master_pipe[1]
      +0x08 = victim_pipe[0]
      +0x0C = victim_pipe[1]
      +0x10 = allproc
      +0x18 = elfldr_addr
      +0x20 = elfldr_size

7. Create new thread
    result = pthread_create(
        thread_handle_out = pthread_addr_out,
        attributes = NULL,
        start_routine = entry_addr,
        argument = kexp_args
    )

8. Wait for thread to finish
    pthread_addr = read_u64(pthread_addr_out)
    result = pthread_join(
        thread = pthread_addr,
        return_value_out = ret_addr
    )

9. Read thread return value
    ret = *ret_addr

10. Log return value
    print(ret)

11. Free kexp argument storage
    free(kexp_args)

12. Free return value storage
    free(ret_addr)

Credits

Special thanks to:

  • TheFloW
  • Specter
  • Gezine
  • cow
  • sb
  • Dr.Yenyen
  • flat_z