Class: Ragweed::Process::AdlerChart

Inherits:
Object
  • Object
show all
Defined in:
lib/ragweed/wrap32/process.rb

Overview

Quick and dirty visualization of a memory region by checksum changes.

Instance Method Summary collapse

Constructor Details

#initialize(p, i) ⇒ AdlerChart

Create with a WinProcess and region index



492
493
494
495
496
# File 'lib/ragweed/wrap32/process.rb', line 492

def initialize(p, i)
  @p = p
  @i = i
  @initstate = map
end

Instance Method Details

#to_sObject

Just puts the chart repeatedly, to get: .….….….….….….….….….….….….….…... .….….….….….….….….….….….….….…..*.. .….….….….….….….….….….….….….…..*.. Where * represents a chunk of memory that has changed.



508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/ragweed/wrap32/process.rb', line 508

def to_s
  s = StringIO.new
  newstate = map
  @initstate.each_with_index do |sum, i|
    if sum != newstate[i]
      s.write "*"
      @initstate[i] = newstate[i]
    else
      s.write "."
    end
  end
  s.rewind;s.read()
end