Implement jcxz

This commit is contained in:
Theodore Dubois 2018-05-25 14:56:37 -07:00
parent 65d65a813a
commit 25931324fe
2 changed files with 9 additions and 1 deletions

View File

@ -31,6 +31,14 @@
.gadget jmp
movl (%_ip), %_eip
jmp jit_ret
.gadget jcxz
cmpl $0, %ecx
jne 1f
movl (%_ip), %_eip
jmp jit_ret
1:
movl 8(%_ip), %_eip
jmp jit_ret
#define COND_LIST o,c,z,cz,s,p,sxo,sxoz
#define IMPLEMENTED_CONDS c,z,cz,s,p,sxo,sxoz

View File

@ -156,7 +156,7 @@ static inline void gen_op(struct gen_state *state, gadget_t *gadgets, enum arg a
#define JMP(loc) load(loc, OP_SIZE); g(jmp_indir)
#define JMP_REL(off) gg(jmp, state->ip + off)
#define JCXZ_REL(off) UNDEFINED
#define JCXZ_REL(off) ggg(jcxz, state->ip + off, state->ip)
#define J_REL(cc, off) gagg(jmp, cond_##cc, state->ip + off, state->ip)
#define JN_REL(cc, off) gagg(jmp, cond_##cc, state->ip, state->ip + off)
#define CALL(loc) load(loc, OP_SIZE); ggg(call_indir, saved_ip, state->ip)