Class: Exerb::Win32::ResourceDirectory::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/exerb/win32/resource_directory.rb

Overview

#

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ Entry

Returns a new instance of Entry


82
83
84
# File 'lib/exerb/win32/resource_directory.rb', line 82

def initialize(entry)
  @entry = entry
end

Instance Attribute Details

#entryObject

Returns the value of attribute entry


86
87
88
# File 'lib/exerb/win32/resource_directory.rb', line 86

def entry
  @entry
end

Instance Method Details

#pack(table, reloc, base) ⇒ Object


88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/exerb/win32/resource_directory.rb', line 88

def pack(table, reloc, base)
  entry = Exerb::Win32::Struct::ImageResourceDirectoryEntry.new

  if @entry.kind_of?(Exerb::Win32::ResourceDirectory)
    entry.name                = @entry.name
    entry.offset_to_directory = table[@entry]
  else
    entry.name                = @entry.lang
    entry.offset_to_data      = table[@entry]
  end

  return entry.pack
end