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 


[allocacted memory] what does it mean?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Fri Nov 25, 2016 3:56 pm    Post subject: [allocacted memory] what does it mean? Reply with quote

so something I never tried doing is changing the number after what is being allocated

alloc(mem,[NUMBER])

but now I tried and it didn't change anything. I tried having it be

alloc(mem,1000)

and also

alloc(mem,1)

and there was no change. everything worked. What does the number mean?


Last edited by rog9001 on Fri Nov 25, 2016 4:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Fri Nov 25, 2016 4:23 pm    Post subject: Reply with quote

the amount of bytes being allocated.
In the ram the minimum amount of bytes of 1 page is 0x1000 (it's 0x200 on disk) therefore wether you use 0x1000 or less will not matter, a new page is being allocated either way.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Fri Nov 25, 2016 4:24 pm    Post subject: Reply with quote

the number is important to other allocs in the same script
Code:

alloc(mem,4)
alloc(mem2,1)
alloc(mem3,4)


mem2 will be 4 bytes after mem and mem3 will be 5 bytes after mem)

if you write a 4 byte value to mem2 it will affect mem3, so make sure you allocate enough.

also, if you allocate 4097 bytes it will actually allocate 8192 bytes.

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Nov 25, 2016 4:29 pm    Post subject: Reply with quote

If only one alloc in the script there's no difference between those:
alloc(mem,1000)
alloc(mem,1)
alloc(mem,4096)
All of them will allocate only one page (usually 4096 bytes)



alloc(mem,4097)
alloc(mem,8192)
Those will allocate two pages




If two or more allocs in the script:

alloc(mem_first,128)
alloc(mem_second,512)

CE will allocate one page (128+512 will still fit in one page)
mem_second will be exactly 128 bytes below mem_first

_________________
Back to top
View user's profile Send private message MSN Messenger
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Fri Nov 25, 2016 4:32 pm    Post subject: Reply with quote

Thanks for all the replies. Now I get it. Very Happy
Back to top
View user's profile Send private message
Kavvman
Master Cheater
Reputation: 2

Joined: 17 Apr 2004
Posts: 316

PostPosted: Sat Nov 26, 2016 3:47 am    Post subject: Reply with quote

Dark Byte wrote:
the number is important to other allocs in the same script
Code:

alloc(mem,4)
alloc(mem2,1)
alloc(mem3,4)


mem2 will be 4 bytes after mem and mem3 will be 5 bytes after mem)

if you write a 4 byte value to mem2 it will affect mem3, so make sure you allocate enough.

also, if you allocate 4097 bytes it will actually allocate 8192 bytes.


That's really smart! Instead of wasting the whole page, it reuses it

_________________
...
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 Gamehacking 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