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

Recognize thiscall calling convention #604

Closed
plafosse opened this issue Jan 23, 2017 · 3 comments
Closed

Recognize thiscall calling convention #604

plafosse opened this issue Jan 23, 2017 · 3 comments
Assignees
Labels
Component: Core Issue needs changes to the core Impact: Medium Issue is impactful with a bad, or no, workaround Type: Bug Issue is a non-crashing bug with repro steps Type: Enhancement Issue is a small enhancement to existing functionality
Milestone

Comments

@plafosse
Copy link
Member

Currently we recover type information from C++ mangled names. This information is then used to inform analysis. This is great except in one specific case. If a binary using GNU3 mangled names has a non-static class member which takes a function pointer we may create invalid functions.

What happens is we query the type of the function for function pointers, we then query the value of the function pointer, if the value is constant then we create a function at this location. This works fine for all calling conventions except thiscall since the first parameter is implicit.

We do check if the offset we are making a function at is executable, but sometimes the compiler will put rodata into an executable segment!?

TL;DR; In some rare circumstances we can create functions where there shouldn't be functions.

@plafosse plafosse added Type: Bug Issue is a non-crashing bug with repro steps Component: Core Issue needs changes to the core Type: Enhancement Issue is a small enhancement to existing functionality labels Jul 16, 2017
@plafosse plafosse added the Impact: Medium Issue is impactful with a bad, or no, workaround label Jan 27, 2021
@ccarpenter04
Copy link

I'm sure anyone who is working with C++ binaries would greatly appreciate support for thiscall. The lack of auto-detecting the argument "this" was one of the first things that I noticed seemed to be missing when I first used BinaryNinja.

@jvinnedge
Copy link

Bumping this. Automatically recognizing thiscall would be extremely helpful.

@fuzyll fuzyll added this to the 3.2 (Windows) milestone May 2, 2022
@plafosse plafosse modified the milestones: 3.2 (Windows), 3.3 (Embedded) Jun 8, 2022
@fuzyll fuzyll modified the milestones: 3.3 (Embedded), 3.2 (Windows) Jun 8, 2022
@D0ntPanic
Copy link
Member

Fixed in build 3515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Issue needs changes to the core Impact: Medium Issue is impactful with a bad, or no, workaround Type: Bug Issue is a non-crashing bug with repro steps Type: Enhancement Issue is a small enhancement to existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants