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 


Can't write to a memory region

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

Joined: 28 Nov 2004
Posts: 44

PostPosted: Mon Oct 17, 2005 1:48 pm    Post subject: Can't write to a memory region Reply with quote

A code cave region I like to use in a game starts at 400300, it has trails of zeros for miles after it. I've been writing to that region with vb6 for a long time. I tried it with c# and I can't write to it anymore.

I know for a fact that it's not a c# problem. I restarted and closed out of my compiler and tried to write a 90 at 400300 with CE's memory viewer, and it quickly changed back to 00. But when I opened vb6 and wrote a 90 to it, I could suddenly write to that region, even when I closed out of vb6.

I'm thinking it has to do with protected memory regions. I guess vb6 overrides something. Any ideas?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Mon Oct 17, 2005 6:05 pm    Post subject: Reply with quote

Rightclick the address in the hex view and choose "make page wirtable"

Ce already changes the protection quickly when you change the assembler code there.

Also, 400300 is a bad idea for code injection. It's usually not executable (but you'll need to change that anyhow before writing to it)

If the game uses directx 9 just use virtualallocex to allocate a code cave as big as you like, it won't be running on windows me or earlier anyhow.

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
bitterbanana
Cheater
Reputation: 0

Joined: 28 Nov 2004
Posts: 44

PostPosted: Mon Oct 17, 2005 6:10 pm    Post subject: Reply with quote

thanks.

I've been using 400300 for a long time (the memory region list says Execute+Read), and I've had no problems with the apps I've written. Is there anyway I can make the area writiable without using cheat engine?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Mon Oct 17, 2005 6:15 pm    Post subject: Reply with quote

use virtualprotectex
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping


Last edited by Dark Byte on Mon Oct 17, 2005 6:17 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
bitterbanana
Cheater
Reputation: 0

Joined: 28 Nov 2004
Posts: 44

PostPosted: Mon Oct 17, 2005 6:17 pm    Post subject: Reply with quote

oh right. Thanks.
Back to top
View user's profile Send private message
bitterbanana
Cheater
Reputation: 0

Joined: 28 Nov 2004
Posts: 44

PostPosted: Mon Oct 17, 2005 8:45 pm    Post subject: Reply with quote

I've been trying to get this function to work, but it keeps returning null. Does virtualallocex actually change the page at the address to writable?

VirtualAllocEx(m_hProcess,0x400000,0x1000, MEM_COMMIT |MEM_RESERVED, PAGE_EXECUTE_READWRITE);

That didn't work.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Mon Oct 17, 2005 8:54 pm    Post subject: Reply with quote

Virtualallocex doesn't change the protection
virtualprotectex does

Virtualallocex allocates a region of memory, and it's usually best to give as base address NULL so windows can specify where to allocate the memory instead of you, and only do mem_commit.

to use virtualprotectex:
VirtualProtectAx(m_hProcess,0x400000,0x1000,PAGE_EXECUTE_READWRITE,NULL);

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
bitterbanana
Cheater
Reputation: 0

Joined: 28 Nov 2004
Posts: 44

PostPosted: Mon Oct 17, 2005 9:21 pm    Post subject: Reply with quote

it worked. thanks again dark byte. you always pull through. I love your work.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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