Class: Exerb::Win32::Struct::ImageNtHeaders32
- Defined in:
- lib/exerb/win32/struct/image_nt_headers32.rb
Overview
#
Constant Summary collapse
- SIGNATURE =
0x00004550
Instance Attribute Summary collapse
-
#file_header ⇒ Object
Returns the value of attribute file_header.
-
#optional_header ⇒ Object
Returns the value of attribute optional_header.
-
#signature ⇒ Object
Returns the value of attribute signature.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ ImageNtHeaders32
constructor
A new instance of ImageNtHeaders32.
- #pack ⇒ Object
- #read(io) ⇒ Object
- #unpack ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ ImageNtHeaders32
Returns a new instance of ImageNtHeaders32.
25 26 27 28 29 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 25 def initialize @signature = 0 @file_header = nil @optional_header = nil end |
Instance Attribute Details
#file_header ⇒ Object
Returns the value of attribute file_header.
31 32 33 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 31 def file_header @file_header end |
#optional_header ⇒ Object
Returns the value of attribute optional_header.
31 32 33 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 31 def optional_header @optional_header end |
#signature ⇒ Object
Returns the value of attribute signature.
31 32 33 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 31 def signature @signature end |
Instance Method Details
#pack ⇒ Object
33 34 35 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 33 def pack return [signature].pack('L') + @file_header.pack + @optional_header.pack end |
#read(io) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 41 def read(io) @position = io.pos @signature = io.read(4).unpack('L')[0] raise('nt headers have invalid signature') unless @signature == SIGNATURE @file_header = Exerb::Win32::Struct::ImageFileHeader.read(io) @optional_header = Exerb::Win32::Struct::ImageOptionalHeader32.read(io) return self end |
#unpack ⇒ Object
37 38 39 |
# File 'lib/exerb/win32/struct/image_nt_headers32.rb', line 37 def unpack raise NotImplementedError end |