forked from xvortex/ps4-hen-vtx
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,723 additions
and
1,730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,111 @@ | ||
#ifndef __DEFINES | ||
#define __DEFINES | ||
#ifndef __DEFINES_H__ | ||
#define __DEFINES_H__ | ||
#pragma once | ||
|
||
#define VERSION "2.0" | ||
#define VERSION "2.1" | ||
|
||
//#define DEBUG_SOCKET | ||
|
||
#define LOG_IP "192.168.1.3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" | ||
#define LOG_PORT 9023 | ||
|
||
struct filedesc { | ||
void *useless1[3]; | ||
void *fd_rdir; | ||
void *fd_jdir; | ||
void *useless1[3]; | ||
void *fd_rdir; | ||
void *fd_jdir; | ||
}; | ||
|
||
struct proc { | ||
char useless[64]; | ||
struct ucred *p_ucred; | ||
struct filedesc *p_fd; | ||
char useless[64]; | ||
struct ucred *p_ucred; | ||
struct filedesc *p_fd; | ||
}; | ||
|
||
struct thread { | ||
void *useless; | ||
struct proc *td_proc; | ||
void *useless; | ||
struct proc *td_proc; | ||
}; | ||
|
||
struct auditinfo_addr { | ||
char useless[184]; | ||
char useless[184]; | ||
}; | ||
|
||
struct ucred { | ||
uint32_t useless1; | ||
uint32_t cr_uid; // effective user id | ||
uint32_t cr_ruid; // real user id | ||
uint32_t useless2; | ||
uint32_t useless3; | ||
uint32_t cr_rgid; // real group id | ||
uint32_t useless4; | ||
void *useless5; | ||
void *useless6; | ||
void *cr_prison; // jail(2) | ||
void *useless7; | ||
uint32_t useless8; | ||
void *useless9[2]; | ||
void *useless10; | ||
struct auditinfo_addr useless11; | ||
uint32_t *cr_groups; // groups | ||
uint32_t useless12; | ||
uint32_t useless1; | ||
uint32_t cr_uid; // effective user id | ||
uint32_t cr_ruid; // real user id | ||
uint32_t useless2; | ||
uint32_t useless3; | ||
uint32_t cr_rgid; // real group id | ||
uint32_t useless4; | ||
void *useless5; | ||
void *useless6; | ||
void *cr_prison; // jail(2) | ||
void *useless7; | ||
uint32_t useless8; | ||
void *useless9[2]; | ||
void *useless10; | ||
struct auditinfo_addr useless11; | ||
uint32_t *cr_groups; // groups | ||
uint32_t useless12; | ||
}; | ||
|
||
struct payload_info | ||
{ | ||
uint8_t* buffer; | ||
size_t size; | ||
struct payload_info { | ||
uint8_t* buffer; | ||
size_t size; | ||
}; | ||
|
||
struct payload_header | ||
{ | ||
uint64_t signature; | ||
size_t entrypoint_offset; | ||
struct payload_header { | ||
uint64_t signature; | ||
size_t entrypoint_offset; | ||
}; | ||
|
||
struct install_payload_args | ||
{ | ||
void* syscall_handler; | ||
struct payload_info* payload_info; | ||
struct install_payload_args { | ||
void* syscall_handler; | ||
struct payload_info* payload_info; | ||
}; | ||
|
||
static inline __attribute__((always_inline)) uint64_t __readmsr(unsigned long __register) | ||
{ | ||
unsigned long __edx; | ||
unsigned long __eax; | ||
__asm__ ("rdmsr" : "=d"(__edx), "=a"(__eax) : "c"(__register)); | ||
return (((uint64_t)__edx) << 32) | (uint64_t)__eax; | ||
static inline __attribute__((always_inline)) uint64_t __readmsr(unsigned long __register) { | ||
unsigned long __edx; | ||
unsigned long __eax; | ||
__asm__ ("rdmsr" : "=d"(__edx), "=a"(__eax) : "c"(__register)); | ||
return (((uint64_t)__edx) << 32) | (uint64_t)__eax; | ||
} | ||
|
||
#define X86_CR0_WP (1 << 16) | ||
|
||
static inline __attribute__((always_inline)) uint64_t readCr0(void) | ||
{ | ||
uint64_t cr0; | ||
__asm__ volatile ("movq %0, %%cr0" : "=r" (cr0) : : "memory"); | ||
return cr0; | ||
static inline __attribute__((always_inline)) uint64_t readCr0(void) { | ||
uint64_t cr0; | ||
__asm__ volatile ("movq %0, %%cr0" : "=r" (cr0) : : "memory"); | ||
return cr0; | ||
} | ||
|
||
static inline __attribute__((always_inline)) void writeCr0(uint64_t cr0) | ||
{ | ||
__asm__ volatile("movq %%cr0, %0" : : "r" (cr0) : "memory"); | ||
static inline __attribute__((always_inline)) void writeCr0(uint64_t cr0) { | ||
__asm__ volatile("movq %%cr0, %0" : : "r" (cr0) : "memory"); | ||
} | ||
|
||
static inline __attribute__((always_inline)) void disable_interrupts(void) | ||
{ | ||
asm volatile("cli"); | ||
static inline __attribute__((always_inline)) void disable_interrupts(void) { | ||
__asm__ volatile("cli"); | ||
} | ||
|
||
static inline __attribute__((always_inline)) void enable_interrupts(void) | ||
{ | ||
asm volatile("sti"); | ||
static inline __attribute__((always_inline)) void enable_interrupts(void) { | ||
__asm__ volatile("sti"); | ||
} | ||
|
||
static inline __attribute__((always_inline)) uint64_t read_flags(void) | ||
{ | ||
uint64_t flags; | ||
asm volatile("pushf; pop %0;" : "=r" (flags)); | ||
return flags; | ||
static inline __attribute__((always_inline)) uint64_t read_flags(void) { | ||
uint64_t flags; | ||
__asm__ volatile("pushf; pop %0;" : "=r" (flags)); | ||
return flags; | ||
} | ||
|
||
static inline __attribute__((always_inline)) uint64_t intr_disable(void) | ||
{ | ||
uint64_t flags = read_flags(); | ||
disable_interrupts(); | ||
return flags; | ||
static inline __attribute__((always_inline)) uint64_t intr_disable(void) { | ||
uint64_t flags = read_flags(); | ||
disable_interrupts(); | ||
return flags; | ||
} | ||
|
||
static inline __attribute__((always_inline)) void intr_restore(uint64_t flags) | ||
{ | ||
asm volatile("push %0; popf;" : : "rm" (flags) : "memory"); | ||
static inline __attribute__((always_inline)) void intr_restore(uint64_t flags) { | ||
__asm__ volatile("push %0; popf;" : : "rm" (flags) : "memory"); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef __OFFSETS_H__ | ||
#define __OFFSETS_H__ | ||
#pragma once | ||
|
||
// 5.05 | ||
#define XFAST_SYSCALL_addr 0x00001C0 | ||
|
||
// Names - Data | ||
#define PRISON0_addr 0x10986A0 | ||
#define ROOTVNODE_addr 0x22C1A70 | ||
#define PMAP_STORE_addr 0x22CB570 | ||
#define DT_HASH_SEGMENT_addr 0x0B5EF30 | ||
|
||
// Functions | ||
#define pmap_protect_addr 0x02E3090 | ||
#define pmap_protect_p_addr 0x02E30D4 | ||
|
||
// Patches | ||
// debug menu error | ||
#define debug_menu_error_patch1 0x04F9048 | ||
#define debug_menu_error_patch2 0x04FA15C | ||
|
||
// disable signature check | ||
#define disable_signature_check_patch 0x06A2700 | ||
|
||
// enable debug RIFs | ||
#define enable_debug_rifs_patch1 0x064B2B0 | ||
#define enable_debug_rifs_patch2 0x064B2D0 | ||
|
||
// enable VR | ||
#define enable_vr_patch 0x14A63F1 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.