hotzenklotz / picobrew-server

A reverse engineered server for the proprietary PicoBrew Zymatic protocol
MIT License
61 stars 16 forks source link

Add Support for Z Machines #9

Open hotzenklotz opened 4 years ago

hotzenklotz commented 4 years ago

Right now, the picobrew-server only supports the Zymatic machine protocol. It would be cool to support newer machines from the Z family as well.

hotzenklotz commented 4 years ago

@bendavis @blucey Perhaps you could share your MITM captures here.

hotzenklotz commented 4 years ago

Here is a firmware file for the Z zseries_0_0_116.bin.zip (provided by @Blackjackbuyer)

Perhaps, we can figure out more of the protocol by looking at the strings in the firmware:

strings zseries_0_0_116.bin |grep picobrew
www.picobrew.com
www.picobrewtest.com
picobrew.azure-devices.net
picobrewdev.azure-devices.net
CString::areEquals(_iothub_url, "picobrewdev.azure-devices.net")
https://picobrew.com
CString::areEquals("picobrew.com", req.Host.c_ptr())
https://picobrew.com:65432
https://picobrew.com/super/long/path/that/will/exceed/the/max/size/of/the/internal/buffer/super/long/path/that/will/exceed/the/max/size/of/the/internal/buffer/super/long/path/that/will/exceed/the/max/size/of/the/internal/buffer/super/long/path/that/will/exceed/the/max/size/of/the/internal/buffer?and&its&crazy&parameters&that&are&also&too&big&for&us&to&handle&and&successully&post
https://www.picobrew.com/Vendors/input.cshtml?id=589&type=PicoBeer&Token=3857B5A570894FC68E5E4AC779288BF8
r.init(stream, "https://www.picobrew.com/Vendors/input.cshtml?" "id=589&type=PicoBeer&Token=3857B5A570894FC68E5E4AC779288BF8")
https://www.picobrew.com/Vendors/input.cshtml?type=ZRecipeList&token=240ac4840e90
r.init(stream, "https://www.picobrew.com/Vendors/input.cshtml?" "type=ZRecipeList&token=240ac4840e90")
https://www.picobrew.com/Vendors/input.cshtml?type=Dummy
r.init(stream, "https://www.picobrew.com/Vendors/input.cshtml?type=Dummy")
https://www.picobrew.com/Vendors/input.cshtml?type=
https://www.picobrew.com/Vendors/input.cshtml?ctl=
https://www.picobrew.com/Vendors/input.cshtml?type=StillRequest&token=
picobrew.com/NewZ
bendavis commented 4 years ago

@blucey did a great writeup of the Z protocol so far. I added a few modifications, but I think we're on our way to mapping this thing out. https://github.com/blucey/picobrew-z-api/blob/master/Picobrew%20Z%20API.md