This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-01-21 19:16:24

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Weird Scratch file...

If you open a .sb file in wordpad (like I did), This comes up: (The is was my 0S1S Calculator project)

Code:

ScratchV02  >ObjSStch      c  c  c  c  c  c  c  c      c  
c  c  c  
c  c             thumbnail#   x c  c         history       T2010-1-20 07:30:05    save    0S1S Calculator        
2010-1-20 15:55:07    save    0S1S Calculator        
       author               language       en       scratch-version       1.4 of 30-Jun-09       platform       Win32       
os-version       NT   qé`Qª""""""":ªªªEªUUUUUUU:ªªªEªUˆZZf•U:ªªªEªUXUf……U:ªªªEªUXVef•U:ªªªEªUUUUUUU:ªªªEªB"""""""zªªªÿ  #Eª   c  c  c  c  c  c  c  c  c  c  c  c  c  c  c  c       5ªÖ17¶´c9ËZ1;Ýk=ç8c=éÍJ=ík?ûÞ1?ýï?ÿÿÿObjSStch   Ò}c  c  c    c  c  c  c  c      ?ð          c  
 d <c  c  !    àh   c  
?ÿÿÿ       Stage   c    c  c  c  c  c  c  c      c     c      c  ¢c  c  c             c  c  ›c  c  c  c     c  c   c  !c  "c  "  c  #c  $c  %c  &   d   2nd#   1st#   5   answer   120   type       factorial   counter   c  'c  (¤c  )c  * d 2       background1"àh c  +  ð ´   
factorials¯c  ,c  -c  .   c  /c  c  0c  !ÿÿ   3    c  &c  1     
   vertical
   center
   
shrinkWrapi    c  2c  -c  3  c  4  c  jc  5c  %c  -c  6  c  7  c  c  8c  c  9c  ?¹™™™™™š d­c  :c  &c  ;c  <   c  =h
c  >c  
c  ?c      c  3c  @c  !c  "c  "    @4         c  Ac  Bc  Cc  Dc  Ec  Fc  G       popmc  H  € c  I+  €    õÿ  Ta ! Qì Ä    0lK%)F   c  Jc  Kc  Lc  Mc  Ndc  Oc  
c  -c    ! OD [       c  P 
! 
  ( ?ÿÿÿ   c  P 
   default
   getVar:!    2    c  $<Çdu?ß÷ý!    2    c  %
   
horizontal   c  Qc  R   c  Sc  T   c  Uc  c  Vc  W   c  Sc  X   c  Uc  c  Vc  Y   c  Zc  [c  \   c  ]c  ^c  _c  `       Õ½
rïS#<$› â«sñUÚ_Ä`³©i¨’±åÅGáAó&íGÑaJo}p#a
DÎêó*ɧj‘ý%˜îµ9Ýèâ:`Dvpyµh¢EØgäJµl’zÞ†kŸqÈŽü!0â]}yßäq7M©¶ç©¸O–Œ‰‘i®OÙõ\< _PoïiNV$
òqÅY£g“¶™x²øÚh    £6ŽWkf)_¢F¼õòÈÊ­õ¢Î«Ä2êñÀ9«Q(VñI4+NÛ,º¾¨ì©¼ÑÝŒ¼.<K€YR'9]¬êÅq­­§)³ºÐö°¥?zQÈQÊ?k}ùçÖÓ¾¶¾UÕ¬õ¼*3‚Aõ@„/,òW՟ó¿õËtãœz z6‰?†8Ò$:Ãç’ο†ÀÏéQk%~: A8µ#–Sè/ÏVÂ*ÂêÑZêI"”5×<Ð5ì#J    ZîGØËwË
Öfêo±’*30x+ª<ôódá¿×¸Öö߬ïÍ)\#¨H«¯óRæpߺàÛé3öÌ$ÛòJ„É|òäç5á
á†èzôg¡,_Œ^=þtòçêÊç–é„ïàøùÔJ’Ù    7ûyöô–õÝù×ÿŽ—
ŠUþa   1   2   6   24   120!    
   VerdanaBold
   
EventHatMorph       Scratch-StartClicked
   doAsk   First #?
   changeVariable
   
setVar:to:   c  a   %Type? (+, /, *, -, ^, factorial, mod)   c  a
   doIf   c  bc  c   c  dc  e
   doIfElse   c  fc  gc  h   c  i   c  j
   answer
   not   c  fc  kc  l   c  Sc  m   c  Uc  c  Vc  n
   =   c  oc     +   c  Uc  c  Vc  p   c  ]c  qc  rc  s   c  oc         factorial   2nd #?   c  a
   readVariable   c  tc  uc  v   c  fc  wc  x   c  y   c  z
   +   c  oc     c  oc     c  oc     -   c  Uc  c  Vc  {   c  ]c  |c  }c  ~   c  c  €c     c  fc  ‚c  ƒ   c  „   c  …
   -   c  oc     c  oc     c  oc     *   c  Uc  c  Vc  †   c  ]c  ‡c  ˆc  ‰   c  Šc  ‹c  Œ   c  fc  c  Ž   c     c  
   *   c  oc     c  oc     c  oc     /   c  Uc  c  Vc  ‘   c  ]c  ’c  “c  ”   c  •c  –c  —   c  fc  ˜c  ™   c  š   c  ›
   /   c  oc     c  oc     c  oc     mod   c  Uc  c  Vc  œ   c  ]c  c  žc  Ÿ   c   c  ¡c  ¢   c  fc  £c  ¤   c  ¥c  ¦c  §c  ¨c  ©   c  ª
   \\   c  oc     c  oc     c  oc         factorial   c  «c  ¬c     c  Uc  c  Vc  ­   c  ®c  ¯c     c  °c  ±c  ²   c  Uc  c  Vc  ³   c  Zc  ´c  µ
   deleteLine:ofList:
   all   1
   append:toList:   1
   doRepeat   c  c  ¶    c  ·c  ¸   c  ¹c  ºc     c  fc  »c  ¼   c  ½   c  oc     c  Uc  c  ¾    c  ®c  ¿c  
   getLine:ofList:
   last   c  oc     ^   c  Zc  Àc  Á
   
changeVar:by:   c  Šc  Âc  Ã   c  Äc  Åc  Æ   c  Çc  È   c  oc     c  ¹c  Éc  
   >   c  oc     0   c  Uc  c  Vc  Ê   c  °c  Ëc  Ì   c  c  Í    c  oc     c  c  Î    c  Ï   c  oc     c  oc     c  Uc  c  Vc  Ð   c  Šc  Ñc  Ò   c  oc     c  oc  

Thats weird!

Offline

 

#2 2010-01-22 23:51:39

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Weird Scratch file...

This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.

It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.

NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#3 2010-01-23 00:35:03

keikij
Scratcher
Registered: 2009-02-22
Posts: 1000+

Re: Weird Scratch file...

billyedward wrote:

This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.

It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.

NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.

Sounds interesting, how do you do it?


Back from the Dead (And Stuff)

Offline

 

#4 2010-01-23 09:25:52

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: Weird Scratch file...

billyedward wrote:

This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.

It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.

NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.

I think that WordPad can let us turn BYOB files to Scratch files!

Posted from my Wii

Offline

 

#5 2010-01-23 09:45:31

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Weird Scratch file...

That's impossible *universe explodes*


Converting my Scratch projects to Python!

Offline

 

#6 2010-01-24 08:58:28

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

Re: Weird Scratch file...

billyedward wrote:

This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.

It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.

NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.

Please teach me how to do it!


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#7 2010-01-24 13:13:03

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Weird Scratch file...

You will need a binary editor.
The one which I prefer is Hexedit, however there are loads of others out there.
First, you'll need to open the scratch file.
You will see two main panes: One filled  with numbers, and the letters A-F. The other will look like what you saw in notepad. The second one is of most interest to us, at the moment.
To begin: The first 10 letters are the file header.
This is the source of those dreaded 'bad header' errors.
It tells scratch what program made the file. This allows scratch to tell quickly and harmlessly whether it can open that particular file.
1.0-1.2.1 projects will have ScratchV01.
1.3+ projects will have ScratchV02.
BYOB, lists & files, etc. projects have their own.
Using your binary editor, you can change the header.
If you have a project that was made in, say, 1.3, but you want to open it in 1.2, then changing it from ScratchV02 to ScratchV01 will tell scratch that the file is compatible.
One problem: it isn't.
There are many other things you'll have to do in order to make it compatible, but those are unfortunately beyond the scope of this explanation.

Scrolling down, you will see the save history.
This includes the date, time, etc of each save.
In the hex panel (1-9,A-F) you will see that each entry is separated by the byte sequence 09-09-0D.
You can make scratch think that it has been saved more than it has, only once, etc. by carefully adding, editing, or removing entries here, making sure that you stick with this format.
Also, you can get rid of the 'based on ####'s project' message on remixed projects this way, however due to the ethics of this, I'd highly discourage it.

The last thing you can easily do is to edit costume, sprite, variable, list, and sound names. You can also change the project notes, and some things entered into blocks.
Just scroll down until you find some text you recognise, and edit away!
***NOTE: Whatever you do, do not change the length of any string you edit. Just replace characters. I would recommend that you put it into overtype mode, to make this easier.***

One useful thing you can do with the above is:
Make a graphic effect block, with brightness in it.
In the binary editor, change 'brightness' to 'saturation.'
Open it in scratch: The block now says saturation!
But the really cool part is that it works.
Just set the saturation effect to a negative value, and watch what happens.

Also, if you use a scratchconnections application, then you may find it annoying how you can only get the special sensor values when connected... well, not anymore!
Here, just change one of slider, light, etc to your own, of the same length.

Whew!
That's a lot to take in.
Oh well, hope you can use it at some point!


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#8 2010-01-24 14:28:12

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Weird Scratch file...

Wow, I'm seriously impressed by this!


Jens Mönig

Offline

 

#9 2010-01-24 14:35:25

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Weird Scratch file...

Thats really cool!


http://i.imgur.com/WBkM2QQ.png

Offline

 

#10 2010-01-24 15:48:40

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: Weird Scratch file...

Jens wrote:

Wow, I'm seriously impressed by this!

Can you get this reprinted on the Scratch Source Code page, please? That would be really nice.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#11 2010-01-24 17:34:13

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Weird Scratch file...

Just one thing that I forgot to mention in the above post:
It is a VERY good idea to back up the project before you go about editing it.
In case you forget!


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#12 2010-01-25 09:52:24

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Weird Scratch file...

Wow! That is cool, I have always been interested in these  kinds of things!  smile


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#13 2010-04-17 13:05:50

omnomnarwhal
Scratcher
Registered: 2010-04-15
Posts: 3

Re: Weird Scratch file...

billyedward wrote:

This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.

It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.

NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.

Oh, please tell me how to get rid of a key not found error! I'm in desperate need of help cos my school project's decided to do this to me 2 days before I need it...  hmm

Offline

 

#14 2010-07-24 14:18:17

gtg826q
New Scratcher
Registered: 2010-06-23
Posts: 2

Re: Weird Scratch file...

This is very similar to a project I am doing. I am trying to write a program, in Java for example, to compare two Scratch projects. Once I read in a Scratch project file, how can I determine where the contents object store is and what objects I am looking at within the store?

Offline

 

Board footer