peeking and poking around family basic.

Started by ramidavis, October 15, 2012, 09:58:55 pm

Previous topic - Next topic

ramidavis

October 15, 2012, 09:58:55 pm Last Edit: October 15, 2012, 10:04:50 pm by ramidavis
I have been peeking and poking around with an idea, the idea of a program that can modify its self. :crazy:
This picture will show you what i have tried.

The first 3 lines are my original program that i entered, from a fresh cold boot.
On the next line, i did some peeking, until i found a value of 34, preceeded by a value of 39, my  ' "  . (the '  is short hand for rem, or remark)
Then i poked in the value of "?", 63, to &h6009, the location of the ' , and relisted line 10. There is our ?, which should be short hand for "print". 8)
I decide to give it a go, but do not like the results. I relist line 10, the ? is still there. ???
I move the cursor back up to the relisted line 10, press return, and again relist line 10.
Now, the ? has expanded into a full "print".
Is there any specific value i could have poked in there that would have done what i thought it should of done?
(Have the program its self turn line 10 from a rem line to a print statement)
I was going to add the peek and poke on the next line, if they were to work, but since it did not work... :'(
Am i just going about it the wrong way? Or would i have had to shift the whole program line and make room for individual "p" "r" "i" "n" "t" characters?
(If it matters, i was doing this with v3... No idea about 2.0 or 2.1) :help:

80sFREAK

1) You put "?" character, not token "?"
2) Family Basic storing all operators as 1byte value.
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

ramidavis

October 16, 2012, 10:39:44 am #2 Last Edit: October 16, 2012, 03:40:07 pm by ramidavis
what would i poke for the token "?", and not the character "?"  ?

Post Merge: October 16, 2012, 03:40:07 pm

I have found a list of BASIC tokens on a web site (for c64, mind you). It has listed that the "print" command token is 139/$99 (decimal/hex. they use $ for hex on c64).
i decided to poke &h99 (same as $99) into family basic, and i got the clear command!
If any one knows anymore &Hxx values for other family basic tokens, i would be interested!  :)

80sFREAK

You can find by peeking ;)
Tokens list specific for each variation of basic
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

ramidavis

October 16, 2012, 03:46:57 pm #4 Last Edit: October 16, 2012, 03:54:13 pm by ramidavis
could you give any clue where to start peeking? are all the tokens stored together, one after another at certain address?
;D ;D GOT IT!
&H8b == "print"

80sFREAK

All tokens stored as list, so you can scan ROM with PEEK
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

ramidavis


UglyJoe

Commands start at &H80.  You can start iterating at 0 if you want to see a bunch of character data and other corrupt output.