summaryrefslogtreecommitdiff
path: root/src/arch/x86/op_jump.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-04-12 19:15:35 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-04-12 19:15:35 (GMT)
commit216a3d0121fabd678e50ea6b4fa2447ae9b921f0 (patch)
tree395fcd91b674ff5652e34b46207ba08cc9e7af68 /src/arch/x86/op_jump.c
parentedac614a164d9cac345d914f4320d71bdb16ab79 (diff)
Created a debugging layout and introduced a heavier use of GLib.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@58 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/x86/op_jump.c')
-rw-r--r--src/arch/x86/op_jump.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/arch/x86/op_jump.c b/src/arch/x86/op_jump.c
index 44256e9..4a7fc72 100644
--- a/src/arch/x86/op_jump.c
+++ b/src/arch/x86/op_jump.c
@@ -112,6 +112,43 @@ asm_x86_instr *x86_read_instr_je_8(const uint8_t *data, off_t *pos, off_t len, u
* offset = adresse virtuelle de l'instruction. *
* proc = architecture ciblée par le désassemblage. *
* *
+* Description : Décode une instruction de type 'jg' (saut 8b si supérieur). *
+* *
+* Retour : Instruction mise en place ou NULL. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+asm_x86_instr *x86_read_instr_jg_rel8(const uint8_t *data, off_t *pos, off_t len, uint64_t offset, const asm_x86_processor *proc)
+{
+ asm_x86_instr *result; /* Instruction à retourner */
+
+ result = (asm_x86_instr *)calloc(1, sizeof(asm_x86_instr));
+
+ ASM_INSTRUCTION(result)->opcode = data[(*pos)++];
+
+ ASM_INSTRUCTION(result)->type = AIT_JUMP;
+
+ if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, offset))
+ {
+ free(result);
+ return NULL;
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : data = flux de données à analyser. *
+* pos = position courante dans ce flux. [OUT] *
+* len = taille totale des données à analyser. *
+* offset = adresse virtuelle de l'instruction. *
+* proc = architecture ciblée par le désassemblage. *
+* *
* Description : Décode une instruction de type 'jnb' (saut 8b si !inférieur).*
* *
* Retour : Instruction mise en place ou NULL. *