remill icon indicating copy to clipboard operation
remill copied to clipboard

Remill does not recognize `adcs`

Open aqjune opened this issue 2 years ago • 2 comments

Hello all, It seems Remill cannot lift the adcs instruction in ARMv8. I tested HEX code 0e020cba : https://armconverter.com/?disasm&code=0e020cba&offset=400544

I attach the bash command that I used:

 docker run --rm -it remill \
      --arch aarch64 --address 0x400544 --ir_out /dev/stdout \
      -bytes 0e020cba

aqjune avatar Jan 13 '23 22:01 aqjune

you can implement it by yourself, here is how its semantic should looks like :


void SemanticAdcs(Context &ctx) {
  auto &state = ctx.NewState();
  auto &alu = state.alu;
  alu.result = state.regs[0].W() + state.regs[1].W() + alu.carry;
  alu.flags.C = (alu.result < state.regs[0].W());
  alu.flags.Z = (alu.result == 0);
  alu.flags.S = (alu.result & 0x80000000);
  alu.flags.O = (((state.regs[0].W() ^ state.regs[1].W()) & (state.regs[0].W() ^ alu.result)) & 0x80000000);
}

hxm-cpp avatar Jan 14 '23 16:01 hxm-cpp