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 


Quick question about alloc()

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

Joined: 22 Oct 2014
Posts: 49

PostPosted: Thu Nov 13, 2014 7:31 pm    Post subject: Quick question about alloc() Reply with quote

When you alloc memory, does it ensure that the memory is all 00 bytes? Thanks!

EDIT: If not, is there a way to write 00s to 4 bytes when I first alloc?

_________________
A guy who likes memory hacking.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Nov 13, 2014 8:20 pm    Post subject: Reply with quote

it is 0'ed by default
_________________
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
BanCheese
Cheater
Reputation: 0

Joined: 22 Oct 2014
Posts: 49

PostPosted: Thu Nov 13, 2014 8:21 pm    Post subject: Reply with quote

Great, thanks!
_________________
A guy who likes memory hacking.
Back to top
View user's profile Send private message
Nemexia55
Expert Cheater
Reputation: 0

Joined: 28 Jan 2014
Posts: 160

PostPosted: Sun Jun 21, 2015 1:25 am    Post subject: Reply with quote

in this code: alloc(newmem,$1000)
what does $1000 mean?

_________________
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Sun Jun 21, 2015 2:08 am    Post subject: Reply with quote

Nemexia55 wrote:
in this code: alloc(newmem,$1000)
what does $1000 mean?


In AA scripts, almost all numeric values are treated as hexadecimal values.




Of course, there are exceptions:

alloc(allocname,sizeinbytes) - sizeinbytes by default is treated as decimal. By using $ char, we inform CE that value is hexadecimal

alloc(allocname, sizeinbytes, preferedregion ) - sizeinbytes - same as above,
preferedregion is an address, and it is hexadecimal value (or modulename+offset, or symbolname+offset, offsets are hexadecimal)


mov eax,10 - will set eax to 16 decimal
mov eax,$10 - will set eax to 16 decimal
mov eax,#10 - will set eax to 10 decimal
alloc(newmem,$1000) - allocates 4096 bytes
alloc(newmem,1000) - allocates 1000 bytes (kind of)




Back to alloc:

alloc(newmem,4096) - it allocates a region of memory with read,write and execute access, and its size will be 4096

interesting fact, alloc(newmem,256) will also allocate 4096 bytes. (as the smallest chunk you can alloc is 4096 bytes). Why we use sizeinbytes smaller than 4096? Because CE can stack few alloc in one:


alloc(placeforcode,256)
alloc(placeforvariables,16)
alloc(placeforarraywewanttouse,64)


CE will alloc 4k block, enables the word placeforcode to be used as an address, for example it will be 01F00000, placeforvariables will be 01F00100, and placeforarraywewanttouse will be 01F00110

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

Joined: 28 Jan 2014
Posts: 160

PostPosted: Sun Jun 21, 2015 9:09 am    Post subject: i Reply with quote

wow, i really appreciate you for your help!
so usefull,
i wish i knew these, i really want to learn AA Sad

_________________
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 42

Joined: 09 Nov 2005
Posts: 2672

PostPosted: Sun Jun 21, 2015 9:21 am    Post subject: Reply with quote

learn assembly, learn coding and using windows API. This should start making sense to you then
_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
Nemexia55
Expert Cheater
Reputation: 0

Joined: 28 Jan 2014
Posts: 160

PostPosted: Sun Jun 21, 2015 9:45 am    Post subject: Reply with quote

so there is lots of things to do, ill start tomorrow.
wait why tomorrow, lets start now.

Thank you very much.

_________________
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