From 6f523f4836dd53b7e33ec4c55c9aa90da08d259c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 27 Sep 2011 22:11:02 +0000 Subject: [PATCH] Architecture plug-ins should be able to (de)initialize --- include/Asm/arch.h | 2 ++ src/arch/amd64.c | 2 ++ src/arch/arm.c | 2 ++ src/arch/dalvik.c | 2 ++ src/arch/i386.c | 2 ++ src/arch/i386_real.c | 2 ++ src/arch/i486.c | 2 ++ src/arch/i586.c | 2 ++ src/arch/i686.c | 2 ++ src/arch/java.c | 2 ++ src/arch/mips.c | 2 ++ src/arch/sparc.c | 2 ++ src/arch/sparc64.c | 2 ++ 13 files changed, 26 insertions(+) diff --git a/include/Asm/arch.h b/include/Asm/arch.h index 49474c0..7cc8e7e 100644 --- a/include/Asm/arch.h +++ b/include/Asm/arch.h @@ -220,6 +220,8 @@ struct _ArchPlugin ArchRegister * registers; ArchInstruction * instructions; + int (*init)(ArchPlugin * arch); + void (*exit)(ArchPlugin * arch); int (*write)(ArchPlugin * arch, ArchInstruction * instruction, ArchInstructionCall * call); int (*decode)(ArchPlugin * arch, ArchInstructionCall * call); diff --git a/src/arch/amd64.c b/src/arch/amd64.c index 9a582e7..480b1f7 100644 --- a/src/arch/amd64.c +++ b/src/arch/amd64.c @@ -81,6 +81,8 @@ ArchPlugin arch_plugin = NULL, _amd64_registers, _amd64_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/arm.c b/src/arch/arm.c index b0d1565..99fd70d 100644 --- a/src/arch/arm.c +++ b/src/arch/arm.c @@ -65,6 +65,8 @@ ArchPlugin arch_plugin = &_arm_description, _arm_registers, _arm_instructions, + NULL, + NULL, _arm_write, NULL }; diff --git a/src/arch/dalvik.c b/src/arch/dalvik.c index 2837822..a5199ef 100644 --- a/src/arch/dalvik.c +++ b/src/arch/dalvik.c @@ -91,6 +91,8 @@ ArchPlugin arch_plugin = &_dalvik_description, _dalvik_registers, _dalvik_instructions, + NULL, + NULL, _dalvik_write, _dalvik_decode }; diff --git a/src/arch/i386.c b/src/arch/i386.c index 55492a1..25887d2 100644 --- a/src/arch/i386.c +++ b/src/arch/i386.c @@ -73,6 +73,8 @@ ArchPlugin arch_plugin = NULL, _i386_registers, _i386_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/i386_real.c b/src/arch/i386_real.c index e486319..828df1a 100644 --- a/src/arch/i386_real.c +++ b/src/arch/i386_real.c @@ -74,6 +74,8 @@ ArchPlugin arch_plugin = NULL, _i386_real_registers, _i386_real_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/i486.c b/src/arch/i486.c index e2b58aa..9bad1f4 100644 --- a/src/arch/i486.c +++ b/src/arch/i486.c @@ -74,6 +74,8 @@ ArchPlugin arch_plugin = NULL, _i486_registers, _i486_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/i586.c b/src/arch/i586.c index 09a766c..49bb474 100644 --- a/src/arch/i586.c +++ b/src/arch/i586.c @@ -75,6 +75,8 @@ ArchPlugin arch_plugin = NULL, _i586_registers, _i586_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/i686.c b/src/arch/i686.c index f8e86d6..1aa00fd 100644 --- a/src/arch/i686.c +++ b/src/arch/i686.c @@ -77,6 +77,8 @@ ArchPlugin arch_plugin = NULL, _i686_registers, _i686_instructions, + NULL, + NULL, _i386_write, _i386_decode }; diff --git a/src/arch/java.c b/src/arch/java.c index b817b35..6d06233 100644 --- a/src/arch/java.c +++ b/src/arch/java.c @@ -262,6 +262,8 @@ ArchPlugin arch_plugin = &_java_description, _java_registers, _java_instructions, + NULL, + NULL, _java_write, _java_decode }; diff --git a/src/arch/mips.c b/src/arch/mips.c index 7d26b8f..b61eed2 100644 --- a/src/arch/mips.c +++ b/src/arch/mips.c @@ -54,6 +54,8 @@ ArchPlugin arch_plugin = &_mips_description, _mips_registers, _mips_instructions, + NULL, + NULL, _mips_write, NULL }; diff --git a/src/arch/sparc.c b/src/arch/sparc.c index c81dc85..c856507 100644 --- a/src/arch/sparc.c +++ b/src/arch/sparc.c @@ -54,6 +54,8 @@ ArchPlugin arch_plugin = &_sparc_description, _sparc_registers, _sparc_instructions, + NULL, + NULL, _sparc_write, _sparc_decode }; diff --git a/src/arch/sparc64.c b/src/arch/sparc64.c index c775af6..7519fee 100644 --- a/src/arch/sparc64.c +++ b/src/arch/sparc64.c @@ -54,6 +54,8 @@ ArchPlugin arch_plugin = &_sparc64_description, _sparc64_registers, _sparc64_instructions, + NULL, + NULL, _sparc_write, _sparc_decode };