Merge branch 'master' of https://github.com/highfidelity/hifi into loginForSmallAvatars-master

This commit is contained in:
Wayne Chen 2018-12-17 14:03:16 -08:00
commit 09ff67eab3
2 changed files with 35 additions and 3 deletions

View file

@ -755,7 +755,7 @@ void Agent::processAgentAvatarAudio() {
int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL;
const int16_t* nextSoundOutput = NULL; const int16_t* nextSoundOutput = NULL;
if (_avatarSound) { if (_avatarSound && _avatarSound->isReady()) {
auto audioData = _avatarSound->getAudioData(); auto audioData = _avatarSound->getAudioData();
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData() nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
+ _numAvatarSoundSentBytes); + _numAvatarSoundSentBytes);

View file

@ -77,7 +77,7 @@ local packet_types = {
[22] = "ICEServerPeerInformation", [22] = "ICEServerPeerInformation",
[23] = "ICEServerQuery", [23] = "ICEServerQuery",
[24] = "OctreeStats", [24] = "OctreeStats",
[25] = "UNUSED_PACKET_TYPE_1", [25] = "SetAvatarTraits",
[26] = "AvatarIdentityRequest", [26] = "AvatarIdentityRequest",
[27] = "AssignmentClientStatus", [27] = "AssignmentClientStatus",
[28] = "NoisyMute", [28] = "NoisyMute",
@ -257,6 +257,11 @@ function p_hfudt.dissector(buf, pinfo, tree)
subtree:add(f_message_part_number, buf(8, 4):le_uint()) subtree:add(f_message_part_number, buf(8, 4):le_uint())
end end
if obfuscation_bits ~= 0 then
local newbuf = deobfuscate(message_bit, buf, obfuscation_bits)
buf = newbuf:tvb("Unobfuscated")
end
-- read the type -- read the type
local packet_type = buf(payload_offset, 1):le_uint() local packet_type = buf(payload_offset, 1):le_uint()
local ptype = subtree:add_le(f_type, buf(payload_offset, 1)) local ptype = subtree:add_le(f_type, buf(payload_offset, 1))
@ -316,3 +321,30 @@ function p_hfudt.init()
udp_dissector_table:add(port, p_hfudt) udp_dissector_table:add(port, p_hfudt)
end end
end end
function deobfuscate(message_bit, buf, level)
local out = ByteArray.new()
out:set_size(buf:len())
if (level == 1) then
key = ByteArray.new("6362726973736574")
elseif level == 2 then
key = ByteArray.new("7362697261726461")
elseif level == 3 then
key = ByteArray.new("72687566666d616e")
else
return
end
local start = 4
if message_bit == 1 then
local start = 12
end
local p = 0
for i = start, buf:len() - 1 do
out:set_index(i, bit.bxor(buf(i, 1):le_uint(), key:get_index(7 - (p % 8))) )
p = p + 1
end
return out
end