Comments (2)
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.
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)
- Invalid CF calculation - `sbb`
- Invalid OF calculation - `xadd`, `sbb`
- Invalid stack operation - `pop`
- Invalid padding - `mov`
- Operand address changed - `xchg`, `xadd`, `cmpsb`, `cmpsd`
- No memory alignment - `movaps`, `movdqa`
- Invalid store/load AF behaviour - `sahf`, `lahf`
- Invalid order of calculation - `cmpxchg`
- Not taking part of value - `bt`, `bts`, `sbb`
- Invalid AF calculation - `scasb`, `scasd`, `add`, `adc`, `sbb`, `sub`, `cmp`, `inc`, `dec`
- Confusion of source and destination operands - `palingr`, `cmpxchg`
- Unable to recognize prefix - `mov`, `lea`
- Invalid pushad behaviour - `pushad`
- Missing arithmetic operation - `xadd` HOT 4
- Not storing segment register - `mov` [x64] HOT 2
- Webpage improvement HOT 3
- Test Remill semantics HOT 1
- TODOs before the final release HOT 1
- Example code for testing ARM lifting HOT 1
- Maintenance Issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meandiff.