def repl_action_push_string(swf, do_action_offset, action_push_offset, str, parent_sprite_offset = nil)
      swf.force_encoding("ASCII-8BIT") if swf.respond_to? :force_encoding
      str.force_encoding("ASCII-8BIT") if str.respond_to? :force_encoding
      record_header = swf[do_action_offset, 2].unpack("v").first
      # tag check
      raise ReplaceTargetError if (record_header >> 6) & 1023 != 12
      # action check
      raise ReplaceTargetError if swf[action_push_offset].chr.unpack("C").first != 0x96
      raise ReplaceTargetError if swf[action_push_offset + 3].chr.unpack("C").first != 0
      # error for short header (not implemented yet.)
      raise ReplaceTargetError if record_header & 63 < 63
      # calc length
      do_action_len = swf[do_action_offset+2, 4].unpack("i").first # without recordheader
      action_push_len = swf[action_push_offset+1, 2].unpack("v").first
      org_str_length = action_push_len - 2 # data type & terminated null
      delta_str_length = str.length - org_str_length
      # replace string and rewrite length
      swf[action_push_offset+4, org_str_length] = str
      swf[action_push_offset+1, 2] = [action_push_len + delta_str_length].pack("v")
      swf[do_action_offset+2, 4] = [do_action_len + delta_str_length].pack("V")
      if parent_sprite_offset
        swf[parent_sprite_offset+2, 4] = [swf[parent_sprite_offset+2, 4].unpack("V").first + delta_str_length].pack("V")
      end
      swf[4, 4] = [swf[4, 4].unpack("V").first + delta_str_length].pack("V")
      swf
    end
def repl_action_push_string(swf, do_action_offset, action_push_offset, str, parent_sprite_offset = nil)
      swf.force_encoding("ASCII-8BIT") if swf.respond_to? :force_encoding
      str.force_encoding("ASCII-8BIT") if str.respond_to? :force_encoding
      record_header = swf[do_action_offset, 2].unpack("v").first
      # tag check
      raise ReplaceTargetError if (record_header >> 6) & 1023 != 12
      # action check
      raise ReplaceTargetError if swf[action_push_offset].chr.unpack("C").first != 0x96
      raise ReplaceTargetError if swf[action_push_offset + 3].chr.unpack("C").first != 0
      # error for short header (not implemented yet.)
      raise ReplaceTargetError if record_header & 63 < 63
      # calc length
      do_action_len = swf[do_action_offset+2, 4].unpack("i").first # without recordheader
      action_push_len = swf[action_push_offset+1, 2].unpack("v").first
      org_str_length = action_push_len - 2 # data type & terminated null
      delta_str_length = str.length - org_str_length
      # replace string and rewrite length
      swf[action_push_offset+4, org_str_length] = str
      swf[action_push_offset+1, 2] = [action_push_len + delta_str_length].pack("v")
      swf[do_action_offset+2, 4] = [do_action_len + delta_str_length].pack("V")
      if parent_sprite_offset
        swf[parent_sprite_offset+2, 4] = [swf[parent_sprite_offset+2, 4].unpack("V").first + delta_str_length].pack("V")
      end
      swf[4, 4] = [swf[4, 4].unpack("V").first + delta_str_length].pack("V")
      swf
    end
対象オフセット位置にあるActionPushデータを置換.