Vector35 / Vector35/binaryninja-api

std::__throw_out_of_range_fmt(char const*, ...) __noreturn type is not imported correctly to type libraries

Open
#3,547 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Type Libraries Effort: Trivial Impact: Low
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.1.3770-dev (if version is stable, please also test the latest development build via the "Update Channel" option)
  • OS: macOS
  • OS Version: Monterey 12.0.1
  • CPU Architecture: M1

Bug Description:
In the cpp.c types file of the Binary Ninja application, I added the following type definition:

void ZSt24__throw_out_of_range_fmtPKcz(const char*, ...) __noreturn;
When I load a binary containing that external symbol, the type is not applied correctly. The external symbol does not contain the __noreturn attribute.

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Open <Binary Ninja.app>/Contents/Resources/types/cpp.c, append the following line, and save:

void ZSt24__throw_out_of_range_fmtPKcz(const char*, ...) __noreturn;

  1. Launch Binary Ninja
  2. Open with options the attached binary (libastylej.so.3.1.0) and ensure Image Base Address = 0x10000
  3. Navigate to 0x52e98 and verify that __noreturn attribute is not present on symbol for std::__throw_out_of_range_fmt

Expected Behavior:
I expected Binary Ninja to parse the type definition for ZSt24__throw_out_of_range_fmtPKcz and apply the __noreturn attribute to the symbol in the binary.

Screenshots:
image

Additional Information:

libastylej.so.3.1.0.zip

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.

Research direction

Start with the type definition in Contents/Resources/types/cpp.c and reproduce the issue using the attached libastylej.so.3.1.0 binary, opening it with an image base of 0x10000. Inspect the symbol at 0x52e98 and trace how the __noreturn attribute is imported. Done means the attribute appears on std::__throw_out_of_range_fmt.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.