Basically, this file will take in a binary file of skin.dat and export 3 files: image.png is the skin file, face.png is the face in original size, faceLarge.png is the face in 512x512.
Only supports 64x64 skins for now. If you want 32x64 make appropriate checks.
The PocketMine's (MCPE's) Skin Data Format is in RGBA format, when represented as hex strings they are a stream of 8 characters. Each two characters represent the R, G, B A, and this continues until you have enough data for either a 32x64 image or a 64x64 image. You can also check whether 32x or 64x with the isSlimSkin() flag on the Player object.
Note that A only has 2 values: 0 and 255. They are inverted in the script because PHP.