This file contains hidden or 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
| import pickle | |
| OPS = { | |
| 0: '+', 1: '&', 2: '//', 3: '<<', 4: '@', 5: '*', 6: '%', 7: '|', | |
| 8: '', 9: '>>', 10: '-', 11: '/', 12: '^' | |
| } | |
| def calculate_expression(current_value, tokens): | |
| result = current_value if isinstance(tokens[0], str) and tokens[0].startswith('flag[') else int(tokens[0]) | |
| for i in range(1, len(tokens), 2): |
This file contains hidden or 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
| import gzip | |
| import pickle | |
| def chunk_blocks_gz(filepath): | |
| all_blocks, temp_block, is_capturing = [], [], False | |
| with gzip.open(filepath, "rt") as file_handle: | |
| for text_line in file_handle: | |
| text_line = text_line.rstrip() | |
| text_line = 'stack > [...' + text_line[-150:] if 'stack' in text_line else text_line |
This file contains hidden or 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
| import marshal | |
| __lltrace__ = True | |
| with open("output.pyc", "rb") as f: | |
| header = f.read(16) # reads and skips the first 16 bytes (this is the header .pyc file with metadata: magic number, timestamp, size, etc.) | |
| code_obj = marshal.load(f) | |
| exec(code_obj) |
This file contains hidden or 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
| # Asking for connection details | |
| echo -n "Enter OLD MikoPBX ip address or host name: " | |
| read PBX_IP | |
| echo -n "Enter ssh root username [root]: " | |
| read PBX_USER | |
| PBX_USER=${PBX_USER:-root} | |
| echo -n "Enter ssh port [22]: " | |
| read PBX_PORT |