Info - Technical-er Explanation of Script Stack Underflow (SSU) By Nick007J
Panduan
/
Info - Technical-er Explanation of Script Stack Underflow (SSU) By Nick007J
Diperbarui 6 months ago oleh Nick007J

alright not sure if there is decent illustration, so here it is again. so the way it works is that there is underflow for script stack pointer and stack index is 65535, I guess that part is understandable

stacks for each script are always in the same place in the memory, so the value it fetches is always at the same place (+65535 * 4 bytes) as well, only variable thing there is which script ID it is internally (I think current SSU manipulates it to be 68th or sth). by insane pure luck it happens so that for a range of script IDs this value at this offset is actually manipulatable script variable space

now, why it happens so that for 68th it is shopkeeper variable is just pure luck, there is no explanation, there is no logic except for some magic that even R* wouldn't know, this is some strange algorithm that was used in codewarrior compiler used by them that nobody remembers by now (https://en.wikipedia.org/wiki/CodeWarrior)

the question why is that some other variables can be used is more reasonable

so the array of scripts is placed sequentially in memory: https://github.com/halpz/re3/blob/miami/src/control/Script.cpp#L57

size of each struct is 136: https://github.com/halpz/re3/blob/miami/src/control/Script.cpp#L232

script array is in that struct: https://github.com/halpz/re3/blob/miami/src/control/Script.h#L284

so when you use a script with ID fewer by 1, it means the index of variable you hit is fewer by (136/4=34), and generally the script variable IDs available to you is the ID of shopkeeper + 34*i where i is the the distance between scripts in array that you choose (or pratically, the amount of pizza boy dupes you perform)

so when you find a table of variables (I think it is somewhere), you'll see that indices of these variables are differing by 34

I hope this is clear; again, why it happens to be this specific range of variables that include that shopkeeper one, it's pure luck and coincidence that only happened because R* used that compiler that for some reason used quite interesting algorithm of allocating memory for bss section

Statistik Game
Pengikut
1,765
Jalanan
3,972
Pemain
561
Berita Terbaru
Y-Sens Fix is now officially allowed in speedruns

VC Enthusiasts, good news!

The VC Mod Team has decided to allow users to access a y-sens fix for mouse issues. This can be used legally in speedruns from today onwards, with only one rule.

This script w

1 year ago
Threads Terbaru
Diposting 2 years ago
0 balasan
Diposting 3 years ago
36 balasan
Diposting 3 years ago
0 balasan
Diposting 4 years ago
0 balasan
Diposting 4 months ago
2 balasan