Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remill does not recognize adcs #649

Open
aqjune opened this issue Jan 13, 2023 · 2 comments
Open

Remill does not recognize adcs #649

aqjune opened this issue Jan 13, 2023 · 2 comments

Comments

@aqjune
Copy link

aqjune commented Jan 13, 2023

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
@hxm-cpp
Copy link

hxm-cpp commented Jan 14, 2023

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@aqjune @hxm-cpp and others