All pastes #2113316 Raw Edit

Stuff

public text v1 · immutable
#2113316 ·published 2012-02-08 20:43 UTC
rendered paste body
void *__thiscall zCView__CreateText(zCView *this, int a2, int a3, int a4)
{
  zCList *v4; // eax@1
  int v5; // ecx@1
  zCView *v6; // edi@1
  zCViewText *v7; // esi@2
  char v8; // zf@2
  int v9; // eax@5
  int v10; // ebp@5
  zCViewText *v11; // eax@7
  int v12; // edx@7
  int v13; // eax@13
  int v15; // [sp+10h] [bp-10h]@1
  void *v16; // [sp+2Ch] [bp+Ch]@7

  v6 = this;
  v4 = this->textLines.next;
  v5 = *(_DWORD *)&this->fontColor.r;
  v15 = v5;
  if ( v4 )
  {
    while ( 1 )
    {
      v7 = v4->data;
      v8 = v4->data->posx == a2;
      v4 = v4->next;
      if ( v8 )
      {
        if ( v7->posy == a3 )
          break;
      }
      if ( !v4 )
        goto LABEL_5;
    }
    v7->font = v6->font;
    v7->color = v5;
    v7->colored = 0;
    if ( a4 )
      std__basic_string_char_std__char_traits_char__std__allocator_char____assign(
        (int)&v7->text._allocater,
        a4 + 4,
        0,
        0xFFFFFFFFu);
    else
      std__basic_string_char_std__char_traits_char__std__allocator_char____assign(
        (int)&v7->text._allocater,
        0,
        0,
        0xFFFFFFFFu);
  }
  else
  {
LABEL_5:
    v10 = a4;
    v9 = *(_DWORD *)(a4 + 12);
    if ( v9 > v6->maxTextLength )
    {
      v6->maxTextLength = v9;
      std__basic_string_char_std__char_traits_char__std__allocator_char____assign(
        (int)&v6->textMaxLength._allocater,
        a4 + 4,
        0,
        0xFFFFFFFFu);
    }
    v11 = (zCViewText *)operator new(0x38u);
    v7 = v11;
    v16 = v11;
    if ( v11 )
    {
      LOBYTE(v11->text._allocater) = (_BYTE)v16;
      std__basic_string_char_std__char_traits_char__std__allocator_char_____Tidy((int)&v11->text._allocater, 0);
      v7->text._vtbl = (int)&zSTRING___vftable_;
      v7->posx = a2;
      v7->posy = a3;
      v7->_vtbl = (int)&zCViewText___vftable_;
      std__basic_string_char_std__char_traits_char__std__allocator_char____assign(
        (int)&v7->text._allocater,
        v10 + 4,
        0,
        0xFFFFFFFFu);
      v12 = v15;
      LODWORD(v7->timer) = 0;
      v7->timed = 0;
      v7->color = v15;
      v7->colored = 1;
      v7->font = 0;
      v7->inPrintWin = 0;
    }
    else
    {
      v7 = 0;
    }
    v7->font = v6->font;
    v13 = zCMemPoolBase__Alloc(&s_ListPool, v12);
    if ( v13 )
    {
      *(_DWORD *)(v13 + 4) = 0;
      *(_DWORD *)v13 = 0;
    }
    else
    {
      v13 = 0;
    }
    *(_DWORD *)v13 = v7;
    *(_DWORD *)(v13 + 4) = v6->textLines.next;
    v6->textLines.next = (zCList *)v13;
  }
  return v7;
}