We won't support Adunanza in any way - if something goes wrong, you're on your own.
Regarding deciphering the packet: You'll need the OPcodes for different operations and some understanding of the packet structure. If you prefer python, you can find an incomplete implementation at
Google code, but there's always the wiki and the C++ source code, too.
Let's just walk through the response:
0x00 0x00 0x00 0x22 # Packet header, is always 0x20 + flags; the flags in this case are 0x02, which is UTF8 numbers
0x00 0x00 0x00 0x0b # Content length - 11 decimal
0x04 # OPCode indicating that authentication was OK
0x01 # Tag count. A tag is basically a collection of name, type and value
0xe0 0xa8 0x96 # This is the encoded number 0x050b, which is the tag name "server version" I'll explain decoding further down
0x06 # tag type string
0x04 # string length
0x53 0x56 0x4e 0x00 # String 'SVN\0'
Translated to XML, to make the transmitted data more obvious:
<ecpacket>
<tag>
<name>server_version</name>
<type>string</type>
<value>SVN</value>
</tag>
</ecpacket>
UTF-8 decoding:
if ord(data[0]) in range(0x7F):
name_len = 1
elif ord(data[0]) in range(0xc3,0xdf):
name_len = 2
elif ord(data[0]) in range(0xe0,0xef):
name_len = 3
tag_value = ord(data[:name_len].decode("utf-8"))
tag_name = tag_value/2
I won't explain all details of UTF8, but basically you can use different character lengths (from 1 Byte for ASCII up to 4 Bytes) and by looking at the first Byte you know how many Bytes there are. Because multiple Bytes are possible, you have more than the 255 values possible with ASCII. For instance the character "™" (trademark) has the character number 8482 and the utf-8 representation '\xe2\x84\xa2'.
To get a tag name, you get the character number for the utf-8 representation and divide it by two. (See what the EC wiki entry says on subtags to learn about the need to divide by two.)
I can't tell you how search works, because I don't know - I recommend you to understand the packet structure and then use wireshark to capture the packets of a search request by amulecmd.