Advertisement
Guest User

StreamingPartitionReader::mapLayout

a guest
Jun 14th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.23 KB | None | 0 0
  1. void __thiscall fb::StreamingPartitionReader::mapLayout(fb::StreamingPartitionReader *this, fb::StreamingPartitionTypeDescriptor *td, fb::LayoutDescriptor *ld)
  2. {
  3.   fb::StreamingPartitionFieldDescriptor *startField; // eax@1
  4.   int fieldCount; // ebx@1
  5.   fb::LayoutDescriptorField *fieldArray; // esi@1
  6.   int startIndex; // ecx@1
  7.   fb::StreamingPartitionFieldDescriptor *currField; // edi@2
  8.   int fieldIndex; // eax@3
  9.   int count; // [sp+10h] [bp+8h]@2
  10.  
  11.   startField = &this->m_fieldDescriptors[td->layoutDescriptor];
  12.   fieldCount = ld->fieldCount;
  13.   fieldArray = ld->fields;
  14.   startIndex = 0;
  15.   if ( td->fieldCount )
  16.   {
  17.     currField = startField;
  18.     count = td->fieldCount;
  19.     do
  20.     {
  21.       fieldIndex = startIndex;
  22.       while ( fieldArray[fieldIndex].nameHash != currField->fieldNameHash )
  23.       {
  24.         ++fieldIndex;
  25.         if ( fieldIndex == fieldCount )
  26.           fieldIndex = 0;
  27.         if ( fieldIndex == startIndex )
  28.         {
  29.           currField->secondaryOffset = 0xFFFFFFFF;
  30.           goto LABEL_9;
  31.         }
  32.       }
  33.       currField->secondaryOffset = fieldArray[fieldIndex].offset;
  34.       startIndex = fieldIndex + 1;
  35.       if ( fieldIndex + 1 == fieldCount )
  36.         startIndex = 0;
  37. LABEL_9:
  38.       ++currField;
  39.       --count;
  40.     }
  41.     while ( count );
  42.   }
  43. }
  44.  
  45.  
  46.  
  47.  
  48.  
  49.         private static byte[] mapTypeCodeToAlignment = { 0x00, 0x04, 0x00, 0x04,
  50.                                                          0x04, 0x00, 0x04, 0x04,
  51.                                                          0x04, 0x04, 0x01, 0x01,
  52.                                                          0x01, 0x02, 0x02, 0x04,
  53.                                                          0x04, 0x08, 0x08, 0x04,
  54.                                                          0x08, 0x04, 0x01 };
  55.  
  56.         private static byte[] mapTypeCodeToSize = { 0x00, 0x04, 0x00, 0x04,
  57.                                                     0x04, 0x00, 0x00, 0x04,
  58.                                                     0x04, 0x00, 0x01, 0x01,
  59.                                                     0x01, 0x02, 0x02, 0x04,
  60.                                                     0x04, 0x08, 0x08, 0x04,
  61.                                                     0x08, 0x10, 0x14 };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement