Results 1 to 4 of 4
  1. #1
    Neokil's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    0

    WriteProcessMemory doesn't work

    Hey guys, Ive got a problem, I want to have noRecoil and noFlash so I opened the process like this
    Code:
    mw2_hwnd = FindWindow(NULL,L"AlterIWNet");
    GetWindowThreadProcessId(mw2_hwnd,&mw2_pid);
    mw2_process_w = OpenProcess(PROCESS_VM_WRITE,false,mw2_pid);
    then wrote the new hexcode like this
    Code:
    #define ADDR_FLASH	0x00457310
    BYTE NoFlash[6] = {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3};
    WriteProcessMemory(mw2_process_w,(PVOID)(ADDR_FLASH),&NoFlash,6,NULL);
    but in game nothing happens.
    What do I have to do?

    Greetings
    NEokil
    Last edited by Neokil; 05-23-2011 at 09:20 AM.

  2. #2
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by Neokil View Post
    Hey guys, Ive got a problem, I want to have noRecoil and noFlash so I opened the process like this
    Code:
    mw2_hwnd = FindWindow(NULL,L"AlterIWNet");
    GetWindowThreadProcessId(mw2_hwnd,&mw2_pid);
    mw2_process_w = OpenProcess(PROCESS_VM_WRITE,false,mw2_pid);
    then wrote the new hexcode like this
    Code:
    #define ADDR_FLASH	0x00457310
    BYTE NoFlash[6] = {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3};
    WriteProcessMemory(mw2_process_w,(PVOID)(ADDR_FLASH),&NoFlash,6,NULL);
    but in game nothing happens.
    What do I have to do?

    Greetings
    NEokil
    Code:
    mw2_hwnd = FindWindowA(NULL, "alterIWnet");
    If nothing happens then try to call the VirtualProtectEx(), maybe the address is write protected.
    Last edited by ♪~ ᕕ(ᐛ)ᕗ; 05-23-2011 at 09:55 AM.

  3. #3
    Neokil's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    0
    ok,
    I dont know why but when I tried to get the HANDLE just before writing it worked...

  4. #4
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Quote Originally Posted by Neokil View Post
    ok,
    I dont know why but when I tried to get the HANDLE just before writing it worked...
    What? Please explain better, also have you tried my solution too?