Basic function analysis.

Finds basic blocks and estimates proper function bounds.
Seems legit for compiled code.
This commit is contained in:
Ben Vanik
2013-01-20 16:46:08 -08:00
parent d4b0bf73c1
commit 852536ae0a
7 changed files with 400 additions and 25 deletions

View File

@@ -56,6 +56,14 @@ typedef enum {
class InstrType;
static inline int32_t XEEXTS16(uint32_t v) {
return (int32_t)((int16_t)v);
}
static inline int32_t XEEXTS26(uint32_t v) {
return v & 0x02000000 ? (int32_t)v | 0xFC000000 : (int32_t)(v);
}
typedef struct {
InstrType* type;
uint32_t address;
@@ -97,6 +105,14 @@ typedef struct {
} DS;
// kXEPPCInstrFormatX
// kXEPPCInstrFormatXL
struct {
uint32_t LK : 1;
uint32_t : 10;
uint32_t BB : 5;
uint32_t BI : 5;
uint32_t BO : 5;
uint32_t OPCD : 6;
} XL;
struct {
uint32_t : 1;
uint32_t : 10;
@@ -114,7 +130,7 @@ typedef struct {
// kXEPPCInstrFormatVA
// kXEPPCInstrFormatVX
// kXEPPCInstrFormatVXR
} data;
};
} InstrData;
class Instr {