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 os, stat | |
| from contextlib import contextmanager | |
| from subprocess import run | |
| @contextmanager | |
| def fd_context(fd: int): | |
| try: | |
| yield fd | |
| finally: | |
| os.close(fd) |
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
| // native code exec PoC via Game Script - @carrot_c4k3 (exploits.forsale) | |
| // | |
| // sample shellcode: mov rax, 0x1337; ret; | |
| // drop your own shellcode inplace here | |
| let shellcode = [0x48,0xC7,0xC0,0x37,0x13,0x00,0x00,0xC3] | |
| // hex printing helper functions | |
| let i2c_map = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] | |
| let c2i_map = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'A': 0xA, 'B': 0xB, 'C': 0xC, 'D': 0xD, 'E': 0xE, 'F': 0xF} |
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
| # mini proof of concept of how to use Z3 to prove the correctness of bit | |
| # manipulation formulas, using the Ternary.__add__ function from | |
| # https://gist.github.com/dougallj/9211fd24c3759f7f340dede28929c659 as an | |
| # example | |
| # partly inspired by Philip Zucker's post about Z3 and ranges: | |
| # https://www.philipzucker.com/more-stupid-z3py-tricks-simple-proofs/ | |
| import z3 |
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
| #!/usr/bin/env python3 | |
| # coding=utf-8 | |
| """ | |
| Microsoft CAB Archive Extractor (Python-based) | |
| Usage: cabextract.py [-h] [-o OUTPUT_DIR] [paths ...] | |
| Copyright (c) 2024 Plato Mavropoulos | |
| """ |
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
| # This script gathers all the pages of a manual and merges them into a PDF. | |
| # You'll need to play a bit with inspect-element in order to figure out the format the correct url, | |
| # but it should be easy to adapt it to any manual. | |
| # This script is specifically for https://www.manua.ls/audi/q3-2018/manual. | |
| # Their url format is https://www.manua.ls/viewer/{manual-id}/{page-number}/bg{page-number-hex}.png | |
| # Example: https://www.manua.ls/viewer/668006/100/bg64.png | |
| # Enjoy! | |
| import requests | |
| from tqdm import tqdm | |
| from PIL import Image |
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
| // | |
| // MIT License | |
| // | |
| // Copyright (c) 2024 Derek Selander | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
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
| // Copyright 2022 Google LLC | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, |
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
| #ifndef CBE_SPU_FATAN | |
| #define CBE_SPU_FATAN | |
| #include <stdint.h> | |
| #include <spu_intrinsics.h> | |
| #include <spu_mfcio.h> | |
| // Helper functions to load constant values into quadwords | |
| // These functions load pre-computed constant values into quadwords, | |
| // which can be efficiently used in SIMD operations on the CELL SPE. |
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
| #include <stdio.h> | |
| #include <fcntl.h> | |
| #include <stdlib.h> | |
| #include <sys/ioctl.h> // for _IOW, a macro required by FSEVENTS_CLONE | |
| #include <sys/types.h> // for uint32_t and friends, on which fsevents.h relies | |
| #include <unistd.h> | |
| #include <string.h> // memset | |
| //#include <sys/_types.h> // for uint32_t and friends, on which fsevents.h relies | |
| #include <sys/stat.h> // for mkdir |
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
| // | |
| // ViewController.swift | |
| // Journal-Calendar-Demo | |
| // | |
| // Created by Seb Vidal on 30/04/2024. | |
| // | |
| import UIKit | |
| class ViewController: UIViewController { |