Permalink
Browse files

fix Ragweed::Process#write

  • Loading branch information...
1 parent d4d095c commit d95cb14dec74cf3dadbdd7c3a451301ac634dd97 @tduehr committed Jul 23, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/ragweed/wraptux/process.rb
@@ -21,10 +21,12 @@ def read(off, sz=4096)
# result in failure unless you PTRACE_POKE first and
# get the rest of the original value at the address
def write(off, data)
- while off < data.size
- Ragweed::Wraptux::ptrace(Ragweed::Wraptux::Ptrace::POKE_TEXT, @pid, off, data[off,4].unpack('L').first)
- off += 4
- end
+ data_off = 0
+ while data_off < data.size
+ Ragweed::Wraptux::ptrace(Ragweed::Wraptux::Ptrace::POKE_TEXT, @pid, off, data[data_off,4].unpack('L').first)
+ off += 4
+ data_off +=4
+ end
end
def read32(off); read(off, 4).unpack("L").first; end

0 comments on commit d95cb14

Please sign in to comment.