コード例 #1
0
        private EXTRA_DATA Read_Extra(BinaryReader br)
        {
            EXTRA_DATA extra = new EXTRA_DATA();

            for (; ;)
            {
                uint size = br.ReadUInt32();
                if (size < 0x04)
                {
                    extra.terminal.terminal = size;
                    return(extra);
                }

                uint sign = br.ReadUInt32();
                switch (sign)
                {
                case 0xA0000001:
                    extra.environment.blockSize      = size;
                    extra.environment.blockSignature = sign;
                    extra.environment.targetAnsi     = Get_String(br, 260, false);
                    extra.environment.targetUnicode  = Get_String(br, 260, true);
                    break;

                case 0xA0000002:
                    CONSOLE_PROPS cp = new CONSOLE_PROPS();
                    cp.blockSize             = size;
                    cp.blockSignature        = sign;
                    cp.fillAttributes        = (FILL_ATTRIBUTES)br.ReadUInt16();
                    cp.popupFillAttributes   = br.ReadUInt16();
                    cp.screenBufferSizeX     = br.ReadUInt16();
                    cp.screenBufferSizeY     = br.ReadUInt16();
                    cp.windowSizeX           = br.ReadUInt16();
                    cp.windowSizeY           = br.ReadUInt16();
                    cp.windowOriginX         = br.ReadUInt16();
                    cp.windowOriginY         = br.ReadUInt16();
                    cp.unused1               = br.ReadUInt32();
                    cp.unused2               = br.ReadUInt32();
                    cp.fontSize              = br.ReadUInt32();
                    cp.fontFamily            = (FONT_FAMILY)br.ReadUInt32();
                    cp.fontWeight            = br.ReadUInt32();
                    cp.faceName              = Get_String(br, 32, true);
                    cp.cursorSize            = br.ReadUInt32();
                    cp.fullScreen            = br.ReadUInt32();
                    cp.quickEdit             = br.ReadUInt32();
                    cp.insertMode            = br.ReadUInt32();
                    cp.autoPosition          = br.ReadUInt32();
                    cp.historyBufferSize     = br.ReadUInt32();
                    cp.numberOfHistoryBuffer = br.ReadUInt32();
                    cp.historyNoDup          = br.ReadUInt32();
                    cp.colorTable            = new uint[0x10];
                    for (int i = 0; i < 0x10; i++)
                    {
                        cp.colorTable[i] = br.ReadUInt32();
                    }
                    extra.console = cp;
                    break;

                case 0xA0000003:
                    extra.tracker.blockSize      = size;
                    extra.tracker.blockSignature = sign;
                    extra.tracker.length         = br.ReadUInt32();
                    extra.tracker.version        = br.ReadUInt32();
                    extra.tracker.machineID      = Get_String(br, 0x10, false);
                    extra.tracker.droid          = br.ReadBytes(0x20);
                    extra.tracker.droidBirth     = br.ReadBytes(0x20);
                    break;

                case 0xA0000004:
                    extra.consoleFe.blockSize      = size;
                    extra.consoleFe.blockSignature = sign;
                    extra.consoleFe.codePage       = br.ReadUInt32();
                    break;

                case 0xA0000005:
                    extra.specialFolder.blockSize       = size;
                    extra.specialFolder.blockSignature  = sign;
                    extra.specialFolder.specialFolderID = br.ReadUInt32();
                    extra.specialFolder.offset          = br.ReadUInt32();
                    break;

                case 0xA0000006:
                    extra.darwin.blockSize         = size;
                    extra.darwin.blockSignature    = sign;
                    extra.darwin.darwinDataAnsi    = Get_String(br, 260, false);
                    extra.darwin.darwinDataUnicode = Get_String(br, 260, true);
                    break;

                case 0xA0000007:
                    extra.iconEnvironment.blockSize      = size;
                    extra.iconEnvironment.blockSignature = sign;
                    extra.iconEnvironment.targetAnsi     = Get_String(br, 260, false);
                    extra.iconEnvironment.targetUnicode  = Get_String(br, 260, true);
                    break;

                case 0xA0000008:
                    extra.shim.blockSize      = size;
                    extra.shim.blockSignature = sign;
                    extra.shim.layerName      = Get_String(br, (int)extra.shim.blockSize - 8, true);
                    break;

                case 0xA0000009:
                    extra.propertyStore.blockSize      = size;
                    extra.propertyStore.blockSignature = sign;
                    extra.propertyStore.propertyStore  = null;
                    break;

                case 0xA000000B:
                    extra.knownFolder.blockSize      = size;
                    extra.knownFolder.blockSignature = sign;
                    extra.knownFolder.knownFolderID  = br.ReadBytes(0x10);
                    extra.knownFolder.offset         = br.ReadUInt32();
                    break;

                case 0xA000000C:
                    extra.vistaIDList.blockSize      = size;
                    extra.vistaIDList.blockSignature = sign;
                    extra.vistaIDList.idlist         = Read_IDList(br);
                    break;
                }
            }
        }
コード例 #2
0
ファイル: LNK.cs プロジェクト: MetLob/tinke
        private EXTRA_DATA Read_Extra(BinaryReader br)
        {
            EXTRA_DATA extra = new EXTRA_DATA();

            for (; ; )
            {
                uint size = br.ReadUInt32();
                if (size < 0x04)
                {
                    extra.terminal.terminal = size;
                    return extra;
                }

                uint sign = br.ReadUInt32();
                switch (sign)
                {
                    case 0xA0000001:
                        extra.environment.blockSize = size;
                        extra.environment.blockSignature = sign;
                        extra.environment.targetAnsi = Get_String(br, 260, false);
                        extra.environment.targetUnicode = Get_String(br, 260, true);
                        break;

                    case 0xA0000002:
                        CONSOLE_PROPS cp = new CONSOLE_PROPS();
                        cp.blockSize = size;
                        cp.blockSignature = sign;
                        cp.fillAttributes = (FILL_ATTRIBUTES)br.ReadUInt16();
                        cp.popupFillAttributes = br.ReadUInt16();
                        cp.screenBufferSizeX = br.ReadUInt16();
                        cp.screenBufferSizeY = br.ReadUInt16();
                        cp.windowSizeX = br.ReadUInt16();
                        cp.windowSizeY = br.ReadUInt16();
                        cp.windowOriginX = br.ReadUInt16();
                        cp.windowOriginY = br.ReadUInt16();
                        cp.unused1 = br.ReadUInt32();
                        cp.unused2 = br.ReadUInt32();
                        cp.fontSize = br.ReadUInt32();
                        cp.fontFamily = (FONT_FAMILY)br.ReadUInt32();
                        cp.fontWeight = br.ReadUInt32();
                        cp.faceName = Get_String(br, 32, true);
                        cp.cursorSize = br.ReadUInt32();
                        cp.fullScreen = br.ReadUInt32();
                        cp.quickEdit = br.ReadUInt32();
                        cp.insertMode = br.ReadUInt32();
                        cp.autoPosition = br.ReadUInt32();
                        cp.historyBufferSize = br.ReadUInt32();
                        cp.numberOfHistoryBuffer = br.ReadUInt32();
                        cp.historyNoDup = br.ReadUInt32();
                        cp.colorTable = new uint[0x10];
                        for (int i = 0; i < 0x10; i++)
                            cp.colorTable[i] = br.ReadUInt32();
                        extra.console = cp;
                        break;

                    case 0xA0000003:
                        extra.tracker.blockSize = size;
                        extra.tracker.blockSignature = sign;
                        extra.tracker.length = br.ReadUInt32();
                        extra.tracker.version = br.ReadUInt32();
                        extra.tracker.machineID = Get_String(br, 0x10, false);
                        extra.tracker.droid = br.ReadBytes(0x20);
                        extra.tracker.droidBirth = br.ReadBytes(0x20);
                        break;

                    case 0xA0000004:
                        extra.consoleFe.blockSize = size;
                        extra.consoleFe.blockSignature = sign;
                        extra.consoleFe.codePage = br.ReadUInt32();
                        break;

                    case 0xA0000005:
                        extra.specialFolder.blockSize = size;
                        extra.specialFolder.blockSignature = sign;
                        extra.specialFolder.specialFolderID = br.ReadUInt32();
                        extra.specialFolder.offset = br.ReadUInt32();
                        break;

                    case 0xA0000006:
                        extra.darwin.blockSize = size;
                        extra.darwin.blockSignature = sign;
                        extra.darwin.darwinDataAnsi = Get_String(br, 260, false);
                        extra.darwin.darwinDataUnicode = Get_String(br, 260, true);
                        break;

                    case 0xA0000007:
                        extra.iconEnvironment.blockSize = size;
                        extra.iconEnvironment.blockSignature = sign;
                        extra.iconEnvironment.targetAnsi = Get_String(br, 260, false);
                        extra.iconEnvironment.targetUnicode = Get_String(br, 260, true);
                        break;

                    case 0xA0000008:
                        extra.shim.blockSize = size;
                        extra.shim.blockSignature = sign;
                        extra.shim.layerName = Get_String(br, (int)extra.shim.blockSize - 8,  true);
                        break;

                    case 0xA0000009:
                        extra.propertyStore.blockSize = size;
                        extra.propertyStore.blockSignature = sign;
                        extra.propertyStore.propertyStore = null;
                        break;

                    case 0xA000000B:
                        extra.knownFolder.blockSize = size;
                        extra.knownFolder.blockSignature = sign;
                        extra.knownFolder.knownFolderID = br.ReadBytes(0x10);
                        extra.knownFolder.offset = br.ReadUInt32();
                        break;

                    case 0xA000000C:
                        extra.vistaIDList.blockSize = size;
                        extra.vistaIDList.blockSignature = sign;
                        extra.vistaIDList.idlist = Read_IDList(br);
                        break;
                }
            }
        }