Results 1 to 3 of 3
  1. #1
    SpraX's Avatar
    Join Date
    Dec 2015
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    1

    Memory Not Getting Edited *sad face*

    Code:
    #include "stdafx.h"
    #include <windows.h>
    #include <iostream>
    using namespace std;
    
    
    HWND hGame = ::FindWindow((LPCWSTR)"Tom Clancy's The DivisionClass", (LPCWSTR)"Tom Clancy's The Division");
    
    bool unlimitedAmmo = false;
    
    void FunProc()
    {	
    	int newValue = 255;
    
    	DWORD pID;
    	GetWindowThreadProcessId(hGame, &pID);
    	HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
    
    
    	if (WriteProcessMemory(hProc, (LPVOID) 0x16D578B5E48 , &newValue, (DWORD)sizeof(newValue), NULL )){
    		MessageBoxA(0, "Wrote To Memory!!!", 0, 0);
    		CloseHandle(hGame);
    		FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    	}
    	else {
    		MessageBoxA(0, "Failed To Write To Memory", 0, 0);
    		CloseHandle(hGame);
    		FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    	}
    
    }
    
    BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
    {
    	if (fdwReason == DLL_PROCESS_ATTACH)
    	{
    		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)FunProc, NULL, NULL, NULL);
    		MessageBoxA(0, "Dll Injected!!!", 0, 0);
    	}
    	else if (fdwReason == DLL_PROCESS_DETACH) {
    		MessageBoxA(0, "Dll Removed!!!", 0, 0);
    	}
    	return 1;
    }
    the adress that i have added there is the base address for my classic ak ammo in The Division , but it cant edit it why??!?! , the dll is indeed injected but box that says failed to write to memory pops up, what am i doing wrong?

  2. #2
    SpraX's Avatar
    Join Date
    Dec 2015
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    1
    Solved

    Dll Now Looks Like This (this changes recoil in The Division)
    Code:
    #include <windows.h>
    #include <iostream>
    using namespace std;
    
    void FunProc()
    {	
    	HWND hGame = ::FindWindowW(L"Tom Clancy's The DivisionClass", L"Tom Clancy's The Division");
    
    	int newValue = 0;
    	DWORD pID;
    	GetWindowThreadProcessId(hGame, &pID);
    	HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
    
    	if (hGame == 0) {
    		MessageBoxA(0, "Cant Find The Window", 0, 0);
    		FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    	}
    	else {
    		if (WriteProcessMemory(hProc, (LPVOID)0x7FF69A6C2450, &newValue, (DWORD)sizeof(newValue), NULL)) {
    			MessageBoxA(0, "Wrote To Memory!!!", 0, 0);
    			FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    		}
    		else {
    			MessageBoxA(0, "Failed To Write To Memory", 0, 0);
    			FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    		}
    	}
    
    	FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
    	
    
    }
    
    BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
    {
    	if (fdwReason == DLL_PROCESS_ATTACH)
    	{
    		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)FunProc, NULL, NULL, NULL);
    		MessageBoxA(0, "Dll Injected!!!", 0, 0);
    	}
    	else if (fdwReason == DLL_PROCESS_DETACH) {
    		MessageBoxA(0, "Dll Removed!!!", 0, 0);
    	}
    	return 1;
    }
    Last edited by SpraX; 03-21-2016 at 03:20 PM. Reason: Solved The F Puzzel =P

  3. #3
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    No need to use WriteProcessMemory. You can directly edit the memory if your dll is injected into the target process.

Similar Threads

  1. [Help] Not getting full memory read in output buffer(driver)
    By azzclown in forum C++/C Programming
    Replies: 4
    Last Post: 04-21-2015, 09:26 PM
  2. Sad Face, Cuz Cant Get Vip
    By DStrike00 in forum CrossFire Discussions
    Replies: 7
    Last Post: 04-15-2011, 09:21 PM
  3. HOW TO NOt GET BANNED
    By icemaster377 in forum WarRock - International Hacks
    Replies: 34
    Last Post: 02-23-2008, 09:19 PM
  4. Not getting all your accs banned
    By xxomidxx in forum WarRock - International Hacks
    Replies: 11
    Last Post: 01-22-2008, 08:35 AM
  5. Do Not Get Scammed Beware
    By Jeckels in forum WarRock - International Hacks
    Replies: 30
    Last Post: 07-07-2007, 03:36 AM