예제 #1
0
        // Token: 0x06000641 RID: 1601 RVA: 0x0002342C File Offset: 0x0002162C
        internal byte[] GetBytes()
        {
            int num = 0;

            byte[] array = new byte[128];
            array[num++] = 0;
            array[num++] = (byte)this.fileNameLength;
            byte[] src = this.FileNameAsByteArray();
            Buffer.BlockCopy(src, 0, array, num, this.fileNameLength);
            num            = 65;
            num           += BinHexUtils.MarshalInt32(array, num, (long)this.fileType);
            num           += BinHexUtils.MarshalInt32(array, num, (long)this.fileCreator);
            array[num++]   = (byte)((65280 & this.finderFlags) >> 8);
            array[num++]   = 0;
            num           += BinHexUtils.MarshalUInt16(array, num, (ushort)this.iconXOffset);
            num           += BinHexUtils.MarshalUInt16(array, num, (ushort)this.iconYOffset);
            num           += BinHexUtils.MarshalUInt16(array, num, 0);
            array[num++]   = (this.fileProtected ? 1 : 0);
            array[num++]   = 0;
            num           += BinHexUtils.MarshalInt32(array, num, this.dataForkLength);
            num           += BinHexUtils.MarshalInt32(array, num, this.resourceForkLength);
            num           += BinHexUtils.MarshalInt32(array, num, 0L);
            num           += BinHexUtils.MarshalInt32(array, num, 0L);
            num           += BinHexUtils.MarshalUInt16(array, num, (ushort)this.commentLength);
            array[num++]   = (byte)(255 & this.finderFlags);
            num           += 18;
            num           += BinHexUtils.MarshalUInt16(array, num, (ushort)this.secondaryHeaderLength);
            array[num++]   = (byte)this.version;
            array[num++]   = (byte)this.minimumVersion;
            this.headerCRC = BinHexUtils.CalculateHeaderCrc(array, 124);
            num           += BinHexUtils.MarshalUInt16(array, num, this.headerCRC);
            array[num++]   = 0;
            array[num++]   = 0;
            return(array);
        }
예제 #2
0
        public byte[] GetBytes()
        {
            int num  = 0;
            int num2 = 1 + this.FileNameLength + 1 + 4 + 4 + 2 + 4 + 4 + 2;

            byte[] array = new byte[num2];
            array[num++] = (byte)this.fileNameLength;
            Buffer.BlockCopy(this.fileName, 0, array, num, this.fileNameLength);
            num           += this.FileNameLength;
            array[num++]   = (byte)this.version;
            num           += BinHexUtils.MarshalInt32(array, num, (long)this.fileType);
            num           += BinHexUtils.MarshalInt32(array, num, (long)this.fileCreator);
            num           += BinHexUtils.MarshalUInt16(array, num, (ushort)this.finderFlags);
            num           += BinHexUtils.MarshalInt32(array, num, this.dataForkLength);
            num           += BinHexUtils.MarshalInt32(array, num, this.resourceForkLength);
            this.headerCRC = BinHexUtils.CalculateHeaderCrc(array, num);
            num           += BinHexUtils.MarshalUInt16(array, num, this.headerCRC);
            return(array);
        }