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 text section correction factor #29

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

TcM1911
Copy link
Member

@TcM1911 TcM1911 commented Apr 23, 2023

Some compilers add code at the beginning of the text section. The go runtime and its internal structures are not aware of this because their start of the text section is different from the values in the PE header. This commit adds code that compares the value in the PE header to the value stored in the module data structure. If the values are different a correction factor is calculated. This correction factor is applied to the function addresses when the r2 command for defining function is executed.

In most cases, this factor will be 0, resulting in no change.

Some compilers add code at the beginning of the text section. The go
runtime and its internal structures are not aware of this because their
start of the text section is different from the values in the PE header.
This commit adds code that compares the value in the PE header to the
value stored in the module data structure. If the values are different a
correction factor is calculated. This correction factor is applied to
the function addresses when the r2 command for defining function is
executed.

In most cases, this factor will be 0, resulting in no change.
@TcM1911 TcM1911 merged commit cd6a158 into develop Apr 23, 2023
@TcM1911 TcM1911 deleted the fix/text-section-correction-factor branch April 23, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant