Example #1
0
 void decode_header(NdrBuffer buf) throws NdrException {
   /* RPC major / minor version */
   if (buf.dec_ndr_small() != 5 || buf.dec_ndr_small() != 0)
     throw new NdrException("DCERPC version not supported");
   ptype = buf.dec_ndr_small();
   flags = buf.dec_ndr_small();
   if (buf.dec_ndr_long() != 0x00000010) /* Little-endian / ASCII / IEEE */
     throw new NdrException("Data representation not supported");
   length = buf.dec_ndr_short();
   if (buf.dec_ndr_short() != 0) throw new NdrException("DCERPC authentication not supported");
   call_id = buf.dec_ndr_long();
 }
 public void decode_out(NdrBuffer paramNdrBuffer) {
   if (paramNdrBuffer.dec_ndr_long() != 0) {
     paramNdrBuffer.dec_ndr_short();
     info.decode(paramNdrBuffer);
   }
   retval = paramNdrBuffer.dec_ndr_long();
 }
Example #3
0
  public void decode(NdrBuffer buf) throws NdrException {
    decode_header(buf);

    if (ptype != 12 && ptype != 2 && ptype != 3 && ptype != 13)
      throw new NdrException("Unexpected ptype: " + ptype);

    if (ptype == 2 || ptype == 3) {
      /* Response or Fault */
      alloc_hint = buf.dec_ndr_long();
      buf.dec_ndr_short(); /* context id */
      buf.dec_ndr_short(); /* cancel count */
    }
    if (ptype == 3 || ptype == 13) {
      /* Fault */
      result = buf.dec_ndr_long();
    } else {
      /* Bind_ack or Response */
      decode_out(buf);
    }
  }