Vector35 / Vector35/binaryninja-api

sub_borrow doesn't have default carry flag handler

Open
#5,123 3 comments 0 reactions 1 assignee View on GitHub

@galenbwill is already working on this.

Since Apr 4, 2024.

Arch: Z80 Component: Architecture Core: LLIL Lifting
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 3.5.4526
  • OS: win10
  • OS 10
  • CPU x64

Bug Description:
Extending the gameboy plugin to implement LLIL lifting, the carry flag appears to process correctly on most arithmetic instructions but sub_borrow raises an error

replicating
0000397c 9a sbc A, D

image

in comparison, SUB works fine

00003977 92 sub D

my guess is this was just an oversight and the flag calculation on LowLevelILFunction.sub() can be copied across (unsigned comparison of rhs and result and if result is larger then we have overflowed and set C)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.