Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 19th, 2010 | Syntax: C++ | Size: 2.02 KB | Hits: 69 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. int __stdcall CEGUI__String__encode(LPCSTR lpMultiByteStr, int a2, int a3, int a4)
  2. {
  3.   unsigned int v4; // eax@1
  4.   WCHAR *v5; // edi@1
  5.   int v6; // esi@1
  6.  
  7.   v6 = MultiByteToWideChar(0, 0, lpMultiByteStr, -1, 0, 0);
  8.   v5 = (WCHAR *)operator new__(2 * v6);
  9.   MultiByteToWideChar(0, 0, lpMultiByteStr, -1, v5, v6);
  10.   v4 = 0;
  11.   if ( v6 )
  12.   {
  13.     do
  14.     {
  15.       *(_DWORD *)(a2 + 4 * v4) = v5[v4];
  16.       ++v4;
  17.     }
  18.     while ( v4 < v6 );
  19.   }
  20.   *(_DWORD *)(a2 + 4 * v6 - 4) = 0;
  21.   operator delete__(v5);
  22.   return v6 - 1;
  23. }
  24.  
  25. void *__thiscall CEGUI__String__assign(void *this, LPCSTR lpMultiByteStr, int a3)
  26. {
  27.   void *v3; // esi@1
  28.   int v4; // eax@4
  29.   int v5; // edi@4
  30.   int v6; // ecx@5
  31.   unsigned __int8 v7; // cf@7
  32.   unsigned __int8 v8; // zf@7
  33.   int v9; // eax@8
  34.   char v11; // [sp+4h] [bp-54h]@2
  35.   char v12; // [sp+8h] [bp-50h]@2
  36.   int (__thiscall **v13)(void *, char); // [sp+20h] [bp-38h]@2
  37.   char v14; // [sp+2Ch] [bp-2Ch]@2
  38.   int v15; // [sp+50h] [bp-8h]@2
  39.  
  40.   v3 = this;
  41.   if ( a3 == CEGUI__String__npos )
  42.   {
  43.     std__basic_string_char_std__char_traits_char__std__allocator_char____basic_string_char_std__char_traits_char__std__allocator_char__(&v12);
  44.     v15 = 0;
  45.     exception__exception(&v13);
  46.     LOBYTE(v15) = 1;
  47.     v13 = &off_100C52D0;
  48.     std__basic_string_char_std__char_traits_char__std__allocator_char____basic_string_char_std__char_traits_char__std__allocator_char__(
  49.       &v14,
  50.       &v11);
  51.     LOBYTE(v15) = 0;
  52.     v13 = &off_100C52D8;
  53.     CxxThrowException(&v13, &unk_100E9548);
  54.   }
  55.   v5 = CEGUI__String__encoded_size(lpMultiByteStr, a3);
  56.   CEGUI__String__grow(v5);
  57.   v4 = *((_DWORD *)v3 + 1);
  58.   if ( (unsigned int)v4 <= 0x20 )
  59.     v6 = (int)((char *)v3 + 20);
  60.   else
  61.     v6 = *((_DWORD *)v3 + 37);
  62.   CEGUI__String__encode(lpMultiByteStr, v6, v4, a3);
  63.   v7 = *((_DWORD *)v3 + 1) < 0x20u;
  64.   v8 = *((_DWORD *)v3 + 1) == 32;
  65.   *(_DWORD *)v3 = v5;
  66.   if ( v7 | v8 )
  67.     v9 = (int)((char *)v3 + 20);
  68.   else
  69.     v9 = *((_DWORD *)v3 + 37);
  70.   *(_DWORD *)(v9 + 4 * v5) = 0;
  71.   return v3;
  72. }