sobinist

ReinitDesignerVariables

Jun 17th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.88 KB | None | 0 0
  1. void __cdecl ReinitDesignerVariables(AI_tdstMind_ *mind)
  2. {
  3.   AI_tdstMind_ *mind_; // ebp@1
  4.   dsgMem *dsgMem; // eax@2
  5.   int memBuffer; // ecx@3
  6.   int memBufferInitial; // eax@3
  7.   struct_AIModel *aiModel; // edx@6
  8.   int offset; // esi@7
  9.   struct_dsgVarInfo *dsgVarInfo; // ecx@7
  10.   int type; // edi@7
  11.   int offset_; // ebx@8
  12.   unsigned int size; // eax@9
  13.   int memBufferInitial_; // [sp+10h] [bp-8h]@4
  14.   int memBuffer_; // [sp+14h] [bp-4h]@3
  15.   unsigned __int8 counter; // [sp+1Ch] [bp+4h]@6
  16.  
  17.   mind_ = mind;
  18.   if ( mind )
  19.   {
  20.     dsgMem = mind->dsgMem;
  21.     if ( dsgMem )
  22.     {
  23.       memBuffer = dsgMem->memBuffer;
  24.       memBufferInitial = dsgMem->memBufferInitial;
  25.       memBuffer_ = memBuffer;
  26.       memBufferInitial_ = memBufferInitial ? memBufferInitial : mind->aiModel->dsgVar->dsgMemBuffer;
  27.       aiModel = mind->aiModel;
  28.       counter = 0;
  29.       if ( LOBYTE(aiModel->dsgVar->amountOfInfos) )
  30.       {
  31.         do
  32.         {
  33.           offset = counter;
  34.           dsgVarInfo = (*mind_->dsgMem->dsgVar)->dsgVarInfo;
  35.           type = dsgVarInfo[offset].type;
  36.           if ( dsgVarInfo[offset].initType )
  37.           {
  38.             offset_ = dsgVarInfo[offset].offset;// offset = offset in membuffer
  39.             if ( fn_getDsgVarType(type) == 41 )
  40.             {
  41.               size = fn_ulSizeOfDsgVar(
  42.                        type,
  43.                        *(_BYTE *)((*mind_->dsgMem->dsgVar)->dsgVarInfo[offset].offset
  44.                                 + mind_->aiModel->dsgVar->dsgMemBuffer
  45.                                 + 4));
  46.             }
  47.             else
  48.             {
  49.               size = fn_ulSizeOfDsgVar(type, 0);
  50.             }
  51.             qmemcpy((void *)(offset_ + memBuffer_), (const void *)(offset_ + memBufferInitial_), size);
  52.           }
  53.           ++counter;
  54.         }
  55.         while ( counter < LOBYTE(mind_->aiModel->dsgVar->amountOfInfos) );
  56.       }
  57.     }
  58.   }
  59. }
Add Comment
Please, Sign In to add comment