View previous topic :: View next topic |
Author |
Message |
BanCheese Cheater Reputation: 0
Joined: 22 Oct 2014 Posts: 49
|
Posted: Thu Nov 13, 2014 7:31 pm Post subject: Quick question about alloc() |
|
|
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 |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Thu Nov 13, 2014 8:20 pm Post subject: |
|
|
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 |
|
|
BanCheese Cheater Reputation: 0
Joined: 22 Oct 2014 Posts: 49
|
Posted: Thu Nov 13, 2014 8:21 pm Post subject: |
|
|
Great, thanks!
_________________
A guy who likes memory hacking. |
|
Back to top |
|
|
Nemexia55 Expert Cheater Reputation: 0
Joined: 28 Jan 2014 Posts: 160
|
Posted: Sun Jun 21, 2015 1:25 am Post subject: |
|
|
in this code: alloc(newmem,$1000)
what does $1000 mean?
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Jun 21, 2015 2:08 am Post subject: |
|
|
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 |
|
|
Nemexia55 Expert Cheater Reputation: 0
Joined: 28 Jan 2014 Posts: 160
|
Posted: Sun Jun 21, 2015 9:09 am Post subject: i |
|
|
wow, i really appreciate you for your help!
so usefull,
i wish i knew these, i really want to learn AA
_________________
|
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Sun Jun 21, 2015 9:21 am Post subject: |
|
|
learn assembly, learn coding and using windows API. This should start making sense to you then
_________________
|
|
Back to top |
|
|
Nemexia55 Expert Cheater Reputation: 0
Joined: 28 Jan 2014 Posts: 160
|
Posted: Sun Jun 21, 2015 9:45 am Post subject: |
|
|
so there is lots of things to do, ill start tomorrow.
wait why tomorrow, lets start now.
Thank you very much.
_________________
|
|
Back to top |
|
|
|