From 6683059a48480f3b745db10108f8c0498cfcb931 Mon Sep 17 00:00:00 2001 From: Sajid Date: Wed, 11 Sep 2024 22:06:01 +0600 Subject: [PATCH] Different function type --- PowerUtils/xbox.h | 11 ++++++----- tests/PowerAnalyse/private/.gitignore | 2 ++ thirdparty/disasm/ppc.h | 3 +++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 tests/PowerAnalyse/private/.gitignore diff --git a/PowerUtils/xbox.h b/PowerUtils/xbox.h index 0ea6968..6e6e48a 100644 --- a/PowerUtils/xbox.h +++ b/PowerUtils/xbox.h @@ -162,7 +162,7 @@ struct _XLIST_ENTRY; typedef _XLIST_ENTRY XLIST_ENTRY; typedef xpointer PXLIST_ENTRY; -typedef struct _X_RUNTIME_FUNCTION +typedef struct _IMAGE_CE_RUNTIME_FUNCTION { DWORD BeginAddress; @@ -171,14 +171,15 @@ typedef struct _X_RUNTIME_FUNCTION DWORD Data; struct { - DWORD FunctionType : 2; - DWORD FunctionLength : 22; DWORD PrologLength : 8; + DWORD FunctionLength : 22; + DWORD ThirtyTwoBit : 1; + DWORD ExceptionFlag : 1; }; }; -} X_RUNTIME_FUNCTION; +} IMAGE_CE_RUNTIME_FUNCTION; -static_assert(sizeof(X_RUNTIME_FUNCTION) == 8); +static_assert(sizeof(IMAGE_CE_RUNTIME_FUNCTION) == 8); typedef struct _XLIST_ENTRY { diff --git a/tests/PowerAnalyse/private/.gitignore b/tests/PowerAnalyse/private/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/tests/PowerAnalyse/private/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/thirdparty/disasm/ppc.h b/thirdparty/disasm/ppc.h index 03ecad7..a425c98 100644 --- a/thirdparty/disasm/ppc.h +++ b/thirdparty/disasm/ppc.h @@ -19,6 +19,9 @@ /* A macro to extract whether the branch is a link. */ #define PPC_BL(i) (!!((i) & 1)) +/* A macro to extract the branch operation of an instruction. */ +#define PPC_BO(i) (((i) >> 21) & 0x1F) + #define PPC_OP_TDI 2 #define PPC_OP_TWI 3 #define PPC_OP_MULLI 7