Making AoBs to modify 'var' values?
So I'm not too experienced in mucking about with making hacks etc, but I've dropped in and out of it for a decent period of time (a few years?), so my terminology will probably be wrong in places (or everywhere). This is mainly regarding BTD5
Recently came back and was wondering about whether the var declarations and assignments can have their values changed. I know that in Sothink and JPEXS ffdec, no bytecodes are shown for such areas as (when clicking outside of the array in ffdec)
public class Bloon extends Entity
{
private static const maxHealthByType:Vector. = Bloon.Vector.([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 200, 700, 4000]);
Firstly, for such sections (but without bytecodes visible), how would one go about modifying these sections of code?
Seconds, with the above example, if I edit the array in ffdec and save it then load, the health values in-game change as expected, however, when I try to change it via CE in the browser, I can find and modify the AoB but there is otherwise no effect. I often read about having to freeze the game during (?) or just after the loader to start using AoB hacks, but I don't think I have ever gotten such hacks to work...
Anyway, the original code for the array was (with extra either end):
; 64
getglobalscope
; 24 01
pushbyte 1
; 2a
dup
; 2a
dup
; 24 01
pushbyte 1
; 2a
dup
; 2a
dup
; 24 01
pushbyte 1
; 2a
dup
; 2a
dup
; 24 01
pushbyte 1
; 24 0a
pushbyte 10
; 25 c8 01
pushshort 200
; 25 bc 05
pushshort 700
; 25 a0 1f
pushshort 4000
; 56 0e
newarray 14
; 41 01
call 1
; 68 ed 17
What I mainly was interested in doing was changing the larger values back to 1, so what I did was replace pushbyte 10 (24 0a) with pushbyte 1 (24 01) and then replace the pushshorts with pushbyte 1 followed by nop: 25 c8 01 -> 24 01 02
Would that be a correct? I'm not sure whether this part is wrong, whether it can be changed (assuming it can since I can do it locally) or whether I am jut failing at applying the hack.
The codes I ended up with were:
64 24 01 2a 2a 24 01 2a 2a 24 01 2a 2a 24 01 24 0a 25 c8 01 25 bc 05 25 a0 1f 56 0e 41 01 68 ed 17
->
64 24 01 2a 2a 24 01 2a 2a 24 01 2a 2a 24 01 24 01 24 01 02 24 01 02 24 01 02 56 0e 41 01 68 ed 17
If someone could give me some pointers (or perhaps see if it works?), it would be much appreciated :)




