Massive commit, mainly client tag stuff and random id0 and random mac,
red name if not actually in the sim in active speakers for voice.
This commit is contained in:
@@ -24,6 +24,7 @@ set(llimage_SOURCE_FILES
|
||||
llimagedxt.cpp
|
||||
llimagej2c.cpp
|
||||
llimagejpeg.cpp
|
||||
llimagemetadatareader.cpp
|
||||
llimagepng.cpp
|
||||
llimagetga.cpp
|
||||
llimageworker.cpp
|
||||
@@ -38,6 +39,7 @@ set(llimage_HEADER_FILES
|
||||
llimagedxt.h
|
||||
llimagej2c.h
|
||||
llimagejpeg.h
|
||||
llimagemetadatareader.h
|
||||
llimagepng.h
|
||||
llimagetga.h
|
||||
llimageworker.h
|
||||
|
||||
@@ -156,7 +156,7 @@ private:
|
||||
|
||||
public:
|
||||
S16 mMemType; // debug
|
||||
|
||||
std::string decodedImageComment; //lol comment decoding haha
|
||||
static BOOL sSizeOverride;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
#include "lldir.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
// <edit>
|
||||
#include "llimagemetadatareader.h"
|
||||
// </edit>
|
||||
typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
|
||||
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
|
||||
typedef const char* (*EngineInfoLLImageJ2CFunction)();
|
||||
@@ -297,6 +299,9 @@ BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir
|
||||
// Update the raw discard level
|
||||
updateRawDiscardLevel();
|
||||
mDecoding = TRUE;
|
||||
// <edit>
|
||||
raw_imagep->decodedImageComment = LLImageMetaDataReader::ExtractEncodedComment(getData(),getDataSize());
|
||||
// </edit>
|
||||
res = mImpl->decodeImpl(*this, *raw_imagep, decode_time, first_channel, max_channel_count);
|
||||
}
|
||||
|
||||
|
||||
127
indra/llimage/llimagemetadatareader.cpp
Normal file
127
indra/llimage/llimagemetadatareader.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
// <edit>
|
||||
#include "linden_common.h"
|
||||
#include "llimagemetadatareader.h"
|
||||
|
||||
LLJ2cParser::LLJ2cParser(U8* data,int data_size)
|
||||
{
|
||||
if(data && data_size)
|
||||
{
|
||||
mData.resize(data_size);
|
||||
memcpy(&(mData[0]), data, data_size);
|
||||
//std::copy(data,data+data_size,mData.begin());
|
||||
}
|
||||
mIter = mData.begin();
|
||||
}
|
||||
|
||||
U8 LLJ2cParser::nextChar()
|
||||
{
|
||||
U8 rtn = 0x00;
|
||||
if(mIter != mData.end())
|
||||
{
|
||||
rtn = (*mIter);
|
||||
mIter++;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
std::vector<U8> LLJ2cParser::nextCharArray(int len)
|
||||
{
|
||||
std::vector<U8> array;
|
||||
if(len > 0)
|
||||
{
|
||||
array.resize(len);
|
||||
for(S32 i = 0; i < len; i++)
|
||||
{
|
||||
array[i] = nextChar();
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
std::vector<U8> LLJ2cParser::GetNextComment()
|
||||
{
|
||||
std::vector<U8> content;
|
||||
while (mIter != mData.end())
|
||||
{
|
||||
U8 marker = nextChar();
|
||||
if (marker == 0xff)
|
||||
{
|
||||
U8 marker_type = nextChar();
|
||||
if (marker_type == 0x4f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (marker_type == 0x90)
|
||||
{
|
||||
//llinfos << "FOUND 0x90" << llendl;
|
||||
break; //return empty vector
|
||||
}
|
||||
|
||||
if (marker_type == 0x64)
|
||||
{
|
||||
//llinfos << "FOUND 0x64 COMMENT SECTION" << llendl;
|
||||
S32 len = ((S32)nextChar())*256 + (S32)nextChar();
|
||||
if (len > 3) content = nextCharArray(len - 2);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
content.clear(); //return empty vector by clear anything there
|
||||
return content;
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
|
||||
{
|
||||
LLJ2cParser* parser = new LLJ2cParser(data,data_size);
|
||||
while(1)
|
||||
{
|
||||
std::vector<U8> comment = parser->GetNextComment();
|
||||
if (comment.empty()) break; //exit loop
|
||||
if (comment[1] == 0x00 && comment.size() == 130)
|
||||
{
|
||||
//llinfos << "FOUND PAYLOAD" << llendl;
|
||||
std::vector<U8> payload(128);
|
||||
S32 i;
|
||||
memcpy(&(payload[0]), &(comment[2]), 128);
|
||||
if (payload[2] == payload[127])
|
||||
{
|
||||
// emkdu.dll
|
||||
for (i = 4; i < 128; i += 4)
|
||||
{
|
||||
payload[i] ^= payload[3];
|
||||
payload[i + 1] ^= payload[1];
|
||||
payload[i + 2] ^= payload[0];
|
||||
payload[i + 3] ^= payload[2];
|
||||
}
|
||||
}
|
||||
else if (payload[3] == payload[127])
|
||||
{
|
||||
// emkdu.dll or onyxkdu.dll
|
||||
for (i = 4; i < 128; i += 4)
|
||||
{
|
||||
payload[i] ^= payload[2];
|
||||
payload[i + 1] ^= payload[0];
|
||||
payload[i + 2] ^= payload[1];
|
||||
payload[i + 3] ^= payload[3];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;//exit loop
|
||||
}
|
||||
for (i = 4; i < 128; ++i)
|
||||
{
|
||||
if (payload[i] == 0) break;
|
||||
}
|
||||
std::string result(payload.begin()+4,payload.begin()+i);
|
||||
//llinfos << "FOUND COMMENT: " << result << llendl;
|
||||
delete parser;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
//end of loop
|
||||
delete parser;
|
||||
return "";
|
||||
}
|
||||
// </edit>
|
||||
26
indra/llimage/llimagemetadatareader.h
Normal file
26
indra/llimage/llimagemetadatareader.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// <edit>
|
||||
#ifndef LL_LLIMAGEMETADATAREADER_H
|
||||
#define LL_LLIMAGEMETADATAREADER_H
|
||||
#include "stdtypes.h"
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class LLJ2cParser
|
||||
{
|
||||
public:
|
||||
LLJ2cParser(U8* data,int data_size);
|
||||
std::vector<U8> GetNextComment();
|
||||
private:
|
||||
U8 nextChar();
|
||||
std::vector<U8> nextCharArray(int len);
|
||||
std::vector<U8> mData;
|
||||
std::vector<U8>::iterator mIter;
|
||||
};
|
||||
class LLImageMetaDataReader
|
||||
{
|
||||
public:
|
||||
static std::string ExtractEncodedComment(U8* data,int data_size);
|
||||
};
|
||||
#endif
|
||||
// </edit>
|
||||
Reference in New Issue
Block a user