Skip to content

Instantly share code, notes, and snippets.

@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 = [\
@four0four
four0four / 0_PoC.png
Last active February 12, 2022 09:31
zynq exploit loader shellcode
0_PoC.png
@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 / main.c
Last active September 18, 2020 07:27
NA202MD08BC driver
#include <stdint.h>
#include <string.h>
#include <avr/io.h>
#include <avr/interrupt.h>
/*
* NA202MD08BC pinout:
* 1 2
* [-----|-----]
* [ vcc | vcc ]
@four0four
four0four / urjtag-python3fix.patch
Created December 15, 2019 00:28
Patch to fix up urjtag python3 support
diff -Naur urjtag-2018.09.orig/bindings/python/chain.c urjtag-2018.09/bindings/python/chain.c
--- urjtag-2018.09.orig/bindings/python/chain.c 2018-09-25 14:32:40.583308869 -0700
+++ urjtag-2018.09/bindings/python/chain.c 2018-09-25 14:33:31.924518776 -0700
@@ -243,7 +243,7 @@
urj_pyc_partid (urj_pychain_t *self, PyObject *args)
{
urj_chain_t *urc = self->urchain;
- int partno;
+ unsigned int partno;
if (!PyArg_ParseTuple (args, "i", &partno))
@four0four
four0four / bfcpu.v
Created May 16, 2016 21:30
terribad BFCPU
/* 8 bit brainfuck cpu
** Author's note: This is a really bad processor. It does all sorts of stupid/bad things in the aim of brainfucking hardware.
** codeMem -> 3 bit wire, input opcodes from code memory
** codeAddr -> 8 bit address, current pc (usually)
** dataMem -> 8 bit read/write to the working array
** dataAddr -> 8 bit address to working array
** !USE READ FIRST!
*/
@four0four
four0four / auto-patch.py
Last active January 15, 2016 13:12
EagleCAD 7.5.0 patcher script
#!/usr/bin/python2
import sys
import md5
if len(sys.argv) < 2:
print "Usage: " + sys.argv[0] + " [eagle 7.5.0 binary]\nWindows patches will be applied if .exe"
sys.exit()
# offsets
@four0four
four0four / mega324
Last active December 9, 2015 23:08
couple AVR UART examples
/*
* mega324_UART.c
*
* Created: 12/28/2011 10:39:01 PM
* Author: Galen
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/power.h>
@four0four
four0four / PKGBUILD
Last active November 16, 2015 06:29
ec2drv PKGBUILD
# Maintainer: Galen Schretlen <galen@shellspace.net>
pkgname=ec2drv-git
pkgdesc="ec2drv provides Linux support for the Silicon Laboritories EC2 serial debug adaptor."
_sourcename="ec2"
pkgrel=1
pkgver=86ffac6
arch=('i686' 'x86_64')
url="https://github.com/four0four/ec2"
license=('GPL')
depends=('python2' 'boost-libs' 'readline' 'libusb')