Giter Site home page Giter Site logo

Comments (2)

ivg avatar ivg commented on May 26, 2024

So, what I'm seeing here is that OF is cleared. The expression is just not simplified. In BAP 1.3 we have much better printer (that doesn't print unnecessary parenthesis), as well as better expression simplifier, e.g.,

 echo '\x28\xc0' | bap-mc --arch=x86 --show-bil --show-insn=asm
subb %al, %al
{
  v1 := low:8[EAX]
  EAX := extract:31:8[EAX].0
  CF := v1 < low:8[EAX]
  OF := high:1[v1 ^ low:8[EAX]]
  AF := 0x10 = (0x10 & (low:8[EAX] ^ v1 ^ low:8[EAX]))
  PF := ~low:1[let v2 = low:8[EAX] >> 4 ^ low:8[EAX] in
    let v2 = v2 >> 2 ^ v2 in
    v2 >> 1 ^ v2]
  SF := high:1[low:8[EAX]]
  ZF := 0 = low:8[EAX]
}

You may see that high:1[v1 ^ low:8[EAX]] is zero since v1 is equal to low:8[EAX] and xor of two equal values is 0, this the high bit of 0 is also a zero.

from meandiff.

soomin-kim avatar soomin-kim commented on May 26, 2024

Also in this case, like Issue #3, every statement should be executed sequentially so at the point of OF calculation, the lower 8 bit of EAX register is 0, not same as v1.
So if al contains a negative 8-bit width integer, OF should be 1 in BIL's semantics.

from meandiff.

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.