HelpChanging Process Bytes

Posts 1–4 of 4 · Page 1 of 1
Changing Process Bytes
Hey
I got a addy example 0x123456 and i wanna change it to example \x01\0x02\x03
How can i make it? ;/
i tried
memcpy((void*)0x12131,Game,0x90, 1);
but i got a error :/
0x12345678 - 0x12 0x34 0x56 0x78
Reverse the order
0x78 0x56 0x34 0x12

Replace 0x by \x:
char addy[4] = "\x78\x56\x34\x12";
memcpy(theaddress, addy, 4);
I wanna make it for a process o.o
It's not dll

and i always got error
Another process? Then you need to use OpenProcess to get a process handle (if you're just writing memory, you only need write access; PROCESS_VM_WRITE, you'll also need the process ID of the process you want to write to) and then use the process handle with WriteProcessMemory.

Here's a little example:
Code:
foo()
{
    HWND hWnd;
    while((hWnd = FindWindow(null, "Untitled - Notepad")) == NULL) // Keep waiting for a window with 'Untitled - Notepad' to appear
        Sleep(100);

    DWORD pID;
    GetWindowThreadProcessId(hWnd, &pID); // Get the process ID from the window handle
    HANDLE pHandle = OpenProcess(PROCESS_VM_WRITE, FALSE, pID);
    if(pHandle == NULL)
        return; // Couldn't get a process handle.

    // Replace 0xDEADBEEF with the real address and replace the 5 with the real byte array size.
    BYTE[] data = { 0x00, 0x11, 0x55, 0x10, 0x42 };
    WriteProcessMemory(pHandle, (LPVOID)0xDEADBEEF, &data, 5, NULL);

    CloseHandle(pHandle); // Close the handle if we don't need it anymore.
}
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?