Created
November 2, 2010 09:47
-
-
Save anonymous/659430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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