Class: Rex::PeParsey::PeBase::FileHeader
Instance Attribute Summary
#struct
Instance Method Summary
collapse
#[], #keys, #method_missing, #v
Constructor Details
#initialize(rawdata) ⇒ FileHeader
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
# File 'lib/rex/peparsey/pebase.rb', line 182
def initialize(rawdata)
= .make_struct
if !.from_s(rawdata)
raise , "Couldn't parse IMAGE_FILE_HEADER", caller
end
if .v['NtSignature'] != IMAGE_NT_SIGNATURE
raise , "Couldn't find the PE magic!"
end
if SUPPORTED_MACHINES.include?(.v['Machine']) == false
raise , "Unsupported machine type: #{file_header.v['Machine']}", caller
end
self.struct =
end
|
Instance Method Details
#Machine ⇒ Object
200
201
202
|
# File 'lib/rex/peparsey/pebase.rb', line 200
def Machine
v['Machine']
end
|
#NumberOfSections ⇒ Object
208
209
210
|
# File 'lib/rex/peparsey/pebase.rb', line 208
def NumberOfSections
v['NumberOfSections']
end
|
204
205
206
|
# File 'lib/rex/peparsey/pebase.rb', line 204
def
v['SizeOfOptionalHeader']
end
|