README.md 2.8 KB

RPC

GoDoc Go Report Card Build Status

This project relates to CDE 1.1: Remote Procedure Call

It is a partial implementation that mainly focuses on unmarshaling NDR encoded byte streams into Go structures.

Help Wanted

Reference test vectors needed: It has been difficult to implement due to a lack of reference test byte streams in the standards documentation. Test driven development has been extremely challenging without these. If you are aware of and reference test vector sources for NDR encoding please let me know by raising an issue with the details. Thanks!

References

NDR Decode Capability Checklist

  • Format label
  • Boolean
  • Character
  • Unsigned small integer
  • Unsigned short integer
  • Unsigned long integer
  • Unsigned hyper integer
  • Signed small integer
  • Signed short integer
  • Signed long integer
  • Signed hyper integer
  • Single float
  • Double float
  • Uni-dimensional fixed array
  • Multi-dimensional fixed array
  • Uni-dimensional conformant array
  • Multi-dimensional conformant array
  • Uni-dimensional conformant varying array
  • Multi-dimensional conformant varying array
  • Varying string
  • Conformant varying string
  • Array of strings
  • Union
  • Pipe

Structs from IDL

Interface Definition Language (IDL)

Is a field a pointer?

Is an array conformant and/or varying?

An array is conformant if the IDL definition includes one of the following attributes:

  • min_is
  • max_is
  • size_is

An array is varying if the IDL definition includes one of the following attributes:

  • last_is
  • first_is
  • length_is

Examples:

SubAuthority[] is conformant in the example below:

 typedef struct _RPC_SID {
   unsigned char Revision;
   unsigned char SubAuthorityCount;
   RPC_SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
   [size_is(SubAuthorityCount)] unsigned long SubAuthority[];
 } RPC_SID,
  *PRPC_SID,
  *PSID;

Buffer is a pointer to a conformant varying array in the example below:

 typedef struct _RPC_UNICODE_STRING {
   unsigned short Length;
   unsigned short MaximumLength;
   [size_is(MaximumLength/2), length_is(Length/2)] 
     WCHAR* Buffer;
 } RPC_UNICODE_STRING,
  *PRPC_UNICODE_STRING;

Is a union encapsulated?