This file contains 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
items = {} | |
def constructs(i): | |
match i: | |
case Comparison(): | |
return "comparisons" | |
case HighLevelILFor(): | |
return "for" | |
case HighLevelILWhile(): | |
return "while" | |
case HighLevelILDoWhile(): |
This file contains 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
from PySide6.QtWidgets import QApplication, QMainWindow, QMessageBox, QPushButton | |
from PySide6.QtCore import Qt | |
import sys | |
class MainWindow(QMainWindow): | |
def __init__(self): | |
super().__init__() | |
self.setWindowTitle("QT Test") | |
button = QPushButton("Test Dialog") | |
button.clicked.connect(self.button_click) |
This file contains 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
#!/bin/bash | |
GHIDRAPATH=~/Downloads/ghidra | |
# https://stackoverflow.com/posts/23002317/revisions | |
function abspath() { | |
# generate absolute path from relative path | |
# $1 : relative filename | |
# return : absolute path | |
if [ -d "$1" ]; then | |
# dir |
This file contains 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
#!/bin/zsh | |
echo "file://${HOME}/ports"|sudo tee -a /opt/local/etc/macports/sources.conf | |
mkdir -p ${HOME}/ports/devel/zeal | |
cat > ${HOME}/ports/devel/zeal/Portfile << ** | |
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
PortSystem 1.0 | |
PortGroup cmake 1.1 | |
PortGroup github 1.0 |
This file contains 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
def myvisit(opName, op, opType, parentInstruction): | |
if (op.operation == MediumLevelILOperation.MLIL_MULU_DP) and isinstance(op.right, Constant) and isinstance(op.left, Constant): | |
nextInstruction = op.function[op.instr_index + 1] | |
leftVal = op.left.value.value | |
rightVal = op.right.value.value | |
upper = leftVal * rightVal >> 32 | |
lower = leftVal * rightVal & 0xffffffff | |
if isinstance(nextInstruction, SetVar): | |
nextVar = nextInstruction.src.operands[0] | |
if hasattr(nextVar, "name"): |
This file contains 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 zsh | |
# Note: | |
# CMake, Clang, clang-format, Ninja, git and sed are required to build | |
# | |
# Note that currently there is a bug (https://github.com/google/binexport/issues/117) | |
# that requires applying this patch, remove when resolved | |
# | |
if [ -d ~/Downloads ] |
This file contains 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
Once there was a brilliant engineer named Alice who was determined to push the limits of technology. She had been working on a project to build a time dilation chamber, which would allow her to experience time at a different rate than the outside world. | |
Alice had been struggling with the project for months, but she was determined to see it through to the end. She poured over the technical specifications, ran countless simulations, and consulted with other experts in the field. | |
Finally, Alice had an idea. She decided to use a GPT-powered chat-bot to help her design the chamber. She spent hours talking with the chat-bot, bouncing ideas back and forth and asking for advice and clarification. | |
To her amazement, the chat-bot was able to provide her with detailed and accurate answers to even the most complex questions. With its help, Alice was able to overcome the obstacles that had been holding her back and make significant progress on the project. | |
In just a week of real-time, Alice was able to design and build |
This file contains 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 time | |
import sys | |
import board | |
import neopixel | |
import busio | |
import digitalio | |
import displayio | |
import terminalio | |
from adafruit_display_text import label | |
from adafruit_displayio_sh1107 import SH1107, DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650 |
This file contains 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
# Untested, but could be used to generate a script to annotate a binary for GDB | |
# Run this script inside of the snippet editor to create a shell script | |
output = "#!/bin/bash\n" | |
for sym in bv.get_symbols(): | |
flags = ",global" | |
if sym.type == SymbolType.FunctionSymbol: | |
flags += ",function" | |
output += f"objcopy input --add-symbol {sym.name}=.text:{hex(sym.address)}{flags} output; mv output input;\n" | |
outputfile = get_save_filename_input("script command") | |
if outputfile: |
This file contains 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
# SEE: https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/make_code.py |
NewerOlder