RetroArch
Classes | Macros | Typedefs | Functions | Variables
ctr_svchax.c File Reference
#include <3ds.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
Include dependency graph for ctr_svchax.c:

Classes

struct  mch2_thread_args_t
 
struct  mch2_thread_t
 
struct  mch2_vars_t
 

Macros

#define CURRENT_KTHREAD   0xFFFF9000
 
#define CURRENT_KPROCESS   0xFFFF9004
 
#define CURRENT_KPROCESS_HANDLE   0xFFFF8001
 
#define RESOURCE_LIMIT_THREADS   0x2
 
#define MCH2_THREAD_COUNT_MAX   0x20
 
#define MCH2_THREAD_STACKS_SIZE   0x1000
 
#define SVC_ACL_OFFSET(svc_id)   (((svc_id) >> 5) << 2)
 
#define SVC_ACL_MASK(svc_id)   (0x1 << ((svc_id) & 0x1F))
 
#define THREAD_PAGE_ACL_OFFSET   0xF38
 

Typedefs

typedef u32(* backdoor_fn) (u32 arg0, u32 arg1)
 

Functions

 __attribute ((naked))
 
static void k_enable_all_svcs (u32 isNew3DS)
 
static u32 k_read_kaddr (u32 *kaddr)
 
static u32 read_kaddr (u32 kaddr)
 
static u32 k_write_kaddr (u32 *kaddr, u32 val)
 
static void write_kaddr (u32 kaddr, u32 val)
 
 __attribute__ ((naked))
 
static void alloc_thread_entry (mch2_vars_t *mch2)
 
static void dummy_thread_entry (Handle lock)
 
static void check_tls_thread_entry (bool *keep)
 
static void target_thread_entry (mch2_thread_args_t *args)
 
static u32 get_first_free_basemem_page (bool isNew3DS)
 
static u32 get_threads_limit (void)
 
static void do_memchunkhax2 (void)
 
static void gspwn (u32 dst, u32 src, u32 size, u8 *flush_buffer)
 
static void memchunkhax1_write_pair (u32 val1, u32 val2)
 
static void do_memchunkhax1 (void)
 
Result svchax_init (bool patch_srv)
 

Variables

u32 __ctr_svchax = 0
 
u32 __ctr_svchax_srv = 0
 
void__service_ptr
 

Macro Definition Documentation

◆ CURRENT_KPROCESS

#define CURRENT_KPROCESS   0xFFFF9004

◆ CURRENT_KPROCESS_HANDLE

#define CURRENT_KPROCESS_HANDLE   0xFFFF8001

◆ CURRENT_KTHREAD

#define CURRENT_KTHREAD   0xFFFF9000

◆ MCH2_THREAD_COUNT_MAX

#define MCH2_THREAD_COUNT_MAX   0x20

◆ MCH2_THREAD_STACKS_SIZE

#define MCH2_THREAD_STACKS_SIZE   0x1000

◆ RESOURCE_LIMIT_THREADS

#define RESOURCE_LIMIT_THREADS   0x2

◆ SVC_ACL_MASK

#define SVC_ACL_MASK (   svc_id)    (0x1 << ((svc_id) & 0x1F))

◆ SVC_ACL_OFFSET

#define SVC_ACL_OFFSET (   svc_id)    (((svc_id) >> 5) << 2)

◆ THREAD_PAGE_ACL_OFFSET

#define THREAD_PAGE_ACL_OFFSET   0xF38

Typedef Documentation

◆ backdoor_fn

typedef u32(* backdoor_fn) (u32 arg0, u32 arg1)

Function Documentation

◆ __attribute()

__attribute ( (naked)  )
Here is the call graph for this function:

◆ __attribute__()

__attribute__ ( (naked)  )
Here is the call graph for this function:

◆ alloc_thread_entry()

static void alloc_thread_entry ( mch2_vars_t mch2)
static
Here is the caller graph for this function:

◆ check_tls_thread_entry()

static void check_tls_thread_entry ( bool keep)
static
Here is the caller graph for this function:

◆ do_memchunkhax1()

static void do_memchunkhax1 ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_memchunkhax2()

static void do_memchunkhax2 ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dummy_thread_entry()

static void dummy_thread_entry ( Handle  lock)
static
Here is the caller graph for this function:

◆ get_first_free_basemem_page()

static u32 get_first_free_basemem_page ( bool  isNew3DS)
static
Here is the caller graph for this function:

◆ get_threads_limit()

static u32 get_threads_limit ( void  )
static
Here is the caller graph for this function:

◆ gspwn()

static void gspwn ( u32  dst,
u32  src,
u32  size,
u8 flush_buffer 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ k_enable_all_svcs()

static void k_enable_all_svcs ( u32  isNew3DS)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ k_read_kaddr()

static u32 k_read_kaddr ( u32 kaddr)
static
Here is the caller graph for this function:

◆ k_write_kaddr()

static u32 k_write_kaddr ( u32 kaddr,
u32  val 
)
static
Here is the caller graph for this function:

◆ memchunkhax1_write_pair()

static void memchunkhax1_write_pair ( u32  val1,
u32  val2 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_kaddr()

static u32 read_kaddr ( u32  kaddr)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ svchax_init()

Result svchax_init ( bool  patch_srv)
Here is the call graph for this function:

◆ target_thread_entry()

static void target_thread_entry ( mch2_thread_args_t args)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_kaddr()

static void write_kaddr ( u32  kaddr,
u32  val 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __ctr_svchax

u32 __ctr_svchax = 0

◆ __ctr_svchax_srv

u32 __ctr_svchax_srv = 0

◆ __service_ptr

void* __service_ptr