Pushing an integer to the stack
Hi
Is it possible to push an integer to the stack instead of getting a property from the current scope?
Here is the code:
and I would like to do something like this:
Code:
pushint *a large number*
How can I check the constant pool if there is any large value? Or is it possible to add a number to the constant pool?
Re: Pushing an integer to the stack
Are we talking about hacking with flasm or is it AS3, because with flasm you don't need the constant pool?
Re: Pushing an integer to the stack
We are talking about AS3 (because if we were talking about AS2 (AS1?) we wouldn't need the constant pool.) :D
An other question: What is the maximum value that can be pushed with pushshort?
Re: Pushing an integer to the stack
The maximum size of an short can vary as the size increases. Short values can have a different hex size depending on the original value.
Code:
ff 7f - 16.383
ff ff 7f - 2.097.151
ff ff ff 7f - 268.435.455
To find a higher value that is in the pool you can either use RJTs decompiler (viewtopic.php?f=46&t=3967) and look at the constant pool or use sothink swf decompiler and search in raw mode for a higher value.
Re: Pushing an integer to the stack
RJT's decomp doesn't work though...
Re: Pushing an integer to the stack
It works fine for me and always did, i don't know what the problem is others are having.
Re: Pushing an integer to the stack
What link did you download it from?
Because there is one version uploaded on the forum and 2 other mirros
Re: Pushing an integer to the stack
Quote:
Originally Posted by MartinRistov
Because there is one version uploaded on the forum and 2 other mirros
Nope, both mirrors are dead so there is only one version! And this version works fine for me!
Re: Pushing an integer to the stack
Quote:
Originally Posted by ZuckeR
The maximum size of an short can vary as the size increases. Short values can have a different hex size depending on the original value ...
Then, I think pushshort would be a good solution for this problem.
Is it possible to replace a shorter statement with a longer? :scratch:
I mean replace this:
Code:
25 0A
//pushshort 10
to a bigger number like this:
Code:
25 E8 07
//pushshort 1000
Re: Pushing an integer to the stack
Changing 25 0A to 25 E8 07 obviously adds one byte which is enough to corrupt the SWF. You can't change a short value from a one to two bytes. The other way you could do it with nop which would then fill the rest of the unneeded bytes. Sometimes there can be ways to still do it by changing more code or deleting some but that is more advanced and different from game to game.