Example #1
0
def convert_url(url):
	url = bytes(url, "ascii")
	url += bytearray([0] * (2 - (len(url) % 2))) # pads to u16 and adds an extra null byte if necessary
	url = struct.unpack("<%dH" % (len(url) // 2), url)
	return bin2html.do_convert(url, offset = 0x600 + 0x300)
Example #2
0
def convert_cookie(cookie):
	cookie = bytes(cookie, "ascii")
	cookie += bytearray([0xA])
	cookie += bytearray([0] * (2 - (len(cookie) % 2))) # pads to u16 and adds an extra null byte if necessary
	cookie = struct.unpack("<%dH" % (len(cookie) // 2), cookie)
	return bin2html.do_convert(cookie, offset = 0x700 + 0x300)