Skip to content

Instantly share code, notes, and snippets.

@tyranid tyranid/pac_device_info.cs Secret

Last active Jul 1, 2020
Embed
What would you like to do?
#region Marshal Helpers
internal class _Marshal_Helper : NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer
{
public void Write_0(Struct_0 p0)
{
WriteStruct<Struct_0>(p0);
}
public void Write_1(Struct_1 p0)
{
WriteStruct<Struct_1>(p0);
}
public void Write_2(Struct_2 p0)
{
WriteStruct<Struct_2>(p0);
}
public void Write_3(Struct_3 p0)
{
WriteStruct<Struct_3>(p0);
}
public void Write_4(Struct_4 p0)
{
WriteStruct<Struct_4>(p0);
}
public void Write_5(Struct_5 p0)
{
WriteStruct<Struct_5>(p0);
}
public void Write_6(Struct_3[] p0, long p1)
{
WriteConformantStructArray<Struct_3>(p0, p1);
}
public void Write_7(Struct_4[] p0, long p1)
{
WriteConformantStructArray<Struct_4>(p0, p1);
}
public void Write_8(Struct_5[] p0, long p1)
{
WriteConformantStructArray<Struct_5>(p0, p1);
}
public void Write_9(int[] p0, long p1)
{
WriteConformantArray<int>(p0, p1);
}
public void Write_10(sbyte[] p0)
{
WriteFixedPrimitiveArray<sbyte>(p0, 6);
}
public void Write_11(Struct_3[] p0, long p1)
{
WriteConformantStructArray<Struct_3>(p0, p1);
}
}
internal class _Unmarshal_Helper : NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer
{
public _Unmarshal_Helper(NtApiDotNet.Win32.Rpc.RpcClientResponse r) :
base(r.NdrBuffer, r.Handles, r.DataRepresentation)
{
}
public _Unmarshal_Helper(byte[] ba) :
base(ba)
{
}
public _Unmarshal_Helper(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type) :
base(pickled_type)
{
}
public Struct_0 Read_0()
{
return ReadStruct<Struct_0>();
}
public Struct_1 Read_1()
{
return ReadStruct<Struct_1>();
}
public Struct_2 Read_2()
{
return ReadStruct<Struct_2>();
}
public Struct_3 Read_3()
{
return ReadStruct<Struct_3>();
}
public Struct_4 Read_4()
{
return ReadStruct<Struct_4>();
}
public Struct_5 Read_5()
{
return ReadStruct<Struct_5>();
}
public Struct_3[] Read_6()
{
return ReadConformantStructArray<Struct_3>();
}
public Struct_4[] Read_7()
{
return ReadConformantStructArray<Struct_4>();
}
public Struct_5[] Read_8()
{
return ReadConformantStructArray<Struct_5>();
}
public int[] Read_9()
{
return ReadConformantArray<int>();
}
public sbyte[] Read_10()
{
return ReadFixedPrimitiveArray<sbyte>(6);
}
public Struct_3[] Read_11()
{
return ReadConformantStructArray<Struct_3>();
}
}
#endregion
#region Complex Types
public struct Struct_0 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteInt32(Member4);
m.WriteEmbeddedPointer<Struct_1>(Member8, new System.Action<Struct_1>(m.Write_1));
m.WriteInt32(Member10);
m.WriteEmbeddedPointer<Struct_3[], long>(Member18, new System.Action<Struct_3[], long>(m.Write_6), Member10);
m.WriteInt32(Member20);
m.WriteEmbeddedPointer<Struct_4[], long>(Member28, new System.Action<Struct_4[], long>(m.Write_7), Member20);
m.WriteInt32(Member30);
m.WriteEmbeddedPointer<Struct_5[], long>(Member38, new System.Action<Struct_5[], long>(m.Write_8), Member30);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member4 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_1>(new System.Func<Struct_1>(u.Read_1), false);
Member10 = u.ReadInt32();
Member18 = u.ReadEmbeddedPointer<Struct_3[]>(new System.Func<Struct_3[]>(u.Read_6), false);
Member20 = u.ReadInt32();
Member28 = u.ReadEmbeddedPointer<Struct_4[]>(new System.Func<Struct_4[]>(u.Read_7), false);
Member30 = u.ReadInt32();
Member38 = u.ReadEmbeddedPointer<Struct_5[]>(new System.Func<Struct_5[]>(u.Read_8), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public int Member4;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_1> Member8;
public int Member10;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_3[]> Member18;
public int Member20;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_4[]> Member28;
public int Member30;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_5[]> Member38;
public static Struct_0 CreateDefault()
{
return new Struct_0();
}
public Struct_0(int Member0, int Member4, System.Nullable<Struct_1> Member8, int Member10, Struct_3[] Member18, int Member20, Struct_4[] Member28, int Member30, Struct_5[] Member38)
{
this.Member0 = Member0;
this.Member4 = Member4;
this.Member8 = Member8;
this.Member10 = Member10;
this.Member18 = Member18;
this.Member20 = Member20;
this.Member28 = Member28;
this.Member30 = Member30;
this.Member38 = Member38;
}
}
public struct Struct_1 : NtApiDotNet.Ndr.Marshal.INdrConformantStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteSByte(Member0);
m.WriteSByte(Member1);
m.Write_2(Member2);
m.Write_9(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(Member8, "Member8"), Member1);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadSByte();
Member1 = u.ReadSByte();
Member2 = u.Read_2();
Member8 = u.Read_9();
}
int NtApiDotNet.Ndr.Marshal.INdrConformantStructure.GetConformantDimensions()
{
return 1;
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public sbyte Member0;
public sbyte Member1;
public Struct_2 Member2;
public int[] Member8;
public static Struct_1 CreateDefault()
{
Struct_1 ret = new Struct_1();
ret.Member8 = new int[0];
return ret;
}
public Struct_1(sbyte Member0, sbyte Member1, Struct_2 Member2, int[] Member8)
{
this.Member0 = Member0;
this.Member1 = Member1;
this.Member2 = Member2;
this.Member8 = Member8;
}
}
public struct Struct_2 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.Write_10(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(Member0, "Member0"));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.Read_10();
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 1;
}
public sbyte[] Member0;
public static Struct_2 CreateDefault()
{
Struct_2 ret = new Struct_2();
ret.Member0 = new sbyte[6];
return ret;
}
public Struct_2(sbyte[] Member0)
{
this.Member0 = Member0;
}
}
public struct Struct_3 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteInt32(Member4);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member4 = u.ReadInt32();
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public int Member4;
public static Struct_3 CreateDefault()
{
return new Struct_3();
}
public Struct_3(int Member0, int Member4)
{
this.Member0 = Member0;
this.Member4 = Member4;
}
}
public struct Struct_4 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteEmbeddedPointer<Struct_1>(Member0, new System.Action<Struct_1>(m.Write_1));
m.WriteInt32(Member8);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadEmbeddedPointer<Struct_1>(new System.Func<Struct_1>(u.Read_1), false);
Member8 = u.ReadInt32();
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_1> Member0;
public int Member8;
public static Struct_4 CreateDefault()
{
return new Struct_4();
}
public Struct_4(System.Nullable<Struct_1> Member0, int Member8)
{
this.Member0 = Member0;
this.Member8 = Member8;
}
}
public struct Struct_5 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteEmbeddedPointer<Struct_1>(Member0, new System.Action<Struct_1>(m.Write_1));
m.WriteInt32(Member8);
m.WriteEmbeddedPointer<Struct_3[], long>(Member10, new System.Action<Struct_3[], long>(m.Write_11), Member8);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadEmbeddedPointer<Struct_1>(new System.Func<Struct_1>(u.Read_1), false);
Member8 = u.ReadInt32();
Member10 = u.ReadEmbeddedPointer<Struct_3[]>(new System.Func<Struct_3[]>(u.Read_11), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_1> Member0;
public int Member8;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_3[]> Member10;
public static Struct_5 CreateDefault()
{
return new Struct_5();
}
public Struct_5(System.Nullable<Struct_1> Member0, int Member8, Struct_3[] Member10)
{
this.Member0 = Member0;
this.Member8 = Member8;
this.Member10 = Member10;
}
}
#endregion
#region Complex Type Encoders
public sealed class Encoder
{
private Encoder()
{
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_0_Encode(System.Nullable<Struct_0> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_0>(m.Write_0));
return m.ToPickledType();
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_1_Encode(System.Nullable<Struct_1> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_1>(m.Write_1));
return m.ToPickledType();
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_2_Encode(System.Nullable<Struct_2> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_2>(m.Write_2));
return m.ToPickledType();
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_3_Encode(System.Nullable<Struct_3> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_3>(m.Write_3));
return m.ToPickledType();
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_4_Encode(System.Nullable<Struct_4> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_4>(m.Write_4));
return m.ToPickledType();
}
public static NtApiDotNet.Ndr.Marshal.NdrPickledType Struct_5_Encode(System.Nullable<Struct_5> o)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(o, new System.Action<Struct_5>(m.Write_5));
return m.ToPickledType();
}
}
public sealed class Decoder
{
private Decoder()
{
}
public static System.Nullable<Struct_0> Struct_0_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_0> v;
v = u.ReadReferentValue<Struct_0>(new System.Func<Struct_0>(u.Read_0), false);
return v;
}
public static System.Nullable<Struct_1> Struct_1_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_1> v;
v = u.ReadReferentValue<Struct_1>(new System.Func<Struct_1>(u.Read_1), false);
return v;
}
public static System.Nullable<Struct_2> Struct_2_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_2> v;
v = u.ReadReferentValue<Struct_2>(new System.Func<Struct_2>(u.Read_2), false);
return v;
}
public static System.Nullable<Struct_3> Struct_3_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_3> v;
v = u.ReadReferentValue<Struct_3>(new System.Func<Struct_3>(u.Read_3), false);
return v;
}
public static System.Nullable<Struct_4> Struct_4_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_4> v;
v = u.ReadReferentValue<Struct_4>(new System.Func<Struct_4>(u.Read_4), false);
return v;
}
public static System.Nullable<Struct_5> Struct_5_Decode(NtApiDotNet.Ndr.Marshal.NdrPickledType pickled_type)
{
_Unmarshal_Helper u = new _Unmarshal_Helper(pickled_type);
System.Nullable<Struct_5> v;
v = u.ReadReferentValue<Struct_5>(new System.Func<Struct_5>(u.Read_5), false);
return v;
}
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.