Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteGuid()

static unsafe void System.Reflection.BlobUtilities.WriteGuid ( this byte[] buffer,
int start,
Guid value )
inlinestatic

Definition at line 113 of file BlobUtilities.cs.

114 {
115 fixed (byte* ptr2 = &buffer[start])
116 {
117 byte* ptr = (byte*)(&value);
118 uint num = *(uint*)ptr;
119 *ptr2 = (byte)num;
120 ptr2[1] = (byte)(num >> 8);
121 ptr2[2] = (byte)(num >> 16);
122 ptr2[3] = (byte)(num >> 24);
123 ushort num2 = *(ushort*)(ptr + 4);
124 ptr2[4] = (byte)num2;
125 ptr2[5] = (byte)(num2 >> 8);
126 ushort num3 = *(ushort*)(ptr + 6);
127 ptr2[6] = (byte)num3;
128 ptr2[7] = (byte)(num3 >> 8);
129 ptr2[8] = ptr[8];
130 ptr2[9] = ptr[9];
131 ptr2[10] = ptr[10];
132 ptr2[11] = ptr[11];
133 ptr2[12] = ptr[12];
134 ptr2[13] = ptr[13];
135 ptr2[14] = ptr[14];
136 ptr2[15] = ptr[15];
137 }
138 }

References System.buffer, System.start, and System.value.