       r = {}
       m = []
       i = 0
-      [r.rite_binary_header, i] = @_loadRiteBinaryHeader(arrayBuf, i)
+      ctx = {}
+      [r.rite_binary_header, i] = @_loadRiteBinaryHeader(ctx, arrayBuf, i)
       if r.rite_binary_header.binary_identify == "RITE" and
          r.rite_binary_header.binary_version == "0003"
         s = 0

    pad = (4 - (offset + 14) % 4) % 4
    r.iseq = {number_of_opcodes: n, padding_bytes: pad, opcodes: []}
    i = 14 + pad
    while n > 0
      c = _bin_to_u32_be(h.subarray(i, i + 4))
      [c1,c2] = @_decodeRiteInst(c)
      c1 = c1.replace("\t", " ") + "                                        "
      r.iseq.opcodes.push("#{c1.substring(0, 20)}# #{c2}")
      i += 4
      n -= 1
    n = _bin_to_u32_be(h.subarray(i, i + 4))
    i += 4
    r.pool = {length_of_pool: n, values: []}
    while n > 0
      n -= 1
    n = _bin_to_u32_be(h.subarray(i, i + 4))
    i += 4
    r.syms = {number_of_syms: n, symbols: []}
    while n > 0
      len = _bin_to_u16_be(h.subarray(i, i + 2))
      i += 2
      if len == 0xffff
        r.syms.symbols.push(null)
      else
        r.syms.symbols.push(String.fromCharCode.apply(null, h.subarray(i, i + len)))
        i += (len + 1)
      n -= 1
    n = 0
    while n < r.number_of_child_ireps
      @_loadIrepRecord(r["child_#{n}"] = {}, h.subarray(i), offset + i)
      n += 1
    return

  _decodeRiteInst: (code) ->
    op = (code) & 0x7f

    offset += r.section_size
    return [r, offset]

  _loadIrepRecord: (ctx, r, h, offset) ->
    r.record_size = _bin_to_u32_be(h.subarray(0, 4))
    r.number_of_locals = _bin_to_u16_be(h.subarray(4, 6))
    r.number_of_regs = _bin_to_u16_be(h.subarray(6, 8))
