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



397
398
399
400
401
# File 'lib/ragweed/wrap32/process.rb', line 397

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.



413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/ragweed/wrap32/process.rb', line 413

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