rbelftools
rbelftools copied to clipboard
Fix editing ELF_Ehdr.e_ident
It didn't work with ELFStruct.pack as it was not a number, but a bindata struct
Part of #52
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
Just verified and indeed ruby fails with parser error when using do/rescue/end block with ruby 2.4.6
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.
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...