Advertisement
SciresM

top bit hof vnd fix

Dec 8th, 2014
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1.         uint vnd = 0;
  2.             uint date = 0;
  3.             vnd |= (Convert.ToUInt32(TB_VN.Text) & 0xFF);
  4.             date |= (uint)((CAL_MetDate.Value.Year-2000) & 0xFF);
  5.             date |= (uint)((CAL_MetDate.Value.Month & 0xF) << 8);
  6.             date |= (uint)((CAL_MetDate.Value.Day & 0x1F) << 12);
  7.             vnd |= ((date & 0x1FFFF) << 14);
  8.             //Fix for top bit
  9.             uint rawvnd = BitConverter.ToUInt32(data, offset + 0x1B0);
  10.             vnd |= (rawvnd & 0x80000000);
  11.             Array.Copy(BitConverter.GetBytes(vnd), 0, data, offset + 0x1B0, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement