venerdì 11 novembre 2011

DLL Injection Windows 7 64bit

It seems that Dll injection in Windows 7 64bit could work using the same technique used in Windows XP.
The code I was using works in Windows 7 32bit but doesn't work in Windows 7 64 bit

My code is copied from sample found out in Internet and opens the process to inject a dll:

// Get a handle for the target process.
hProcess = OpenProcess(
        PROCESS_CREATE_THREAD     |   // For CreateRemoteThread
        PROCESS_VM_OPERATION      |   // For VirtualAllocEx/VirtualFreeEx
        PROCESS_VM_WRITE,             // For WriteProcessMemory
        FALSE, dwProcessId);

The code above doesn't work in Windows 7 64 bit. For windows 7 64 bit it should be:

// Get a handle for the target process.
hProcess = OpenProcess(
        PROCESS_ALL_ACCESS, //fix wor windows 7 64 bit
        FALSE, dwProcessId);

Nessun commento:

Posta un commento