Skip to content

Instantly share code, notes, and snippets.

@Corgan
Created June 8, 2011 05:45
Show Gist options
  • Save Corgan/1013849 to your computer and use it in GitHub Desktop.
Save Corgan/1013849 to your computer and use it in GitHub Desktop.
class Header < BinData::Record
endian :big
string :magic, :read_length => 1
int32 :type
int32 :sender_id
int32 :payload_length
end
class PlayServerConnect < BinData::Record
endian :big
int32 :id_len, :value => lambda { id.length }
string :id, :read_length => :id_len
int32 :zhash_len, :value => lambda { zhash.length }
string :zhash, :read_length => :zhash_len
int32 :success
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment