Internal variable format

STOS programming section.
darklight
Posts: 3
Joined: 31 May 2020 13:46

Internal variable format

Post by darklight »

Hey all,

If I were running a STOS program, and I can peek at memory using say Steem's debug memory browser, how could I locate & view the value of say a integer / number variable?

From the STOS manual:
Note that any numbers you type into STOS Basic are converted into a special
internal format. When you list your program, these numbers are expanded back
into their original form.
So it sounds like numbers are compressed I guess to save space. Is the format of these variables known?

Would it make a difference if the program was compiled?
User avatar
exxos
Site Admin
Site Admin
Posts: 28360
Joined: 16 Aug 2017 23:19
Location: UK

Re: Internal variable format

Post by exxos »

A = VARPTR(B)

Edit
Are you talking about variables in ram or the bas file ?
darklight
Posts: 3
Joined: 31 May 2020 13:46

Re: Internal variable format

Post by darklight »

Yes in RAM, I'm running someone else's program, I don't have access to the source code.
User avatar
exxos
Site Admin
Site Admin
Posts: 28360
Joined: 16 Aug 2017 23:19
Location: UK

Re: Internal variable format

Post by exxos »

I don't think its possible to find variables in RAM which are outside of the running program.. Steem de-bugger is probably the only way to see whats in RAM.
darklight
Posts: 3
Joined: 31 May 2020 13:46

Re: Internal variable format

Post by darklight »

Yes, I am talking about using Steems debugger to peek and poke (not STOS commands!) into the program. I've actually made a bit of progress, I've figured out where the program is stored in memory, and where the variable values are (thanks for the VARPTR tip - yes they are at that location :) ).

Not sure if it is of any use to anyone. I'm just trying to figure out how to hack a game really.

The sad thing is, it looks like when STOS is compiled, the variable names are lost, and its much much harder to 'browse' the variables in memory and understand what you are looking at.

I'll continue investigating.

Return to “STOS”

Who is online

Users browsing this forum: ClaudeBot and 5 guests