Skip to content

Instantly share code, notes, and snippets.

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)
@psifertex
psifertex / ghopen.sh
Created January 12, 2024 04:07
Open Ghidra with default analysis options
#!/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
@psifertex
psifertex / zeal.sh
Last active August 24, 2023 16:34
macos zeal build
#!/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
@psifertex
psifertex / fixmuls.py
Created July 17, 2023 21:29
small snippet written on the July 14 2023 Binary Ninja live stream
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"):
@psifertex
psifertex / binexport_binja.zsh
Last active May 1, 2024 02:13
BinExport build script for Binary Ninja (macOS + Linux Only)
#!/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 ]
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
@psifertex
psifertex / code.py
Last active November 9, 2022 03:50
wip co2 sensor based on a bunch of adafruit stemma qt compatible boards
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
# 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:
# SEE: https://github.com/Vector35/binaryninja-api/blob/dev/python/examples/make_code.py
# Copyright (c) 2022 Vector 35 Inc
#
# 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
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in