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

Fix editing ELF_Ehdr.e_ident #58

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

zygzagZ
Copy link
Contributor

@zygzagZ zygzagZ commented May 5, 2021

It didn't work with ELFStruct.pack as it was not a number, but a bindata struct

Part of #52

It didn't work with ELFStruct.pack as it was not a number, but a bindata struct
@zygzagZ
Copy link
Contributor Author

zygzagZ commented May 5, 2021

Oh yeah, rubymine warned me that the "redundant begin block" is required before ruby 2.5, as that is apparently ruby version where syntax

do |sth|
  puts 'ayy'
rescue Exception => e
  puts 'rescued'
end

was introduced?

gemspec lists 2.4 support, so I decided to refactor into begin/rescue/end block - and that is why tests fail

@zygzagZ
Copy link
Contributor Author

zygzagZ commented May 5, 2021

Just verified and indeed ruby fails with parser error when using do/rescue/end block with ruby 2.4.6

@david942j
Copy link
Owner

david942j commented May 7, 2021

Ruby 2.4 reaches EOL in last year, I would say it's time to drop Ruby 2.4 support. So I prefer you to remove 'being' here and I will update gemspec in another PR.

lib/elftools/structs.rb Outdated Show resolved Hide resolved
@zygzagZ
Copy link
Contributor Author

zygzagZ commented May 7, 2021

This fix isn't enough though, I reproduced a bug and with this patch it still needs a workaround.
Method overriding in structs.rb:43 fails to override sub-struct attribute setters (ELF_Ehdr.e_ident.*), need something better than this...

ELF_Ehdr.e_ident attribute setters don't get overridden to add changes
to elf's patches
@zygzagZ zygzagZ marked this pull request as draft May 7, 2021 17:49
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.

None yet

2 participants