Why this Logger source can not write offset noReload?

Posts 1–3 of 3 · Page 1 of 1
Why this Logger source can not write offset noReload?
#include <windows.h>
#include <stdio.h>
#include "Log.h"
#include "Pattern.h"

bool IsGameReadyForHook()
{
if( GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;

return false;
}

void SearchPatterns(void)
{
while (!IsGameReadyForHook()){
Sleep(50);
}
while(true){
dwSize = 0x400000;

//Example DWORD dwPlayerPointer = FindPattern((PBYTE)"\x00\x00\x00\x00\x00\x00\x00}; ", "x????xxxx", 1, true);

DWORD NoReload = FindPattern((DWORD)GetModuleHandleA("CShell.dll"), 0x9c0000, (PBYTE)\xD9\x98\xA4\x26\x00\x00","xxxx??");"xxx??? ?xx");
//-------------------------------------------------------------//

Writelog("#define NoReload 0x%X",NoReload);



Writelog("");
Writelog("//*************************Next log*********************************");



ExitProcess(0);
}
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if (dwReason==DLL_PROCESS_ATTACH)
{
logging(hDll);
MessageBox(0, "CHEAT ACTIVED", "By Yuzra45", MB_OK + MB_ICONASTERISK);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SearchPatterns, NULL, NULL, NULL);
}
return TRUE;
}


Credit Base MPGH.net
I use this, its a bit better version of pattern scanning (i think)
Note: Written in C#, convert to C++
Code:
public static unsafe uint FindReloadAnimRatio(uint CShell)
        {
            int[] Offsets = SequentedOffsetScanner((int)CShell, 0xFFFFFF, @"\x8B\x0D\xA4\xC5\xFC\x10\x53\x8D\x3C\xB1\xFF\x15\x54\xC4\x4D\x10\xD9\x5C\x24\x14\xD9\x44\x24\x14\x8B\x07\xD9\x98\x3C\x0C\x00\x00\x83\xC4\x04", "xx????xxxxxx????xxx?xxx?xxxx????xx?", 28);
            return (uint)Offsets[1];
        }
Code:
public static unsafe int[] SequentedOffsetScanner(int StartAddress, int Length, string bMask, string szMask, int OffsetPos)
        {
            List<int> FoundOffsets = new List<int>();

            //Creating Byte Array
            byte[] ByteMask = new byte[szMask.Length];
            int State = 0;
            for (int i = 0; i < bMask.Length; i++)
            {
                if (bMask[i] == 'x')
                {
                    ByteMask[State] = byte.Parse(bMask.Substring(i + 1, 2), System.Globalization.NumberStyles.HexNumber);
                    State++;
                }

            }

            //Searching Byte Pattern
            for (int i = 0; i < Length; i++)
            {
                bool Found = true;
                for (int j = 0; j < ByteMask.Length; j++)
                {
                    Found = Found && ((ByteMask[j] == *(byte*)(StartAddress + i + j)) || szMask[j] == '?');
                }
                if (Found)
                {
                    if (!FoundOffsets.Contains(*(int*)(StartAddress + i + OffsetPos)))
                        FoundOffsets.Add(*(int*)(StartAddress + i + OffsetPos));
                }
            }
            return FoundOffsets.ToArray();
        }
Thanks rabir007.

any source full ?
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us