Commit 33b5f4f2 authored by Julian Kranz's avatar Julian Kranz
Browse files

X86 RREIL Translator

- Continued to add semantics for: JMP
parent dcc260d6
......@@ -142,7 +142,7 @@ val /IFGOTO c sz t = SEM_IF_GOTO{cond=c,size=sz,target=t}
val /GOTOLABEL l = SEM_IF_GOTO_LABEL{cond=SEM_LIN_IMM{imm=1},label=l}
val /ITE c t e = SEM_ITE{cond=c,then_branch=t,else_branch=e}
val /WHILE c b = SEM_WHILE{cond=c,body=b}
val /CALL address = SEM_BRANCH{hint=HINT_CALL,target=address}
val /BRANCH hint address = SEM_BRANCH{hint=hint,target=address}
val push insn = do
tl <- query $stack;
......@@ -201,7 +201,9 @@ val gotolabel l = push (/GOTOLABEL l)
val ifgoto c sz addr = push (/IFGOTO c sz addr)
val ite c t e = push (/ITE c t e)
val while c b = push (/WHILE c b)
val call address = push (/CALL address)
val jump address = push (/BRANCH HINT_JUMP address)
val call address = push (/BRANCH HINT_CALL address)
val ret address = push (/BRANCH HINT_RET address)
val const i = return (SEM_LIN_IMM{imm=i})
val imm i = SEM_LIN_IMM{imm=i}
......@@ -33,6 +33,7 @@ val semantic-register-of r =
| EBP: {id=ARCH_R 13,offset=0,size=32}
| ESI: {id=ARCH_R 14,offset=0,size=32}
| EDI: {id=ARCH_R 15,offset=0,size=32}
| CS: {id=ARCH_R 16,offset=0,size=16}
val arch-show-id r =
......@@ -518,13 +518,28 @@ val sem-jmp x = do
return void
else if (not mode64) then
mov ip-sz temp-ip target;
if (opnd-sz === 16) then
andb ip-sz temp-ip (var temp-ip) (imm 0xffff)
return void
temp-target <- mktemp;
mov target-sz temp-target target;
reg <- return CS;
reg-sem <- return (semantic-register-of reg);
reg-size <- sizeof1 (REG reg);
mov reg-size reg-sem (var (at-offset temp-target ip-sz));
mov ip-sz temp-ip target
return void
# on3 <- const 1;
# ifgoto on3 sz target
call (address ip-sz (var temp-ip))
jump (address ip-sz (var temp-ip))
val sem-lea x = do
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment