Skip to content

Instantly share code, notes, and snippets.

@v3l0c1r4pt0r
v3l0c1r4pt0r / bmw_vin_from_all.py
Created August 23, 2026 18:53
Scapy script to query all ECUs in a network for VIN (via ENET cable)
import socket
import select
from scapy.all import StreamSocket
from scapy.packet import Raw
from scapy.utils import hexdump
from scapy.compat import raw
from scapy.packet import bind_layers
from scapy.layers.inet import TCP
from scapy.contrib.automotive.bmw.hsfz import HSFZ
from scapy.contrib.automotive.uds import UDS, UDS_RDBI, UDS_DSC
@v3l0c1r4pt0r
v3l0c1r4pt0r / hello.asm
Created February 13, 2025 16:56
Hello World for legacy BIOS
; build with: nasm hello.asm
org 7c00h
mov ah, 3h
mov bh, 0
int 10h
mov ax, cs
mov es, ax
mov cx, hello#
mov bh, 0
mov dh, 0
@v3l0c1r4pt0r
v3l0c1r4pt0r / dm9601.lua
Created August 21, 2022 10:22
Wireshark dissector for DM9601 USB to Ethernet adapter chips
-- DM9601 dissector for Wireshark
--
-- Usage: wireshark -X lua_script:dm9601.lua
--
p_dm9601 = Proto("dm9601", "DM9601 USB Protocol")
p_dm9601_ethin = Proto("dm9601_ethin", "DM9601 USB Protocol Ethernet Input Stream")
p_dm9601_ethout = Proto("dm9601_ethout", "DM9601 USB Protocol Ethernet Output Stream")
p_dm9601_irq = Proto("dm9601_irq", "DM9601 USB Protocol Interrupts")
local operations = {
@v3l0c1r4pt0r
v3l0c1r4pt0r / txt2pcap.py
Created August 1, 2022 17:08
Convert DSView TXT dump of USB packet fields into valid PCAP file
#!/usr/bin/env python3
# convert DSView TXT dump of USB packet fields into valid PCAP file
import re
import sys
import struct
import os
from enum import IntEnum
class PCAP_Header():
@v3l0c1r4pt0r
v3l0c1r4pt0r / places2html.py
Created March 7, 2021 15:02
Convert places.sqlite to bookmarks.html (allows import from Firefox for Android to Chrome/Chromium)
#!/usr/bin/env python3
# convert places.sqlite to bookmarks.html
import sqlite3
import sys
import json
if len(sys.argv) < 2:
print('Usage: {} places.sqlite > bookmarks.html'.format(sys.argv[0]))
sys.exit(1)
@v3l0c1r4pt0r
v3l0c1r4pt0r / pm-multi.sh
Created February 1, 2021 16:39
Script for installing multi-APK applications in Android (requires root)
#!/system/bin/sh
# install multi-file apk with pm
if [ "$(id -u)" -ne 0 ]; then
echo "Access denied!"
exit 1
fi
if [ $# -lt 2 ]; then
echo "Usage: $0 name apk [[[apk] apk] ...]"
exit 1
@v3l0c1r4pt0r
v3l0c1r4pt0r / microwire.ino
Created December 13, 2020 17:18
Microwire sketch for Digispark
#include <DigiCDC.h>
#include <MicrowireEEPROM.h>
/*
* +-----+---------+
* | Pin | Func |
* +-----+---------+
* | P0 | DO/DI |
* +-----+---------+
* | P1 | CLK/LED |
@v3l0c1r4pt0r
v3l0c1r4pt0r / GF-07.cfg
Last active May 19, 2024 16:59
Scatter file for GF-07 GPS device (3MB NOR flash)
general:
config_version : alpha
platform: MT62xx
boot_region:
alignment: block
rom:
- file: bl_mt62xx_by_dfgigger.bin
external_memory:
@v3l0c1r4pt0r
v3l0c1r4pt0r / smaz.c
Last active September 2, 2019 19:01
SMAZ package decompressor (Work In Progress)
// compile with:
// $ gcc -o smaz smaz.c -Iucl-1.03/include -lucl -Lucl-1.03/build/src/.libs
// or if you have ucl in system:
// $ gcc -o smaz smaz.c -lucl
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <ucl/ucl.h>
@v3l0c1r4pt0r
v3l0c1r4pt0r / bmp.py
Created January 30, 2019 18:47
Quick and dirty bitmap format support using makeelf classes
from makeelf.type.uint16 import uint16
from makeelf.type.uint32 import uint32
## \class BITMAPFILEHEADER
# \brief Bitmap main header
# \see https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-bitmapfileheader
class BITMAPFILEHEADER:
def __init__(self, bfType=0x4d42, bfSize=0, bfReserved1=0, bfReserved2=0,
bfOffBits=0, little=False):