Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. int CD_SIZE = 2;
  2. int USE_SIZE = 3;
  3. int COUNT_SIZE = 1;
  4. int UNKNOWN_SIZE = 5; // 5B謎サイズ
  5. int LENGTH_SIZE = 1;
  6. int FOOTER_SIZE = 1;
  7.  
  8. int nowPos = 0;
  9. byte[] Count = new byte[COUNT_SIZE];
  10. byte[] Length = new byte[LENGTH_SIZE];
  11.  
  12. nowPos += CD_SIZE + USE_SIZE;
  13.  
  14.  
  15. Buffer.BlockCopy( byteData, nowPos, Count, 0, COUNT_SIZE );
  16. int CountSize = Convert.ToInt32( BytesConvert.ToHexString( Count ), 16 );
  17.  
  18. nowPos += COUNT_SIZE;
  19. for( int i = 0; i < CountSize; i++ ) {
  20. nowPos += UNKNOWN_SIZE;
  21. Buffer.BlockCopy( byteData, nowPos, Length, 0, LENGTH_SIZE );
  22. int strSize = Convert.ToInt32( BytesConvert.ToHexString( Length ), 16 );
  23. nowPos += LENGTH_SIZE;
  24. byte[] ResultByte = new byte[strSize];
  25. Buffer.BlockCopy(byteData, nowPos, ResultByte, 0, strSize)
  26. nowPos += strSize + FOOTER_SIZE;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement