diff --git a/PowerUtils/ppc_context.h b/PowerUtils/ppc_context.h index 0930e88..2c6dd5c 100644 --- a/PowerUtils/ppc_context.h +++ b/PowerUtils/ppc_context.h @@ -105,8 +105,12 @@ #define PPC_CALL_FUNC(x) x(ctx, base) #endif +#define PPC_MEMORY_SIZE 0x100000000ull +#define PPC_FUNC_TABLE_OFFSET PPC_MEMORY_SIZE +#define PPC_FUNC_TABLE_SIZE 0x200000000ull + #ifndef PPC_CALL_INDIRECT_FUNC -#define PPC_CALL_INDIRECT_FUNC(x) (*(PPCFunc**)(ctx.fn + uint64_t(x) * 2))(ctx, base) +#define PPC_CALL_INDIRECT_FUNC(x) (*(PPCFunc**)(base + PPC_FUNC_TABLE_OFFSET + (uint64_t(x) * 2)))(ctx, base) #endif typedef void PPCFunc(struct PPCContext& __restrict__ ctx, uint8_t* base); @@ -309,7 +313,6 @@ struct PPCContext PPCRegister r31; #endif - uint8_t* fn; #ifndef PPC_CONFIG_SKIP_LR uint64_t lr; #endif