lib/pedump/ne.rb
# first string with ordinal 0 is a module name
first string with ordinal 0 is a module name
first string with ordinal 0 is a module name
def exports io=@io
      exp_dir = IMAGE_EXPORT_DIRECTORY.new
      exp_dir.functions = []
      io.seek @offset+ne_restab
      while !io.eof && (namelen = io.getc.ord) > 0
        exp_dir.functions << ExportedFunction.new( io.read(namelen), io.read(2).unpack('v').first, 0 )
      end
      exp_dir.name = exp_dir.functions.shift.name if exp_dir.functions.any?
      a = []
      io.seek ne_nrestab
      while !io.eof && (namelen = io.getc.ord) > 0
        a << ExportedFunction.new( io.read(namelen), io.read(2).unpack('v').first, 0 )
      end
      exp_dir.description = a.shift.name if a.any?
      exp_dir.functions += a
      exp_dir.functions.each do |f|
        f.va = entrypoints[f.ord]
      end
      exp_dir
    end
def exports io = @io exp_dir = IMAGE_EXPORT_DIRECTORY . new exp_dir . functions = [ ] io . seek @offset + ne_restab while ! io . eof && ( namelen = io . getc . ord ) > 0 exp_dir . functions << ExportedFunction . new ( io . read ( namelen ) , io . read ( 2 ) . unpack ( 'v' ) . first , 0 ) end exp_dir . name = exp_dir . functions . shift . name if exp_dir . functions . any? a = [ ] io . seek ne_nrestab while ! io . eof && ( namelen = io . getc . ord ) > 0 a << ExportedFunction . new ( io . read ( namelen ) , io . read ( 2 ) . unpack ( 'v' ) . first , 0 ) end exp_dir . description = a . shift . name if a . any? exp_dir . functions += a exp_dir . functions . each do | f | f . va = entrypoints [ f . ord ] end exp_dir end
first string with ordinal 0 is a module name
first string with ordinal 0 is a module name
io