Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will be fix #523
Currently,
this->binary_->section_from_offset(offset_imports)
is used as the original import section.However, if the "backward shift" (explained in #523 ) happens, this returns the previous section of the original import section. So I try another way to obtain the original import section.
I introduce
PE_SECTION_TYPES::OLD_IMPORT
type to mark the original import section.The type will be added to the target section when the
PE_SECTION_TYPES::IMPORT
type will be removed from it.After adding the new import section, we can find the original import section by looking to see if the type is
PE_SECTION_TYPES::OLD_IMPORT
.If we can not find the original import section, it will fall back to the current implementation, that is,
this->binary_->section_from_offset(offset_imports)
will be used.macOS and iOS CI jobs currently failed, but I suspect that they are due to the GitHub Actions' issue (actions/runner-images#841).
In fact, I see the "(X) This check failed" message and these jobs are unstable...
https://github.com/Catminusminus/LIEF/actions/runs/492792964
Sorry if I my suspicions are wrong. I'll re-run the jobs to find out what's wrong, anyway.