Files
UVtools/Scripts/010 Editor/ctb_decrypted.bt
T
Tiago Conceição 816898836b v3.9.0
- **File formats:**
  - (Add) File extension: .gktwo.ctb to `ChituboxFile` to be able to convert files for UniFormation GKtwo under special CTB format
  - (Add) UniFormation GKtwo compatibility under CTB format, if exporting JXS rename to CTB before open
  - (Fix) CTB, CBDDLP, PHOTON, FDG, PHZ: Read and write files larger then 4GB (#608)
- **PCB Exposure:**
  - (Add) Offset X/Y to offset the PCB from it origin
  - (Add) Allow to toggle between "Show preview image cropped by it bounds" and "Show full preview image (The final result)"
  - (Improvement) Use rectangle instead of line for center line primitive (#607)
  - (Fix) Implement rotation to polygon and center line primitives (#607)
  - (Fix) Macros in a single line was not being parsed (#607)
  - (Fix) Invert color per file was not affecting primitives
- **Network printers:**
  - (Add) Socket requests with TCP and UDP
  - (Add) AnyCubic printer preset (However it can't upload a file)
  - (Add) Scripts in request path to allow a first request to fetch data to the final request:
    -  A script starts with **<\?** and ends with **?>**
    -  First parameter is the first request to get response content from
    -  Second parameter is the regex pattern to match content with
    -  Third parameter is the final request that supports a parameter from regex matching group, eg: **{#1}** is match Group[1] value
    -  **Example:** <\? getfiles > {0}\/(\d+\.[\da-zA-Z]+), > printfile,{#1} ?>
  - (Change) Allow to print a filename without send it when upload request path is empty
  - (Fix) Do not show printers with empty requests
- (Change) Default layer compression to Lz4 instead of Png
- (Improvement) Application is now culture aware but set part of `NumberFormat` to the `InvariantCulture.NumberFormat`
- (Improvement) Material cost now show with the current culture currency symbol due previous change
- (Improvement) Better submit of bug reports using sections and forms
- (Improvement) Linux: AppImage now have a help manual with possible arguments and parameters
- (Improvement) macOS: Codesign app on auto-installer and auto-upgrade to bypass arm64 run restriction (#431)
- (Improvement) macOS: Rebuilt arm64 libcvextern.dylib to run with less dependencies (#431)
- (Improvement) macOS: Try to show missing dependencies from openCV (if any) on the error message
- (Fix) UI: layers sorted lexicographically instead of numerically in the issues list view (#611)
- (Fix) PrusaSlicer printer parameters: UniFormation GKtwo
2022-12-01 04:27:44 +00:00

189 lines
5.0 KiB
Plaintext

//--------------------------------------
//--- 010 Editor v6.0.3 Binary Template
//
// File: ctb
// Author: Tim Slater
// Revision: 1
// Purpose: CTB File Format
//--------------------------------------
struct HEADER {
uint Magic <fgcolor=cBlack, bgcolor=cRed, format=hex>;
uint HeaderSize <fgcolor=cBlack, bgcolor=cRed>;
uint HeaderOffset <fgcolor=cBlack, bgcolor=cRed, format=hex>;
uint unknown1;
uint unknown2;
uint SignatureSize <fgcolor=cBlack, bgcolor=cRed>;
uint SignatureOffset <fgcolor=cBlack, bgcolor=cRed, format=hex>;
uint unknown3;
ushort unknown4;
ushort unknown5;
uint unknown6;
uint unknown7;
uint unknown9;
} header;
FSeek(header.HeaderOffset);
struct DECRYPTED_HEADER {
uint64 ChecksumValue;
uint LayerTableOffset;
float DisplayWidth;
float DisplayHeight;
float MachineZ;
uint Unknown1;
uint Unknown2;
float TotalHeightMilimeter;
float LayerHeight;
float ExposureTime;
float BottomExposureTime;
float LightOffDelay;
uint BottomLayerCount;
uint ResolutionX;
uint ResolutionY;
uint LayerCount;
uint LargePreviewOffset;
uint SmallPreviewOffset;
uint PrintTime;
uint ProjectorType;
float BottomLiftHeight;
float BottomLiftSpeed;
float LiftHeight;
float LiftSpeed;
float RetractSpeed; /* might be bottom retract speed, need to verify */
float ModelVolume;
float ModelWeight;
float Cost;
float BottomLightOffDelay;
uint Unknown3;
ushort LightPWM; /* these might be in the wrong order */
ushort BottomLightPWM;
uint LayerXorKey;
float BottomLiftHeight2;
float BottomLiftSpeed2;
float LiftingHeight2;
float LiftingSpeed2;
float RetractHeight2;
float RetractSpeed2;
float RestTimeAfterLift;
uint PrinterNameOffset;
uint PrinterNameSize;
uint Unknown4;
uint unknown5;
uint unknown6;
float RestTimeAfterRetract;
float RestTimeAfterLift;
uint TransitionLayerCount;
float BottomRetractSpeed;
float BottomRetractSpeed2;
uint Padding1;
float Four1;
uint Padding2;
float Four2;
float RestTimeAfterRetract;
float RestTimeAfterLift;
float RestTimeBeforeLift;
float BottomRetractHeight;
float unknown7;
uint unknown8;
uint unknown9;
uint LastLayerIndex;
uint Padding3;
uint Padding4;
uint Padding5;
uint Padding6;
uint DisclaimerOffset;
uint DisclaimerSize;
uint Padding7;
uint Padding8;
uint Padding9;
uint Padding10;
};
DECRYPTED_HEADER decryptedHeader;
struct PREVIEW {
uint ResolutionX <fgcolor=cBlack, bgcolor=cRed>;
uint ResolutionY <fgcolor=cBlack, bgcolor=cRed>;
uint ImageOffset <fgcolor=cBlack, bgcolor=cRed>;
uint ImageLength <fgcolor=cBlack, bgcolor=cRed>;
byte Data[ImageLength] <fgcolor=cBlack, bgcolor=cGreen>;
} LargePreview;
PREVIEW SmallPreview;
FSeek(decryptedHeader.PrinterNameOffset);
char MachineName[decryptedHeader.PrinterNameSize] <fgcolor=cBlack, bgcolor=cYellow>;
char Disclaimer[320] <fgcolor=cBlack, bgcolor=cPurple>;
FSeek(decryptedHeader.LayerTableOffset);
/* need to walk the layer index table to get a count of them.
the actual count field is in the encrypted header */
struct LAYER_POINTER {
uint Offset;
uint PageNumber;
uint LayerTableSize;
uint Padding2;
} layerPointers[decryptedHeader.LayerCount];
struct LAYER_HEADER{
uint LayerMarker <hidden=true>;
float PositionZ;
float ExposureTime;
float LightOffDelay;
uint LayerDataOffset;
uint PageNumber;
uint LayerDataLength;
uint unknown3;
uint EncryptedDataOffset;
uint EncryptedDataLength;
float LiftHeight;
float LiftSpeed;
float LiftHeight2;
float LiftSpeed2;
float RetractSpeed;
float RetractHeight2;
float RetractSpeed2;
float RestTimeBeforeLift;
float RestTimeAfterLift;
float RestTimeAfterRetract;
float LightPWM; /* just a guess, has value 255 as a float */
uint unknown6;
};
struct LAYER {
LAYER_HEADER layerHeader;
FSeek(layerHeader.PageNumber * 4294967296 + layerHeader.LayerDataOffset);
/* do we have encrypted data? */
if (layerHeader.EncryptedDataLength > 0) {
if (layerHeader.EncryptedDataOffset > 0) {
ubyte normalLayerData1[layerHeader.EncryptedDataOffset];
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
ubyte normalLayerData2[layerHeader.LayerDataLength - (layerHeader.EncryptedDataOffset + layerHeader.EncryptedDataLength)];
} else {
ubyte encrytedLayerData[layerHeader.EncryptedDataLength];
ubyte normalLayerData[layerHeader.LayerDataLength - layerHeader.EncryptedDataLength];
}
} else {
ubyte layerData[layerHeader.LayerDataLength] <format=binary>;
}
};
struct LAYERS {
local uint x;
for(x = 0; x < decryptedHeader.LayerCount; x++) {
FSeek(layerPointers[x].PageNumber * 4294967296 + layerPointers[x].Offset);
LAYER layer;
}
} layers;
ubyte Sha256Hash[0x20]<format=hex>;