Class: Exerb::Win32::Struct::ImageOptionalHeader32

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

Overview

#

Constant Summary collapse

FORMAT =
'SCCLLLLLLLLLSSSSSSLLLLSSLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeImageOptionalHeader32

Returns a new instance of ImageOptionalHeader32



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 23

def initialize
  @magic                            = 0
  @major_linker_version             = 0
  @minor_linker_version             = 0
  @size_of_code                     = 0
  @size_of_initialized_data         = 0
  @size_of_uninitialized_data       = 0
  @address_of_entry_point           = 0
  @base_of_code                     = 0
  @base_of_data                     = 0
  @image_base                       = 0
  @section_alignment                = 0
  @file_alignment                   = 0
  @major_operating_system_version   = 0
  @minor_operating_system_version   = 0
  @major_image_version              = 0
  @minor_image_version              = 0
  @major_subsystem_version          = 0
  @minor_subsystem_version          = 0
  @win32_version_value              = 0
  @size_of_image                    = 0
  @size_of_headers                  = 0
  @checksum                         = 0
  @subsystem                        = 0
  @dll_characteristics              = 0
  @size_of_stack_reserve            = 0
  @size_of_stack_commit             = 0
  @size_of_heap_reserve             = 0
  @size_of_heap_commit              = 0
  @loader_flags                     = 0
  @number_of_rva_and_sizes          = 0
  @data_directory0_virtual_address  = 0
  @data_directory0_virtual_size     = 0
  @data_directory1_virtual_address  = 0
  @data_directory1_virtual_size     = 0
  @data_directory2_virtual_address  = 0
  @data_directory2_virtual_size     = 0
  @data_directory3_virtual_address  = 0
  @data_directory3_virtual_size     = 0
  @data_directory4_virtual_address  = 0
  @data_directory4_virtual_size     = 0
  @data_directory5_virtual_address  = 0
  @data_directory5_virtual_size     = 0
  @data_directory6_virtual_address  = 0
  @data_directory6_virtual_size     = 0
  @data_directory7_virtual_address  = 0
  @data_directory7_virtual_size     = 0
  @data_directory8_virtual_address  = 0
  @data_directory8_virtual_size     = 0
  @data_directory9_virtual_address  = 0
  @data_directory9_virtual_size     = 0
  @data_directory10_virtual_address = 0
  @data_directory10_virtual_size    = 0
  @data_directory11_virtual_address = 0
  @data_directory11_virtual_size    = 0
  @data_directory12_virtual_address = 0
  @data_directory12_virtual_size    = 0
  @data_directory13_virtual_address = 0
  @data_directory13_virtual_size    = 0
  @data_directory14_virtual_address = 0
  @data_directory14_virtual_size    = 0
  @data_directory15_virtual_address = 0
  @data_directory15_virtual_size    = 0
end

Instance Attribute Details

#address_of_entry_pointObject

Returns the value of attribute address_of_entry_point



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def address_of_entry_point
  @address_of_entry_point
end

#base_of_codeObject

Returns the value of attribute base_of_code



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def base_of_code
  @base_of_code
end

#base_of_dataObject

Returns the value of attribute base_of_data



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def base_of_data
  @base_of_data
end

#checksumObject

Returns the value of attribute checksum



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def checksum
  @checksum
end

#data_directory0_virtual_addressObject

Returns the value of attribute data_directory0_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory0_virtual_address
  @data_directory0_virtual_address
end

#data_directory0_virtual_sizeObject

Returns the value of attribute data_directory0_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory0_virtual_size
  @data_directory0_virtual_size
end

#data_directory10_virtual_addressObject

Returns the value of attribute data_directory10_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory10_virtual_address
  @data_directory10_virtual_address
end

#data_directory10_virtual_sizeObject

Returns the value of attribute data_directory10_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory10_virtual_size
  @data_directory10_virtual_size
end

#data_directory11_virtual_addressObject

Returns the value of attribute data_directory11_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory11_virtual_address
  @data_directory11_virtual_address
end

#data_directory11_virtual_sizeObject

Returns the value of attribute data_directory11_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory11_virtual_size
  @data_directory11_virtual_size
end

#data_directory12_virtual_addressObject

Returns the value of attribute data_directory12_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory12_virtual_address
  @data_directory12_virtual_address
end

#data_directory12_virtual_sizeObject

Returns the value of attribute data_directory12_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory12_virtual_size
  @data_directory12_virtual_size
end

#data_directory13_virtual_addressObject

Returns the value of attribute data_directory13_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory13_virtual_address
  @data_directory13_virtual_address
end

#data_directory13_virtual_sizeObject

Returns the value of attribute data_directory13_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory13_virtual_size
  @data_directory13_virtual_size
end

#data_directory14_virtual_addressObject

Returns the value of attribute data_directory14_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory14_virtual_address
  @data_directory14_virtual_address
end

#data_directory14_virtual_sizeObject

Returns the value of attribute data_directory14_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory14_virtual_size
  @data_directory14_virtual_size
end

#data_directory15_virtual_addressObject

Returns the value of attribute data_directory15_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory15_virtual_address
  @data_directory15_virtual_address
end

#data_directory15_virtual_sizeObject

Returns the value of attribute data_directory15_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory15_virtual_size
  @data_directory15_virtual_size
end

#data_directory1_virtual_addressObject

Returns the value of attribute data_directory1_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory1_virtual_address
  @data_directory1_virtual_address
end

#data_directory1_virtual_sizeObject

Returns the value of attribute data_directory1_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory1_virtual_size
  @data_directory1_virtual_size
end

#data_directory2_virtual_addressObject Also known as: resource_directory_virtual_address

Returns the value of attribute data_directory2_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory2_virtual_address
  @data_directory2_virtual_address
end

#data_directory2_virtual_sizeObject Also known as: resource_directory_virtual_size

Returns the value of attribute data_directory2_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory2_virtual_size
  @data_directory2_virtual_size
end

#data_directory3_virtual_addressObject

Returns the value of attribute data_directory3_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory3_virtual_address
  @data_directory3_virtual_address
end

#data_directory3_virtual_sizeObject

Returns the value of attribute data_directory3_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory3_virtual_size
  @data_directory3_virtual_size
end

#data_directory4_virtual_addressObject

Returns the value of attribute data_directory4_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory4_virtual_address
  @data_directory4_virtual_address
end

#data_directory4_virtual_sizeObject

Returns the value of attribute data_directory4_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory4_virtual_size
  @data_directory4_virtual_size
end

#data_directory5_virtual_addressObject

Returns the value of attribute data_directory5_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory5_virtual_address
  @data_directory5_virtual_address
end

#data_directory5_virtual_sizeObject

Returns the value of attribute data_directory5_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory5_virtual_size
  @data_directory5_virtual_size
end

#data_directory6_virtual_addressObject

Returns the value of attribute data_directory6_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory6_virtual_address
  @data_directory6_virtual_address
end

#data_directory6_virtual_sizeObject

Returns the value of attribute data_directory6_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory6_virtual_size
  @data_directory6_virtual_size
end

#data_directory7_virtual_addressObject

Returns the value of attribute data_directory7_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory7_virtual_address
  @data_directory7_virtual_address
end

#data_directory7_virtual_sizeObject

Returns the value of attribute data_directory7_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory7_virtual_size
  @data_directory7_virtual_size
end

#data_directory8_virtual_addressObject

Returns the value of attribute data_directory8_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory8_virtual_address
  @data_directory8_virtual_address
end

#data_directory8_virtual_sizeObject

Returns the value of attribute data_directory8_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory8_virtual_size
  @data_directory8_virtual_size
end

#data_directory9_virtual_addressObject

Returns the value of attribute data_directory9_virtual_address



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory9_virtual_address
  @data_directory9_virtual_address
end

#data_directory9_virtual_sizeObject

Returns the value of attribute data_directory9_virtual_size



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def data_directory9_virtual_size
  @data_directory9_virtual_size
end

#dll_characteristicsObject

Returns the value of attribute dll_characteristics



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def dll_characteristics
  @dll_characteristics
end

#file_alignmentObject

Returns the value of attribute file_alignment



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def file_alignment
  @file_alignment
end

#image_baseObject

Returns the value of attribute image_base



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def image_base
  @image_base
end

#loader_flagsObject

Returns the value of attribute loader_flags



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def loader_flags
  @loader_flags
end

#magicObject

Returns the value of attribute magic



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def magic
  @magic
end

#major_image_versionObject

Returns the value of attribute major_image_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def major_image_version
  @major_image_version
end

#major_linker_versionObject

Returns the value of attribute major_linker_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def major_linker_version
  @major_linker_version
end

#major_operating_system_versionObject

Returns the value of attribute major_operating_system_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def major_operating_system_version
  @major_operating_system_version
end

#major_subsystem_versionObject

Returns the value of attribute major_subsystem_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def major_subsystem_version
  @major_subsystem_version
end

#minor_image_versionObject

Returns the value of attribute minor_image_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def minor_image_version
  @minor_image_version
end

#minor_linker_versionObject

Returns the value of attribute minor_linker_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def minor_linker_version
  @minor_linker_version
end

#minor_operating_system_versionObject

Returns the value of attribute minor_operating_system_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def minor_operating_system_version
  @minor_operating_system_version
end

#minor_subsystem_versionObject

Returns the value of attribute minor_subsystem_version



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def minor_subsystem_version
  @minor_subsystem_version
end

#number_of_rva_and_sizesObject

Returns the value of attribute number_of_rva_and_sizes



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def number_of_rva_and_sizes
  @number_of_rva_and_sizes
end

#section_alignmentObject

Returns the value of attribute section_alignment



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def section_alignment
  @section_alignment
end

#size_of_codeObject

Returns the value of attribute size_of_code



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_code
  @size_of_code
end

#size_of_headersObject

Returns the value of attribute size_of_headers



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_headers
  @size_of_headers
end

#size_of_heap_commitObject

Returns the value of attribute size_of_heap_commit



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_heap_commit
  @size_of_heap_commit
end

#size_of_heap_reserveObject

Returns the value of attribute size_of_heap_reserve



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_heap_reserve
  @size_of_heap_reserve
end

#size_of_imageObject

Returns the value of attribute size_of_image



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_image
  @size_of_image
end

#size_of_initialized_dataObject

Returns the value of attribute size_of_initialized_data



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_initialized_data
  @size_of_initialized_data
end

#size_of_stack_commitObject

Returns the value of attribute size_of_stack_commit



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_stack_commit
  @size_of_stack_commit
end

#size_of_stack_reserveObject

Returns the value of attribute size_of_stack_reserve



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_stack_reserve
  @size_of_stack_reserve
end

#size_of_uninitialized_dataObject

Returns the value of attribute size_of_uninitialized_data



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def size_of_uninitialized_data
  @size_of_uninitialized_data
end

#subsystemObject

Returns the value of attribute subsystem



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def subsystem
  @subsystem
end

#win32_version_valueObject

Returns the value of attribute win32_version_value



88
89
90
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 88

def win32_version_value
  @win32_version_value
end

Instance Method Details

#packObject



90
91
92
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 90

def pack
  return [@magic, @major_linker_version, @minor_linker_version, @size_of_code, @size_of_initialized_data, @size_of_uninitialized_data, @address_of_entry_point, @base_of_code, @base_of_data, @image_base, @section_alignment, @file_alignment, @major_operating_system_version, @minor_operating_system_version, @major_image_version, @minor_image_version, @major_subsystem_version, @minor_subsystem_version, @win32_version_value, @size_of_image, @size_of_headers, @checksum, @subsystem, @dll_characteristics, @size_of_stack_reserve, @size_of_stack_commit, @size_of_heap_reserve, @size_of_heap_commit, @loader_flags, @number_of_rva_and_sizes, @data_directory0_virtual_address, @data_directory0_virtual_size, @data_directory1_virtual_address, @data_directory1_virtual_size, @data_directory2_virtual_address, @data_directory2_virtual_size, @data_directory3_virtual_address, @data_directory3_virtual_size, @data_directory4_virtual_address, @data_directory4_virtual_size, @data_directory5_virtual_address, @data_directory5_virtual_size, @data_directory6_virtual_address, @data_directory6_virtual_size, @data_directory7_virtual_address, @data_directory7_virtual_size, @data_directory8_virtual_address, @data_directory8_virtual_size, @data_directory9_virtual_address, @data_directory9_virtual_size, @data_directory10_virtual_address, @data_directory10_virtual_size, @data_directory11_virtual_address, @data_directory11_virtual_size, @data_directory12_virtual_address, @data_directory12_virtual_size, @data_directory13_virtual_address, @data_directory13_virtual_size, @data_directory14_virtual_address, @data_directory14_virtual_size, @data_directory15_virtual_address, @data_directory15_virtual_size].pack(FORMAT)
end

#unpack(bin) ⇒ Object



94
95
96
97
# File 'lib/exerb/win32/struct/image_optional_header32.rb', line 94

def unpack(bin)
  @magic, @major_linker_version, @minor_linker_version, @size_of_code, @size_of_initialized_data, @size_of_uninitialized_data, @address_of_entry_point, @base_of_code, @base_of_data, @image_base, @section_alignment, @file_alignment, @major_operating_system_version, @minor_operating_system_version, @major_image_version, @minor_image_version, @major_subsystem_version, @minor_subsystem_version, @win32_version_value, @size_of_image, @size_of_headers, @checksum, @subsystem, @dll_characteristics, @size_of_stack_reserve, @size_of_stack_commit, @size_of_heap_reserve, @size_of_heap_commit, @loader_flags, @number_of_rva_and_sizes, @data_directory0_virtual_address, @data_directory0_virtual_size, @data_directory1_virtual_address, @data_directory1_virtual_size, @data_directory2_virtual_address, @data_directory2_virtual_size, @data_directory3_virtual_address, @data_directory3_virtual_size, @data_directory4_virtual_address, @data_directory4_virtual_size, @data_directory5_virtual_address, @data_directory5_virtual_size, @data_directory6_virtual_address, @data_directory6_virtual_size, @data_directory7_virtual_address, @data_directory7_virtual_size, @data_directory8_virtual_address, @data_directory8_virtual_size, @data_directory9_virtual_address, @data_directory9_virtual_size, @data_directory10_virtual_address, @data_directory10_virtual_size, @data_directory11_virtual_address, @data_directory11_virtual_size, @data_directory12_virtual_address, @data_directory12_virtual_size, @data_directory13_virtual_address, @data_directory13_virtual_size, @data_directory14_virtual_address, @data_directory14_virtual_size, @data_directory15_virtual_address, @data_directory15_virtual_size = bin.unpack(FORMAT)
  return self
end