Class: Exerb::Win32::Struct::ImageSectionHeader

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

Overview

#

Constant Summary collapse

FORMAT =
'Z8LLLLLLSSL'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeImageSectionHeader


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

def initialize
  @name                   = ""
  @virtual_size           = 0
  @virtual_address        = 0
  @size_of_raw_data       = 0
  @pointer_to_raw_data    = 0
  @pointer_to_relocations = 0
  @pointer_to_linenumbers = 0
  @number_of_relocations  = 0
  @number_of_linenumbers  = 0
  @characteristics        = 0
end

Instance Attribute Details

#characteristicsObject

Returns the value of attribute characteristics


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def characteristics
  @characteristics
end

#nameObject

Returns the value of attribute name


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def name
  @name
end

#number_of_linenumbersObject

Returns the value of attribute number_of_linenumbers


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def number_of_linenumbers
  @number_of_linenumbers
end

#number_of_relocationsObject

Returns the value of attribute number_of_relocations


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def number_of_relocations
  @number_of_relocations
end

#pointer_to_linenumbersObject

Returns the value of attribute pointer_to_linenumbers


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def pointer_to_linenumbers
  @pointer_to_linenumbers
end

#pointer_to_raw_dataObject

Returns the value of attribute pointer_to_raw_data


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def pointer_to_raw_data
  @pointer_to_raw_data
end

#pointer_to_relocationsObject

Returns the value of attribute pointer_to_relocations


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def pointer_to_relocations
  @pointer_to_relocations
end

#size_of_raw_dataObject

Returns the value of attribute size_of_raw_data


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def size_of_raw_data
  @size_of_raw_data
end

#virtual_addressObject

Returns the value of attribute virtual_address


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def virtual_address
  @virtual_address
end

#virtual_sizeObject Also known as: physical_address

Returns the value of attribute virtual_size


36
37
38
# File 'lib/exerb/win32/struct/image_section_header.rb', line 36

def virtual_size
  @virtual_size
end

Instance Method Details

#packObject


38
39
40
# File 'lib/exerb/win32/struct/image_section_header.rb', line 38

def pack
  return [@name, @virtual_size, @virtual_address, @size_of_raw_data, @pointer_to_raw_data, @pointer_to_relocations, @pointer_to_linenumbers, @number_of_relocations, @number_of_linenumbers, @characteristics].pack(FORMAT)
end

#unpack(bin) ⇒ Object


42
43
44
45
# File 'lib/exerb/win32/struct/image_section_header.rb', line 42

def unpack(bin)
  @name, @virtual_size, @virtual_address, @size_of_raw_data, @pointer_to_raw_data, @pointer_to_relocations, @pointer_to_linenumbers, @number_of_relocations, @number_of_linenumbers, @characteristics = bin.unpack(FORMAT)
  return self
end