Class: Exerb::Win32::Struct::ImageFileHeader

Inherits:
Base
  • Object
show all
Defined in:
lib/exerb/win32/struct/image_file_header.rb

Overview

#

Constant Summary collapse

FORMAT =
'SSLLLSS'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeImageFileHeader

Returns a new instance of ImageFileHeader.



23
24
25
26
27
28
29
30
31
# File 'lib/exerb/win32/struct/image_file_header.rb', line 23

def initialize
  @machine                 = 0
  @number_of_sections      = 0
  @time_date_stamp         = 0
  @pointer_to_symbol_table = 0
  @number_of_symbols       = 0
  @size_of_optional_header = 0
  @characteristics         = 0
end

Instance Attribute Details

#characteristicsObject

Returns the value of attribute characteristics.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def characteristics
  @characteristics
end

#machineObject

Returns the value of attribute machine.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def machine
  @machine
end

#number_of_sectionsObject

Returns the value of attribute number_of_sections.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def number_of_sections
  @number_of_sections
end

#number_of_symbolsObject

Returns the value of attribute number_of_symbols.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def number_of_symbols
  @number_of_symbols
end

#pointer_to_symbol_tableObject

Returns the value of attribute pointer_to_symbol_table.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def pointer_to_symbol_table
  @pointer_to_symbol_table
end

#size_of_optional_headerObject

Returns the value of attribute size_of_optional_header.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def size_of_optional_header
  @size_of_optional_header
end

#time_date_stampObject

Returns the value of attribute time_date_stamp.



33
34
35
# File 'lib/exerb/win32/struct/image_file_header.rb', line 33

def time_date_stamp
  @time_date_stamp
end

Instance Method Details

#packObject



35
36
37
# File 'lib/exerb/win32/struct/image_file_header.rb', line 35

def pack
  return [@machine, @number_of_sections, @time_date_stamp, @pointer_to_symbol_table, @number_of_symbols, @size_of_optional_header, @characteristics].pack(FORMAT)
end

#unpack(bin) ⇒ Object



39
40
41
42
# File 'lib/exerb/win32/struct/image_file_header.rb', line 39

def unpack(bin)
  @machine, @number_of_sections, @time_date_stamp, @pointer_to_symbol_table, @number_of_symbols, @size_of_optional_header, @characteristics = bin.unpack(FORMAT)
  return self
end