MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / attachStream

Method attachStream

Engine/source/core/util/zip/zipCryptStream.cpp:86–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86bool ZipCryptRStream::attachStream(Stream* io_pSlaveStream)
87{
88 mStream = io_pSlaveStream->clone();
89 mStreamStartPos = mStream->getPosition();
90
91 // [tom, 12/20/2005] Encrypted zip files have an extra 12 bytes
92 // of entropy before the file data.
93
94 U8 buffer[12];
95 if(mStream->read(sizeof(buffer), &buffer))
96 {
97 // Initialize keys
98 for(S32 i = 0;i < sizeof(buffer);i++)
99 {
100 updateKeys(buffer[i] ^= decryptByte());
101 }
102
103 // if(buffer[11] !)
104 mFileStartPos = mStream->getPosition();
105
106 setStatus(Ok);
107 return true;
108 }
109 return false;
110}
111
112void ZipCryptRStream::detachStream()
113{

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.45
getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected