Class: Ragweed::Wraposx::ThreadContext::Debug32

Inherits:
FFI::Struct
  • Object
show all
Includes:
FFIStructInclude
Defined in:
lib/ragweed/wraposx/thread_context.rb

Overview

_STRUCT_X86_DEBUG_STATE32

unsigned int    dr0;
unsigned int    dr1;
unsigned int    dr2;
unsigned int    dr3;
unsigned int    dr4;
unsigned int    dr5;
unsigned int    dr6;
unsigned int    dr7;

;

Constant Summary collapse

FLAVOR =
10

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



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/ragweed/wraposx/thread_context.rb', line 391

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
  -----------------------------------------------------------------------
  CONTEXT:
  DR0: #{self.dr0.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr0)}
  DR1: #{self.dr1.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr1)}
  DR2: #{self.dr2.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr2)}
  DR3: #{self.dr3.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr3)}
  DR4: #{self.dr4.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr4)}
  DR5: #{self.dr5.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr5)}
  DR6: #{self.dr6.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr6)}
  DR7: #{self.dr7.to_s(16).rjust(8, "0")} #{maybe_hex.call(self.dr7)}
EOM
end