deadlymans
Normal Üye
- Katılım
- 14 Ara 2019
- Mesajlar
- 18
- Beğeniler
- 3
Bu kullanıcıyla herhangi bir iş veya ticaret yapmak istiyorsanız, forumdan uzaklaştırıldığını sakın unutmayın.
Merhaba Yazmış olduğum kodda neden baseAdress Ceheat egine de belirlediğim adresle eşleşmiyor offset değerlerini girdiğimde de dolayısıyla hep yanlış değerler veriyor kodu incelerseniz sevinirim.
C++:
#include<Windows.h>
#include<iostream>
#include<vector>
#include <TlHelp32.h>
#include <tchar.h>
using namespace std;
DWORD dwGetModuleBaseAddress(TCHAR* lpszModuleName, DWORD pid) {
DWORD dwModuleBaseAddress = 0;
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
MODULEENTRY32 ModuleEntry32 = { 0 };
ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnapshot, &ModuleEntry32))
{
do
{
if (_tcscmp(ModuleEntry32.szModule, lpszModuleName) == 0)
{
{
dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;
}
}
} while (Module32Next(hSnapshot, &ModuleEntry32));
}
CloseHandle(hSnapshot);
return dwModuleBaseAddress;
}
int main()
{
DWORD pid;
DWORD off1, off2, off3;
DWORD baseAdress;
DWORD mermiadress;
int newmermi = 426;
int currentmermi;
char modulename[] = "server.dll";
HWND hGameWindow;
HANDLE pHandle;
//GET HANDLESS
hGameWindow = FindWindow(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hGameWindow, &pid);
pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
//GET CLİDENT BASE ADDRESS
DWORD clientbase = dwGetModuleBaseAddress(_T(modulename), pid);
ReadProcessMemory(pHandle, (LPCVOID)(clientbase + 0x8ACDAC), &baseAdress, sizeof(baseAdress), NULL);
cout << "Base Adress =" << std::hex << baseAdress << std::endl;
ReadProcessMemory(pHandle, (LPCVOID)(baseAdress + 0x1DC), &off1, sizeof(off1), NULL);
cout << "Ofset 1 =" << std::hex << off1 << std::endl;
ReadProcessMemory(pHandle, (LPCVOID)(off1 + 0x0), &off2, sizeof(off2), NULL);
cout << "Ofset 2 =" << std::hex << off2 << std::endl;
ReadProcessMemory(pHandle, (LPCVOID)(off2 + 0x98C), &off3, sizeof(off3), NULL);
cout << "Ofset 3 =" << std::hex << off3 << std::endl;
mermiadress = off3;
cout << "Mermi Adresi:" << std::hex << mermiadress << std::endl;
ReadProcessMemory(pHandle, (LPCVOID)(mermiadress), ¤tmermi, 4, NULL);
cout << "Mermi :" << mermiadress << std::endl;
//WriteProcessMemory(pHandle, (LPVOID)(mermiadress), &newmermi, sizeof(newmermi), NULL);
//ReadProcessMemory(pHandle, (LPCVOID)(mermiadress), ¤tmermi, sizeof(currentmermi), 0);
//cout << "Mermi :" << mermiadress << std::endl;