Class: Rex::PeParsey::PeBase::OptionalHeader64

Inherits:
OptionalHeader show all
Defined in:
lib/rex/peparsey/pebase.rb

Instance Attribute Summary

Attributes inherited from GenericStruct

#struct

Instance Method Summary collapse

Methods inherited from OptionalHeader

#FileAlignment, #ImageBase

Methods inherited from GenericStruct

#[], #keys, #method_missing, #v

Constructor Details

#initialize(rawdata) ⇒ OptionalHeader64

Returns a new instance of OptionalHeader64.



568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/rex/peparsey/pebase.rb', line 568

def initialize(rawdata)
	optional_header = IMAGE_OPTIONAL_HEADER64.make_struct

	if !optional_header.from_s(rawdata)
		raise OptionalHeaderError, "Couldn't parse IMAGE_OPTIONAL_HEADER64", caller
	end

	if optional_header.v['Magic'] != IMAGE_NT_OPTIONAL_HDR64_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