GithubHelp home page GithubHelp logo

Comments (3)

m4drat avatar m4drat commented on May 26, 2024 1

Hi! Thanks for a quick fix :) Now everything seems to work correctly!

image

from triton.

cnheitman avatar cnheitman commented on May 26, 2024

Hi @m4drat !

It seems the issue comes from the fact that the instruction is decoded differently by Capstone depending on the mode. In ARM mode, it includes the pc among its operands (this is where the comment you pointed out comes from) while in Thumb mode it doesn't, as shown below:

$ cstool -d thumb "08 A0"       # ADR R0, 0x20
 0  08 a0  adr  r0, #0x20
    ID: 4 (adr)
    op_count: 2
        operands[0].type: REG = r0
        operands[0].access: WRITE
        operands[1].type: IMM = 0x20
    Registers modified: r0
    Groups: thumb thumb1only
$ cstool -d arm "20 00 8F E2"   # ADR R0, 0x20
 0  20 00 8f e2  add    r0, pc, #0x20
    ID: 2 (add)
    op_count: 3
        operands[0].type: REG = r0
        operands[0].access: WRITE
        operands[1].type: REG = pc
        operands[1].access: READ
        operands[2].type: IMM = 0x20
    Registers read: pc
    Registers modified: r0
    Groups: arm

I will update the semantics (function adr_s) to fix the behavior when in Thumb mode.

This issue does not seem to affect the instruction for the ARM64 arch.

from triton.

cnheitman avatar cnheitman commented on May 26, 2024

Hi @m4drat ! I fixed this issue in the following PR: #1300.

Could you confirm it fixes the issue?

from triton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.