| View previous topic :: View next topic |
| Author |
Message |
mStorm Expert Cheater
Reputation: 0
Joined: 21 Feb 2009 Posts: 107
|
Posted: Fri Mar 13, 2009 2:35 pm Post subject: Invalid access to memory location. |
|
|
I'm trying to use WriteProcessMemory, I know I'm using it correctly, but I get a failed result and "Invalid access to memory location." error.
I have set the privaladges via:
| Code: | bool EnableSEPriv()
{
HANDLE hToken;
LUID luID;
TOKEN_PRIVILEGES tkp;
if(!OpenProcessToken(GetCurrentProcess(), (TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY), &hToken))
return false;
if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luID))
return false;
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = luID;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof(tkp), NULL, NULL);
CloseHandle(hToken);
return true;
} |
but it still will not let me write to the memory location.
Any ideas?
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Fri Mar 13, 2009 2:40 pm Post subject: |
|
|
| Let's see some code ?
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Fri Mar 13, 2009 2:50 pm Post subject: |
|
|
try changing the memory protection of the memory you wish to write to using VirtualProtect(Ex) and please refer to this page for further info..
http://msdn.microsoft.com/en-us/library/aa366786(VS.85).aspx
regards BanMe
|
|
| Back to top |
|
 |
crayzbeef Expert Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 101
|
Posted: Fri Mar 13, 2009 5:13 pm Post subject: |
|
|
*Mind reads the writeprocessmemory code where the error is*
Yeah. if you're going to ask a question post the fucking code in question.
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Fri Mar 13, 2009 6:54 pm Post subject: |
|
|
| crayzbeef wrote: | *Mind reads the writeprocessmemory code where the error is*
Yeah. if you're going to ask a question post the fucking code in question. |
calm down man.
_________________
|
|
| Back to top |
|
 |
|