#include <Windows.h>
#include <iostream>
bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
	for (; *szMask; ++szMask, ++pData, ++bMask)
	if (*szMask == 'x' && *pData != *bMask)
		return 0;
	return (*szMask) == NULL;
}

DWORD FindPattern(DWORD dwAddress, DWORD dwLen, BYTE *bMask, char * szMask)
{
	for (DWORD i = 0; i<dwLen; i++)
	if (bCompare((BYTE*)(dwAddress + i), bMask, szMask))
		return (DWORD)(dwAddress + i);
	return 0;
}

DWORD SigScan(const char *AoB, char *Mask) {
	return FindPattern((DWORD)GetModuleHandleA("RCCService.exe"), 0xF00000, (PBYTE)AoB, Mask);
}


typedef LONG (NTAPI *NtSuspendProcess)(IN HANDLE ProcessHandle);
typedef LONG (NTAPI *NtResumeProcess)(IN HANDLE ProcessHandle);
void SuspendProc()
{
    HANDLE processHandle = GetCurrentProcess();

    NtSuspendProcess pfnNtSuspendProcess = (NtSuspendProcess)GetProcAddress(
        GetModuleHandle(TEXT("ntdll")), "NtSuspendProcess");

    pfnNtSuspendProcess(processHandle);
}
void ResumeProc()
{
    HANDLE processHandle = GetCurrentProcess();

    NtResumeProcess pfnNtResumeProcess = (NtResumeProcess)GetProcAddress(
        GetModuleHandle(TEXT("ntdll")), "NtResumeProcess");

    pfnNtResumeProcess(processHandle);
}