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

Add support for stripped go binaries #426

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Conversation

h0x0er
Copy link
Contributor

@h0x0er h0x0er commented Nov 22, 2023

Currently ecapture fails for stripped go binaries.

Because in findRetOffsets() method, only symbols from sym table section are consider for searching of GoTlsReadFunc symbol. Since in case of stripped go binaries no sym table section is present, ecapture fails to initialise.

This PR adds dynamic symbols in search space to fix the issue.

fixes #428

@cfc4n
Copy link
Member

cfc4n commented Nov 23, 2023

Thank you very much for your contribution.

However, could you first raise an issue and provide some additional information about the case?

Also, please add some validation demos in this PR. Thank you very much.

@cfc4n cfc4n added the enhancement New feature or request label Nov 23, 2023
@h0x0er
Copy link
Contributor Author

h0x0er commented Nov 23, 2023

@cfc4n , I had created an issue with extra info. Thanks

Copy link
Member

@cfc4n cfc4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR cannot support stripped Go binaries.

allSymbs = append(allSymbs, goSymbs...)
}

goDynamicSymbs, _ := gc.goElf.DynamicSymbols()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in stripped compiled files , there are also no symbols in the DynamicSymbols section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfc4n , Thanks for commenting. I had shared more info in the #428 , for the reason behind including dynamic symbols

@cfc4n cfc4n added help wanted Extra attention is needed invalid This doesn't seem right labels Nov 26, 2023
Copy link
Member

@cfc4n cfc4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@cfc4n cfc4n merged commit db7e37a into gojue:master Nov 26, 2023
6 checks passed
cfc4n added a commit that referenced this pull request Dec 1, 2023
see #426 for more detail.

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
cfc4n added a commit that referenced this pull request Dec 1, 2023
see #426 for more detail.

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
@h0x0er h0x0er deleted the dynamic-symbols branch April 8, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gotls Mode fails for stripped go binaries
2 participants