Class: PEdump::Var

Inherits:
Object show all
Defined in:
lib/pedump/version_info.rb

Class Method Summary collapse

Class Method Details

.read(f, size = SIZE) ⇒ Object



163
164
165
166
167
168
169
# File 'lib/pedump/version_info.rb', line 163

def self.read f, size = SIZE
  super.tap do |x|
    x.szKey.force_encoding('UTF-16LE').encode!('UTF-8').sub!(/\u0000$/,'') rescue nil
    x.Padding = f.tell%4 > 0 ? f.read(4 - f.tell%4) : nil
    x.Value = f.read(x.wValueLength).unpack('v*')
  end
end