| View previous topic :: View next topic |
| Author |
Message |
mStorm Expert Cheater
Reputation: 0
Joined: 21 Feb 2009 Posts: 107
|
Posted: Sun Mar 22, 2009 10:39 pm Post subject: Solved: Access violation writing opcodes to cave (injected) |
|
|
I'm getting an access violation writing Opcodes while being injected...
Any ideas?
heres my code:
| Code: |
VirtualProtect((LPVOID) 0x00404823,0xB, PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy((void*)0x00404823, &code2, sizeof(code2));
memcpy((void*)0x00404828, &code3, sizeof(code3));
memcpy((void*)0x0040482E, &code4, sizeof(code4));
|
I'm getting access violating writing to address 0x00404823. I can modify it via CheatEngine. I am injected and don't understand why this wont works
Last edited by mStorm on Mon Mar 23, 2009 10:52 am; edited 2 times in total |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sun Mar 22, 2009 10:47 pm Post subject: |
|
|
Check that VirtualProtect succeeded?
_________________
|
|
| Back to top |
|
 |
mStorm Expert Cheater
Reputation: 0
Joined: 21 Feb 2009 Posts: 107
|
Posted: Mon Mar 23, 2009 10:51 am Post subject: |
|
|
Eh, seems it has ironed out itself. I guess I implemented VirtualProtect, compiled, but didnt move the dll into my system directory.
blarg.
|
|
| Back to top |
|
 |
iNoobHacker Advanced Cheater
Reputation: 0
Joined: 05 Nov 2006 Posts: 99
|
Posted: Mon Mar 23, 2009 10:57 am Post subject: |
|
|
You only protected 11 Bytes (0x0B), however, you write more than that.
You write to the beginning of the address 0x0040482E, but even if you write only 2 bytes the last byte will be written to 0x0040482F which is still protected, simply change the size (0x0B) to 0x0B + sizeof(code4).
If you would've debugged it, you would've seen that it throws the exception at the last memcpy call.
_________________
"Two things are infinite: the universe and human stupidity, but I'm still not sure about the first one." |
|
| Back to top |
|
 |
mStorm Expert Cheater
Reputation: 0
Joined: 21 Feb 2009 Posts: 107
|
Posted: Mon Mar 23, 2009 12:06 pm Post subject: |
|
|
0x0040482E - 0x00404823 = 0xB?
Wouldn't that be the region size that i'm writing?
Edit: eh nevermind, it's 12 bytes, 0xC
my logic was jacked.
|
|
| Back to top |
|
 |
|