Class: Rex::PeParsey::PeBase::OptionalHeader32
- Inherits:
-
OptionalHeader
- Object
- GenericStruct
- GenericHeader
- OptionalHeader
- Rex::PeParsey::PeBase::OptionalHeader32
- Defined in:
- lib/rex/peparsey/pebase.rb
Instance Attribute Summary
Attributes inherited from GenericStruct
Instance Method Summary collapse
-
#initialize(rawdata) ⇒ OptionalHeader32
constructor
A new instance of OptionalHeader32.
Methods inherited from OptionalHeader
Methods inherited from GenericStruct
#[], #keys, #method_missing, #v
Constructor Details
#initialize(rawdata) ⇒ OptionalHeader32
Returns a new instance of OptionalHeader32.
540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/rex/peparsey/pebase.rb', line 540 def initialize(rawdata) optional_header = IMAGE_OPTIONAL_HEADER32.make_struct if !optional_header.from_s(rawdata) raise OptionalHeaderError, "Couldn't parse IMAGE_OPTIONAL_HEADER32", caller end if optional_header.v['Magic'] != IMAGE_NT_OPTIONAL_HDR32_MAGIC raise OptionalHeaderError, "Magic did not match!", caller() end self.struct = optional_header end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rex::PeParsey::PeBase::GenericStruct