Class: Ragweed::Wraposx::Vm::RegionBasicInfo64

Inherits:
RegionInfo show all
Defined in:
lib/ragweed/wraposx/region_info.rb

Constant Summary collapse

FLAVOR =
Ragweed::Wraposx::Vm::REGION_BASIC_INFO_64

Instance Attribute Summary

Attributes inherited from RegionInfo

#base_address, #region_size

Instance Method Summary collapse

Methods included from FFIStructInclude

#method_missing, #methods, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ragweed::FFIStructInclude

Instance Method Details

#dump(&block) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/ragweed/wraposx/region_info.rb', line 88

def dump(&block)
  maybe_hex = lambda {|a| begin; "\n" + (" " * 9) + block.call(a, 16).hexdump(true)[10..-2]; rescue; ""; end }      
  maybe_dis = lambda {|a| begin; "\n" + block.call(a, 16).distorm.map {|i| "         " + i.mnem}.join("\n"); rescue; ""; end }

  string =<<EOM
  -----------------------------------------------------------------------
  BASIC INFO:
  base address:     #{self.base_address.to_s(16).rjust(8, "0")}

  protection:       #{self.protection.to_s(2).rjust(8, "0")} #{Ragweed::Wraposx::Vm::Pflags.flag_dump(self.protection)}
  max_protection:   #{self.max_protection.to_s(2).rjust(8, "0")} #{Ragweed::Wraposx::Vm::Pflags.flag_dump(self.max_protection)}
  inheritance:      #{self.inheritance.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.inheritance)}
  shared:           #{self.shared.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.shared)}
  reserved:         #{self.reserved.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.reserved)}
  offset:           #{self.offset.to_s(16).rjust(16, "0")} #{maybe_hex.call(self.offset)}
  behavior:         #{self.behavior.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.behavior)}
  user_wired_count: #{self.user_wired_count.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.user_wired_count)}
  size:             #{self.size.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.size)}
EOM
end