URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       Hack Community
  HTML https://roshacks.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: Codes
       *****************************************************
       #Post#: 727--------------------------------------------------
       [C++] Find Pattern + Patched Hook
   DIR By: pipo1337
       Date: June 5, 2018, 7:40 am
       ---------------------------------------------------------
       Credit: chess123virus3
       Find Pattern:
       --- Code ---
       DWORD FindPattern(DWORD dwStart, DWORD dwLen, BYTE* pszPatt,
       char pszMask[])
       {
       unsigned int i = NULL;
       int iLen = strlen(pszMask) - 1;
       for (DWORD dwRet = dwStart; dwRet < dwStart + dwLen; dwRet++)
       {
       if (*(BYTE*)dwRet == pszPatt[i] || pszMask[i] == '?')
       {
       if (pszMask[i + 1] == '\0') return(dwRet - iLen); i++;
       }
       else i = NULL;
       } return NULL;
       }
       --- End Code ---
       Patched Hook:
       --- Code ---
       void LoLHook(void *adress, void *bytes, int size)
       {
       DWORD dwProtect;
       VirtualProtect((void*)adress, size, PAGE_EXECUTE_READWRITE,
       &dwProtect);
       memcpy((void *)adress, (PBYTE)bytes, size);
       VirtualProtect((void*)adress, size, dwProtect, &dwProtect);
       }
       --- End Code ---
       Void Function:
       --- Code ---
       void NoRecoil()
       {
       DWORD
       Sleep(50);
       DwStartAddress = (DWORD)GetModuleHandle("ros.exe");
       do {
       DwStartAddress = (DWORD)GetModuleHandle("ros.exe");
       Sleep(50);
       } while (!DwStartAddress);
       DwSize = 0xF0000000;
       recoil = FindPattern(DwStartAddress, DwSize,
       (PBYTE)"\xF2\x0F\x5E\x05\x00\x00\x00\x00\x83\xEC\x08\xF2\x0F\x11\x04\x24",
       (PCHAR)"xxxx????xxxxxxxx");
       LoLHook((void*)(recoil), (int*)(PBYTE)"\xF2\x0F\x5E\x0D", 4);
       }
       --- End Code ---
       *****************************************************
       Page 1 of 1