Class: PEdump::IMAGE_SECTION_HEADER

Inherits:
Object
  • Object
show all
Defined in:
lib/pedump.rb

Instance Method Summary collapse

Instance Method Details

#flags_descObject



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/pedump.rb', line 236

def flags_desc
  r = ''
  f = self.flags.to_i
  r << (f & 0x4000_0000 > 0 ? 'R' : '-')
  r << (f & 0x8000_0000 > 0 ? 'W' : '-')
  r << (f & 0x2000_0000 > 0 ? 'X' : '-')
  r << ' CODE'        if f & 0x20 > 0

  # section contains initialized data. Almost all sections except executable and the .bss section have this flag set
  r << ' IDATA'       if f & 0x40 > 0

  # section contains uninitialized data (for example, the .bss section)
  r << ' UDATA'       if f & 0x80 > 0

  r << ' DISCARDABLE' if f & 0x02000000 > 0
  r << ' SHARED'      if f & 0x10000000 > 0
  r
end

#packObject



255
256
257
# File 'lib/pedump.rb', line 255

def pack
  to_a.pack FORMAT.tr('A','a') # pad names with NULL bytes on pack()
end