Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lifter] Represent BNinja void correctly #405

Open
NeoQuix opened this issue Mar 26, 2024 · 0 comments
Open

[Lifter] Represent BNinja void correctly #405

NeoQuix opened this issue Mar 26, 2024 · 0 comments
Assignees
Labels
feature-request New feature or request

Comments

@NeoQuix
Copy link
Collaborator

NeoQuix commented Mar 26, 2024

Proposal

Currently the lifter implicitly promotes a detected BNinja void type into an void* because C (and DeWolf) does not have a concept of a void datatype.
This leads to the problem of the lifter deciding when to drop a & or not, which again is not its job.

With the new array type, we can represent an void type as an constant array of bytes, e.g. unsigned char [].
This fixes the problem of "cheating" the type into an pointer.
The value will still stay the same (string of escaped hex chars).

Approach

Change globals.py _lift_void_type to return an unsigned char[] instead of an void*.
Fix possible problems at the backend for correct printing.

@NeoQuix NeoQuix added the feature-request New feature or request label Mar 26, 2024
@NeoQuix NeoQuix self-assigned this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant