Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Solved: Access violation writing opcodes to cave (injected)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mStorm
Expert Cheater
Reputation: 0

Joined: 21 Feb 2009
Posts: 107

PostPosted: Sun Mar 22, 2009 10:39 pm    Post subject: Solved: Access violation writing opcodes to cave (injected) Reply with quote

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 Sad


Last edited by mStorm on Mon Mar 23, 2009 10:52 am; edited 2 times in total
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Mar 22, 2009 10:47 pm    Post subject: Reply with quote

Check that VirtualProtect succeeded?
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
mStorm
Expert Cheater
Reputation: 0

Joined: 21 Feb 2009
Posts: 107

PostPosted: Mon Mar 23, 2009 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message
iNoobHacker
Advanced Cheater
Reputation: 0

Joined: 05 Nov 2006
Posts: 99

PostPosted: Mon Mar 23, 2009 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message
mStorm
Expert Cheater
Reputation: 0

Joined: 21 Feb 2009
Posts: 107

PostPosted: Mon Mar 23, 2009 12:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites