Saturday, 30 April 2011

Why your Sheep don't work - The Truth!

OK this is by "Ivan Always" from the farmville forums, it's not my own work but it's very interesting (if a bit complicated). The post is here, although I doubt the post will last long once the moderators find it!

So here's a copy of the post from Ivan Always.

First we need to understand how they work and then how they got broken. Each sheep is made up of what is called a 'Metadata' string, basically this is it's 

DNA! This must fall between 0 and ff when counting in Hexadecimal (0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 etc...)

these are examples of working Metadata strings, and the reasons why they work:

Brutus the Ram:
{"B":{"V":["a","a"],"H":["a1","a1"],"S":["c","c"]},"P":{"H":["b7","b7"],"S":["c","c"],"V":["d","d"],"T":["c"]},"N":"sheeppen_ram_quest0203","G":"M"}

Green Ewe with Yellow Camoflague Pattern:
{"B":{"H":["55","55"],"S":["10","10"],"V":["10","10"]},"P":{"H":["2d","2d"],"S":["10","10"],"V":["10","10"],"T":["d"]},"N":"Green with Yellow Camo","G":"F"}

Red with Colour Changing Stars:
{"B":{"H":["e6","e6"],"S":["10","10"],"V":["c","c"]},"P":{"H":["f0","b4"],"S":["10","10"],"V":["c","c"],"T":["e"]},"N":"Red with CC Stars","G":"F"}

The reason the last one has colour changing stars, is because it contains a hexadecimal number from f0 to ff in the pattern part of its Metadata 

("P":{"H":["f0","b4"]


these next three are the same sheep with invalid sections of their Metadata string, they will look identical, but will now not produce anything other than 

white or black sheep:

Brutus the Ram:
{"B":{"H":["a1","a174"],"S":["c","c"],"V":["a","669f"]},"P":{"H":["b7","b7"],"S":["c","c14"],"V":["d","d1101101a"],"T":["c"]},"N":"sheeppen_ram_quest0203","G

":"M"}

Green Ewe with Yellow Camoflague Pattern:
{"B":{"H":["55","515"],"S":["10","100"],"V":["10","10"]},"P":{"H":["2d","2ad7"],"S":["10","10"],"V":["10","f10"],"T":["d"]},"N":"Green with Yellow 

Camo","G":"F"}

Red with Colour Changing Stars:
{"B":{"H":["e6","e6"],"S":["10","10"],"V":["c","c"]},"P":{"H":["f1a10","bbb4"],"S":["10","10"],"V":["c","c"],"T":["e"]},"N":"Red with CC Stars","G":"F"}


These are only basic examples, now how does the Metadata string work?
Zynga have used the Unix colour system, based around hexadecimal values, therefore any value from 0 to ff is acceptable:

Plain White Ram:
{"B":{"H":["0","0"],"S":["0","0"],"V":["10","10"]},"P":{"H":["0","0"],"S":["0","0"],"V":["10","10"],"T":["a"]},"N":"White Ram","G":"M"}

Where you see the "B" this is the Body part of the Sheep, made up of three sets of values:
"H" Hue
"S" Saturation
"V" Vibrance (or Intensity)

Where you see the "P" this is the pattern section, made up of the same three sets of values as the body
where you see the "T" this is the Type of pattern, either:
a = Plain
b = Spots
c = Hooded
d = Camoflague
e = Stars
f = Stripe

the "N" section is the Name of the sheep
and the "G" is the Gender, "M" Male, "F" Female

Here is an extreme example of a 'Hacked' sheep:
{"B":{"H":["c2c","c2c"],"S":["100aaaaaaaaab000000000000000","100aaaaaaaaab000000000000000"],"V":["fff0f21","fff0f21"]},"P":{"H":["d5f","d5f"],"S":["c","c"],"

V":["d","d"],"T":["f"]},"N":"Flashing Mask with Flashing Electric Stripe","G":"M"}

as you can see, out of the six sets of values comprising this sheep, only two seem to fall within Zyngas parameters.

The way the system works now, is that whenever you try to breed with a ram and a ewe, if any of the sets of values fall outside of Zyngas parameters, the 

system will default to White, and will then breed as a normal pure white sheep, provided it is placed with another sheep whose parameters fall within those 

outlined by Zynga.

So as you can see, any of your colour changing sheep, which you claimed from the wall or were gifted by a friend, will more than likely contain a different string than those now permitted, a usual colour changing string used by those that followed the hackers was... {"H":["78e","179f"]

Which was in itself stupid because all they had to do was change the first section of the "H" part of either the body or pattern (or both) to a value of f0, f1, f2 etc...

How did it become so widespread? Click the link below and see for yourself, originally the hackers kept it to themselves, designing it to be to dangerous for the average player to mess around inside the coding in this way, but after a few weeks this became public.

http://farm.hackers.am/sheepdesigner/

simply click on a sheep from the gallery, select fork and you are presented with the sheep and its metadata, move the sliders around, select Max Range, see how easy it is to generate the craziness we all saw.

Okay how is this Metadata entered into the game?

With the 'Charles Web Debugging Proxy' a tool used by many software companies to see how and why there programs work or don't work, this program when used can interupt any command, the hackers simply placed a sheep inside their sheep pen, activated Charles, removed the sheep from the pen, Charles would then 'pop-up' a simple search though the displayed data, revealed the metadata string, which could then be changed.

After changing as many sheep as they wished, they simply closed Charles, deleted their sheep pen, built a new one and started breeding their 'illicit' sheep.

Why do the official Zynga ones not work?

This is really simple, through the 'hacked' sheep, the vast majority of players unknowingly gained sheep that should have taken them months to create, thus losing a lot of revenue for Zynga, they have now released the patterns and the colour changing ability, through four new market sheep (at a cost of 110FV for 

the lot), but they have blocked the passing of the f0 from either of these two colour changing Market sheep, onto any offspring and made the chance of 

passing on the patterns much more improbable.... Why?

Because they can cover their tracks of course, these 'hacks' are not found, they are released to certain individuals who examine them before then passing them on to the players, either directly in some cases, or through other means as in this case, remember Zyngas designers use Charles also.

So in conclusion, your sheep that sit on your farm that you obtained through 'legitimate' means, can continue to be 

'pastel/neon/flashers/poppers/masks/electic' or whatever you have, but they will not breed, all Zynga has done is allowed you to see what might be possible, 

then taken it away, yes they will lose customers, many customers it seems, but it also seems they are willing to suffer those loses, at the expense of those 

die-hard players who will continue to hand over their hard earned cash.

I hope this thread stays up, and I hope it helps some people.

Thanks for reading!



No comments:

Post a Comment