Skip to content

Instantly share code, notes, and snippets.

Created November 2, 2010 09:47
Show Gist options
  • Save anonymous/659430 to your computer and use it in GitHub Desktop.
Save anonymous/659430 to your computer and use it in GitHub Desktop.
bncs_packet 0x25, :ping, "[DWORD ping_value]"
bncs_packet 0x50, :sid_auth_info, "[DWORD logon_type][DWORD server_token][DWORD udpvalue][FILETIME mpq][STRING filename][STRING valuestring]"
# The class to parse all of the BNCS packets
class BncsHandler
def initialize(client, packet, unpacked)
@client, @packet, @unpacked = client, packet, unpacked
end
def handle
# removed magic handler code to prevent copy/paste
end
protected
def ping(dw_ping_value)
log @packet.hexdump
@client.send("\x25#{dw_ping_value}")
end
def sid_auth_info(dw_logon_type, dw_server_token, dw_udpvalue, ft_mpq, str_filename, str_valuestring)
log @packet.hexdump
# run check_revision
end
def log(text)
puts "[BNCS] #{text}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment