Class: PEdump::CLR::MetadataStreamHeader

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

Class Method Summary collapse

Class Method Details

.read(io) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/pedump/clr.rb', line 87

def self.read io
  super.tap do |r|
    r.name = ''
    nread = 0
    while !io.eof? && r.name.size < 32
      c = io.read(1)
      nread += 1
      break if c == "\0"

      r.name << c
    end
    if !io.eof? && nread % 4 != 0
      io.read(4 - nread % 4) # padding
    end
  end
end