rbelftools icon indicating copy to clipboard operation
rbelftools copied to clipboard

Fix editing ELF_Ehdr.e_ident

Open zygzagZ opened this issue 4 years ago • 4 comments

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

Part of #52

zygzagZ avatar May 05 '21 20:05 zygzagZ

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 avatar May 05 '21 20:05 zygzagZ

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

zygzagZ avatar May 05 '21 21:05 zygzagZ

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.

david942j avatar May 07 '21 13:05 david942j

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...

zygzagZ avatar May 07 '21 17:05 zygzagZ