Skip to content

Instantly share code, notes, and snippets.

@LegalizeAdulthood
LegalizeAdulthood / PortingFromMFCToWxWidgets.md
Last active November 12, 2023 02:34
Porting from MFC to wxWidgets
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index c512a9e..e9d6f58 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -221,7 +221,7 @@ superdom.c
#endif /* LCD_DEPTH > 1 */
-
+test_disk.c
@cbalint13
cbalint13 / OpenLANE.md
Last active April 1, 2023 16:50
OpenLANE steps
@newhouseb
newhouseb / gray_code.py
Last active August 7, 2021 23:16
2GHz Gray Code Oscillator/Counter
# This is Gray Code oscillator that can be used on Lattice ECP5 devices to measure time down to around 500ps of
# precision (with no manual placement!) using only two (!) slices.
#
# In essence how this works is that we create a self-clocking counter that runs as fast as the FPGA fabric will
# allow. If we were to do this with a traditional counter, we would have to worry about propagation delay because
# multiple bits change at a time. If you use gray-codes, however, only one bit is changing at any given time so
# there are no issues with racing signals.
#
# If you drop this in a design and wire out the highest bit of the async_gray_count signal into a spectrum
# analyzer, you will see a dominant frequency of about 125Mhz. In other words, we cycle through all 16 gray codes
@buttercutter
buttercutter / ddr3_memory_controller.sby
Last active February 12, 2022 03:15
A simple DDR3 memory controller
[tasks]
proof
cover
[options]
proof: mode prove
proof: depth 10
cover: mode cover
cover: depth 40
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
#!/usr/bin/env python3
from collections import namedtuple
import socket
import struct
usbip_user_op_common = namedtuple('usbip_user_op_common', 'version code status')
usbip_usb_device = namedtuple('usbip_usb_device', 'path busid busnum devnum speed idVendor idProduct bcdDevice bDeviceClass bDeviceSubClass bDeviceProtocol bConfigurationValue bNumConfigurations bNumInterfaces')
usbip_header_basic = namedtuple('usbip_header_basic', 'command seqnum devid direction ep')

Removing a Mac's Firmware Password By Reflashing EFI ROM

According to Apple, the only way to remove an unknown firmware password from a MacBook (2011 and later) is to take it to the Apple Store with the original proof-of-purchase. However, I've found that there is another way, which I've been successful with for the unibody MacBook Pro--it's essentially just modifying a couple bytes in the EFI ROM, which should be simple. What's not simple, however, is figuring out how to read and write to the EFI chip. In this post, I'll talk about the process that I figured out and what worked for me.

The Official Method

Apple's method of resetting the firmware password is not reproducible, as Apple generates an SCBO file that unlocks the EFI using their private key. You can read more about this process here. The problem with this system is that, if you are in the unfortunate situation of neither having the firmware unlock pass

@ross-newman
ross-newman / QEMU PPC Setup for Debian
Last active April 29, 2024 18:27
Building PPC Linux code using QEMU on Ubuntu 18.04 LTS
#!/bin/bash
echo "Building Debina 10 QEMU instance..."
wget https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/debian-10.0-powerpc-NETINST-1.iso
sudo apt install qemu
# Create new disk for install
qemu-img create -f qcow2 debian10.qcow2 2000M
# Boot the install image
qemu-system-ppc -L pc-bios -boot d -M mac99 -m 1024 -net nic,model=sungem -net user -hda debian10.qcow2 -cdrom ./debian-10.0-powerpc-NETINST-1.iso -g 1024x768x8
# Run the image
qemu-system-ppc -L pc-bios -boot c -prom-env "boot-device=hd:,\yaboot" -prom-env "boot-args=conf=hd:,\yaboot.conf" \
@daveshah1
daveshah1 / sim.sh
Last active July 15, 2020 09:39
testbench for DQSBUFM
#!/usr/bin/env bash
set -ex
ECP5=/usr/local/diamond/3.10_x64/cae_library/simulation/verilog/ecp5u
TOP=dqsbuf_tb
iverilog -s $TOP -o $TOP -Dmixed_hdl $ECP5/DQSBUFM.v $ECP5/IDDRX2DQA.v tb.v
vvp $TOP