Skip to content

Instantly share code, notes, and snippets.

@four0four
four0four / wearout.py
Created September 6, 2024 18:11
for use w/ 'glasgow script memory-25x' - little spi flash wearout experiment
import time
import statistics
cur_iter = 0
write_size = 256
base_addr = 0
inv = False
erase_times = []
prog_times = []
@four0four
four0four / smurw-gpu.c
Last active June 1, 2023 21:18
hacked up smurw.c tested on an rx580 (should work on most?) invocation is like ./smurw [path to resource5 BAR] [addr] (dword to write)
/* smutool Tool for SMU
* Copyright (C) 2015 Damien Zammit <[email protected]>
* Copyright (C) 2023 Sheep Sun <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@four0four
four0four / seal_installer.scad
Last active September 9, 2024 07:43
janky seal press
//$fn=500;
inner_dia = 47.5;
outer_dia = 57.5;
clearance = 1.0;
// height
height = 10;
@four0four
four0four / GetProcAddressEx.rs
Created April 14, 2023 02:12
GetProcAddressEx "in Rust"
use windows::core::*;
use windows::Win32::Foundation::HMODULE;
use windows::Win32::System::LibraryLoader::{GetProcAddress, LoadLibraryA};
//use windows::Win32::UI::Input::XboxController::XINPUT_STATE;
// ref: https://gist.github.com/robindegen/9446175
#[repr(C)]
#[derive(Debug,Default)]
@four0four
four0four / ring_thing.scad
Last active March 24, 2023 03:16
Simple piston-ring-pusher tool to help with measuring gaps repeatably. Requires https://github.com/revarbat/BOSL2 for the chamfer.
include <BOSL2/std.scad>
$fn=500;
difference() {
union() {
difference() {
cylinder(h=25, r = 50, center = false);
up(25) #chamfer_cylinder_mask(r=50, chamfer=2);
@four0four
four0four / microcorruption.py
Last active January 8, 2023 03:21 — forked from joshwatson/microcorruption.py
Microcorruption Memory Dump BinaryView for Binary Ninja
import struct
import traceback
from binaryninja import (
BinaryView, Architecture, log
)
from binaryninja.enums import (
SegmentFlag
)
class MicrocorruptionView(BinaryView):
@four0four
four0four / safety_wire_jig.scad
Last active July 28, 2022 06:52
openscad safety wire jig
/*[ Bolt properties (Machinery's pp. 1446, 25th ed) ]*/
//Width across flats (S)
bolt_head_width=16; // [13:M8,16:M10,18:M12,21:M14]
//shank nominal diameter
bolt_body_diam=10; //[8:M8,10:M10,12:M12,14:M14]
//bolt head depth
bolt_head_depth=6.6; //[5.5:M8, 6.6:M10, 7.8:M12, 9:M14]
/*[misc.]*/
// clearance for fitment around bolt parts
@four0four
four0four / bootrom_emu.py
Last active February 12, 2022 09:27
Unicorn Engine - based Zynq bootrom emulation harness
#!/usr/bin/env python
import sys
from colors import *
from unicorn import *
from unicorn.arm_const import *
from capstone import Cs, CS_ARCH_ARM, CS_MODE_ARM, CsError
diff --git a/__init__.py b/__init__.py
index 5d325b4..b99f313 100644
--- a/__init__.py
+++ b/__init__.py
@@ -3,17 +3,17 @@ import requests
import shutil
from zipfile import ZipFile
from tempfile import TemporaryDirectory
-from PySide2.QtWidgets import (QPushButton, QWidget, QVBoxLayout,
+from PySide6.QtWidgets import (QPushButton, QWidget, QVBoxLayout,
@four0four
four0four / 01_x.py
Last active May 2, 2022 22:06
Zynq SDIO DMA overflow PoC
#!/bin/env python3
from struct import pack as p
from struct import unpack as up
import time
import sys
inits = [\