Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __thiscall fb::StreamingPartitionReader::handleFixup(fb::StreamingPartitionReader *this)
- {
- fb::StreamingPartitionReader *streamReader; // esi@1
- const char *v2; // eax@1
- streamReader = this;
- memcpy(this->m_targetStringBase, this->m_sourceStringBlock, this->m_header.stringTableSize);
- v2 = fb::StreamingPartitionReader::layoutDataContainers(streamReader);
- fb::StreamingPartitionReader::marshalDataContainers(streamReader, v2);
- if ( streamReader->m_endianSwapRequired )
- fb::StreamingPartitionReader::marshalArraysEndianSwap(streamReader);
- else
- fb::StreamingPartitionReader::marshalArrays(streamReader);
- }
- void __thiscall fb::StreamingPartitionReader::marshalArrays(fb::StreamingPartitionReader *this)
- {
- fb::StreamingPartitionReader *streamReader; // esi@1
- unsigned int arrayIndex; // edi@1
- fb::StreamingPartitionArrayEntry *currArray; // eax@4
- const void *pArrayStart; // ebx@4
- int count; // edx@4
- fb::DataContainer *pDataContainer; // edi@7
- fb::StreamingPartitionFieldDescriptor *currField; // ecx@11
- unsigned int realType; // eax@11
- int position; // ebx@23
- int realPos; // ebx@33
- int v12; // eax@39
- fb::InternalDatabasePartition *partition; // eax@41
- fb::StreamingPartitionTypeDescriptor *currType_2; // ebx@47
- size_t secondaryInstanceSize; // ST48_4@52
- const void *defaultValue; // eax@52
- int v17; // eax@56
- const unsigned int targetStride; // [sp+8h] [bp-28h]@49
- const unsigned int sourceStride; // [sp+Ch] [bp-24h]@50
- fb::ValueTypeInfo *vti; // [sp+10h] [bp-20h]@49
- const char *sourceInstances; // [sp+14h] [bp-1Ch]@1
- int currIndex; // [sp+18h] [bp-18h]@2
- fb::StreamingPartitionTypeDescriptor *currType_1; // [sp+1Ch] [bp-14h]@4 MAPDST
- int count2; // [sp+1Ch] [bp-14h]@21
- int counter2; // [sp+1Ch] [bp-14h]@51
- unsigned int i; // [sp+20h] [bp-10h]@1
- const char *sourceCursor; // [sp+24h] [bp-Ch]@4
- const unsigned int elementCount; // [sp+28h] [bp-8h]@4
- char elementSize; // [sp+2Fh] [bp-1h]@12
- streamReader = this;
- arrayIndex = 0;
- sourceInstances = &this->m_sourceInstanceBlock[this->m_header.arrayOffset];
- i = 0;
- if ( this->m_header.arrayCount )
- {
- currIndex = 0;
- while ( 1 )
- {
- currArray = &streamReader->m_arrayEntries[currIndex];
- pArrayStart = &sourceInstances[currArray->offset];
- count = currArray->elementCount;
- currType_1 = &streamReader->m_typeDescriptors[currArray->typeDescriptorIndex];
- elementCount = currArray->elementCount;
- currType_1 = &streamReader->m_typeDescriptors[currArray->typeDescriptorIndex];
- sourceCursor = &sourceInstances[currArray->offset];
- if ( arrayIndex && arrayIndex >= streamReader->targetArrayOffsets.mpEnd - streamReader->targetArrayOffsets.mpBegin )
- {
- eastl::AssertionFailure("vector::operator[] -- out of range");
- count = elementCount;
- arrayIndex = i;
- }
- pDataContainer = (fb::DataContainer *)&streamReader->m_targetBuffer[streamReader->targetArrayOffsets.mpBegin[arrayIndex]];
- *(_DWORD *)&pDataContainer[-1].m_flags = count;
- if ( currType_1->fieldCount != 1 )
- {
- fb::Log::formattedLog(&stru_39E0FF8, "%s", &secret);
- if ( fb::Log::shouldBreak() )
- __debugbreak();
- count = elementCount;
- }
- currField = &streamReader->m_fieldDescriptors[currType_1->layoutDescriptor];
- realType = ((unsigned int)currField->flags.flagBits >> 4) & 0x1F;
- if ( (signed int)realType < 0xA )
- {
- switch ( realType )
- {
- case 8u:
- memcpy(pDataContainer, pArrayStart, 4 * count);
- break;
- case 3u:
- if ( count )
- {
- count2 = count;
- while ( 1 )
- {
- position = *(_DWORD *)pArrayStart;
- if ( streamReader->m_endianSwapRequired )
- position = _byteswap_ulong(position);
- if ( position < 0 )
- {
- realPos = position & 0x7FFFFFFF;
- if ( realPos >= (unsigned int)(streamReader->m_imports.mpEnd - streamReader->m_imports.mpBegin) )
- {
- fb::Log::formattedLog(
- &`fb::StreamingPartitionReader::marshalReference'::`28'::location_macro_,
- "%s",
- &secret);
- if ( fb::Log::shouldBreak() )
- __debugbreak();
- }
- if ( realPos
- && realPos >= (unsigned int)(streamReader->m_imports.mpEnd - streamReader->m_imports.mpBegin) )
- eastl::AssertionFailure("vector::operator[] -- out of range");
- v12 = (int)streamReader->m_imports.mpBegin[realPos];
- if ( v12 )
- {
- pDataContainer->vfptr = (fb::ITypedObjectVtbl *)v12;
- }
- else
- {
- partition = streamReader->m_partition;
- pDataContainer->vfptr = (fb::ITypedObjectVtbl *)(partition ? (unsigned int)fb::InternalDatabaseDomain::getResolveRecord(
- streamReader->m_domain,
- "nopathavailable",
- &streamReader->m_importEntries[realPos].partitionGuid,
- &streamReader->m_importEntries[realPos].instanceGuid,
- partition->m_name,
- "No instance id available",
- &fb::DataContainer::c_TypeInfo,
- (fb::CtrRefBase *)pDataContainer) | 1 : 0);
- }
- }
- else
- {
- if ( position >= (unsigned int)(streamReader->m_containers.mpEnd - streamReader->m_containers.mpBegin) )
- {
- fb::Log::formattedLog(
- &`fb::StreamingPartitionReader::marshalReference'::`15'::location_macro_,
- "%s",
- &secret);
- if ( fb::Log::shouldBreak() )
- __debugbreak();
- }
- if ( position
- && position >= (unsigned int)(streamReader->m_containers.mpEnd - streamReader->m_containers.mpBegin) )
- eastl::AssertionFailure("vector::operator[] -- out of range");
- pDataContainer->vfptr = (fb::ITypedObjectVtbl *)&streamReader->m_containers.mpBegin[position]->vfptr;
- }
- sourceCursor += 4;
- pDataContainer = (fb::DataContainer *)((char *)pDataContainer + 4);
- --count2;
- if ( !count2 )
- break;
- pArrayStart = sourceCursor;
- }
- }
- break;
- case 2u:
- currType_2 = &streamReader->m_typeDescriptors[currField->fieldType];
- if ( (currType_2->typeFlags.flagBits & 0x4000) == 0x4000 )
- {
- memcpy(pDataContainer, sourceCursor, elementCount * currType_2->instanceSize);
- }
- else
- {
- vti = (fb::ValueTypeInfo *)*eastl::vector<fb::TypeInfo const *,eastl::fixed_vector_allocator<4,16,4,0,1,fb::eastl_arena_allocator>>::operator[](
- (eastl::vector<fb::TypeInfo const *,eastl::fixed_vector_allocator<4,16,4,0,1,fb::eastl_arena_allocator> > *)&streamReader->m_typeInfos.mpBegin,
- currField->fieldType);
- targetStride = currType_2->secondaryInstanceSize;
- if ( currType_2->secondaryInstanceSize )
- {
- sourceStride = currType_2->instanceSize;
- if ( elementCount )
- {
- counter2 = elementCount;
- do
- {
- secondaryInstanceSize = currType_2->secondaryInstanceSize;
- defaultValue = fb::ValueTypeInfo::getDefaultValue(vti);
- memcpy(pDataContainer, defaultValue, secondaryInstanceSize);
- fb::StreamingPartitionReader::marshalFields(
- streamReader,
- currType_2,
- sourceCursor,
- (char *)pDataContainer);
- sourceCursor += sourceStride;
- pDataContainer = (fb::DataContainer *)((char *)pDataContainer + targetStride);
- --counter2;
- }
- while ( counter2 );
- }
- }
- }
- break;
- case 7u:
- for ( ; count; --count )
- {
- v17 = (int)&streamReader->m_targetStringBase[*(_DWORD *)pArrayStart];
- pArrayStart = (char *)pArrayStart + 4;
- pDataContainer->vfptr = (fb::ITypedObjectVtbl *)v17;
- pDataContainer = (fb::DataContainer *)((char *)pDataContainer + 4);
- }
- break;
- default:
- fb::Log::formattedLog(
- &stru_39E0FD0,
- "C:\\monkey\\VeniceOpenBeta.Deploy.Server\\TnT\\Code\\Engine/Core/Serialization/StreamingPartition.cpp(1586) : Function \"%s\" (%s) is not implemented!",
- "fb::StreamingPartitionReader::marshalArrays",
- "C:\\monkey\\VeniceOpenBeta.Deploy.Server\\TnT\\Code\\Engine/Core/Serialization/StreamingPartition.cpp");
- if ( fb::Log::shouldBreak() )
- __debugbreak();
- break;
- }
- }
- else
- {
- elementSize = mapTypeCodeToSize[realType];
- if ( !elementSize )
- {
- fb::Log::formattedLog(&stru_39E0FE4, "%s", &secret);
- if ( fb::Log::shouldBreak() )
- __debugbreak();
- count = elementCount;
- }
- memcpy(pDataContainer, pArrayStart, count * (unsigned __int8)elementSize);
- }
- ++currIndex;
- ++i;
- if ( i >= streamReader->m_header.arrayCount )
- break;
- arrayIndex = i;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement