Advertisement
Martymoose98

Load Banword List

Oct 19th, 2018
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. QWORD size;
  2. LPCVOID src;
  3. LPVOID dst;
  4. BYTE current_byte;
  5. PBYTE pData, lpDataEnd, lpDataStart;
  6. UINT dwDataEndOffset, dwDataStartOffset, length, dwWordByteLength, Index;
  7. UINT dwNextDataStartOffset = 4;
  8. DWORD i = 0;
  9.  
  10. if (*thisr8)
  11. size = (*(QWORD(*)(QWORD*, const char*))(0x1409291C0))(thisr8, szBlacklistName);
  12. else
  13. size = 0;
  14.  
  15. pThis->m_qwBufferSize = size;
  16.  
  17. if (size < 1)
  18. {
  19. (*(void(*)(BannedWordChecker*))(0x140606AC0))(pThis); //FreeBannedWordChecker
  20. return FALSE;
  21. }
  22.  
  23. src = (*(LPCVOID(*)(QWORD*, const char*))(0x140928FD0))(thisr8, szBlacklistName);
  24.  
  25. if (!src)
  26. {
  27. (*(void(*)(BannedWordChecker*))(0x140606AC0))(pThis); //FreeBannedWordChecker
  28. return FALSE;
  29. }
  30.  
  31. dst = (*(AllocHeapMemoryFn)(0x140920200))(size, (CHeapInstance**)0x14147B490);
  32.  
  33. pThis->m_pBuffer = dst;
  34.  
  35. if (!dst)
  36. {
  37. (*(void(*)(BannedWordChecker*))(0x140606AC0))(pThis); //FreeBannedWordChecker
  38. return FALSE;
  39. }
  40.  
  41. memcpy(dst, src, size);
  42.  
  43. pThis->m_dwWordCount = *(DWORD*)pThis->m_pBuffer;
  44.  
  45. if (pThis->m_dwWordCount < 1)
  46. {
  47. (*(void(*)(BannedWordChecker*))(0x140606AC0))(pThis); //FreeBannedWordChecker
  48. return FALSE;
  49. }
  50.  
  51. pThis->m_pEntries = (BannedWordChecker::WordEntry*)(*(AllocHeapMemoryFn)(0x140920200))(16 * pThis->m_dwWordCount, (CHeapInstance**)0x14147B490);
  52.  
  53. if (!pThis->m_pEntries)
  54. {
  55. (*(void(*)(BannedWordChecker*))(0x140606AC0))(pThis); //FreeBannedWordChecker
  56. return FALSE;
  57. }
  58.  
  59. if (pThis->m_dwWordCount > 0)
  60. {
  61. do
  62. {
  63. dwDataStartOffset = dwNextDataStartOffset;
  64. dwDataEndOffset = dwNextDataStartOffset + 4;
  65. lpDataStart = (BYTE*)pThis->m_pBuffer + dwDataStartOffset;
  66. lpDataEnd = (BYTE*)pThis->m_pBuffer + dwDataEndOffset;
  67. pThis->m_pEntries[i].dwLength = *(DWORD*)lpDataStart;
  68. dwWordByteLength = pThis->m_pEntries[i].dwLength * sizeof(WCHAR);
  69. dwNextDataStartOffset = dwWordByteLength + dwDataEndOffset;
  70.  
  71. if (dwWordByteLength)
  72. {
  73. pData = lpDataStart;
  74. Index = lpDataEnd - lpDataStart;
  75. length = dwWordByteLength;
  76. do
  77. {
  78. current_byte = (pData++)[Index];
  79. *(pData - 1) = current_byte - 19;
  80. } while (--length);
  81. }
  82. *((WCHAR*)&lpDataStart[dwWordByteLength]) = 0; //*((WCHAR*)(lpDataStart + dwWordByteLength)) = 0;
  83. pThis->m_pEntries[i++].lpszBannedWord = (LPWSTR)lpDataStart;
  84. } while (i < pThis->m_dwWordCount);
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement