Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import execjs
- content = '''
- (String.fromCharCode
- (
- (010 * 12 + 6),
- (06 * (0x1 * (1 * 0xa + 6) + 1) + 12),
- (4 * 27 + 3),
- (01 * 0x3b + 50),
- (1 * 0x34 + 15),
- (1 * (1 * (3 * ((0x1 * 8 + 7) * 1 + 0) + 8) + 24) + 27),
- (0x1 * (2 * 0x25 + 7) + 16),
- (1 * 0112 + 40),
- (1 * 0x2c + 23),
- (0x3 * 042 + 9),
- (1 * ((05 * 4 + 1) * 03 + 0) + 37),
- (0x2 * (1 * 0x1f + 4) + 31)
- ))
- String.fromCharCode
- (
- (010 * 12 + 6),
- (06 * (0x1 * (1 * 0xa + 6) + 1) + 12),
- (4 * 27 + 3),
- (01 * 0x3b + 50),
- (1 * 0x34 + 15),
- (1 * (1 * (3 * ((0x1 * 8 + 7) * 1 + 0) + 8) + 24) + 27),
- (0x1 * (2 * 0x25 + 7) + 16),
- (1 * 0112 + 40),
- (1 * 0x2c + 23),
- (0x3 * 042 + 9),
- (1 * ((05 * 4 + 1) * 03 + 0) + 37),
- (0x2 * (1 * 0x1f + 4) + 31)
- )
- '''
- # soup = re.findall(r"\((.+?)\)", content, re.MULTILINE)
- # print(soup)
- looptime = len(re.findall(r"String.fromCharCode", content))
- pepper = "String.fromCharCode"
- text = content
- for _ in range(looptime):
- num = text.find(pepper) + len(pepper)
- text = text[num:]
- soup = list(text)
- soup.append(' ') # Just to be sure
- i = 0
- first = int()
- last = int()
- for idx, vegetable in enumerate(soup):
- o = i
- if vegetable == '(':
- i += 1
- if vegetable == ')':
- i -= 1
- if i == 1 and o == 0: # First Opened Bracket
- first = idx
- if i == 0 and o == 1: # Last Closed Bracket
- break
- last = idx + 1
- content = content.replace(f"{pepper}{text[:first]}{text[first:last]}", execjs.eval(f"{pepper}{text[first:last]}"), 1)
- text = text[last:]
- print(content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement