Skip to content

Instantly share code, notes, and snippets.

@q3k
q3k / hashes.txt
Last active May 16, 2024 16:49
liblzma backdoor strings extracted from 5.6.1 (from a built-in trie)
0810 b' from '
0678 b' ssh2'
00d8 b'%.48s:%.48s():%d (pid=%ld)\x00'
0708 b'%s'
0108 b'/usr/sbin/sshd\x00'
0870 b'Accepted password for '
01a0 b'Accepted publickey for '
0c40 b'BN_bin2bn\x00'
06d0 b'BN_bn2bin\x00'
0958 b'BN_dup\x00'
@alufers
alufers / README.md
Last active October 16, 2023 10:50
PX5 MTCE headunit reverse engneering notes

Notes

  • Main CPU: rk3368
  • HW model and dts source: Rockchip PX5 EVB V11
  • MCU: STM32F091vct6 (256 Kbytes of Flash memory and 32 Kbytes of SRAM) datsheet image
@the-moog
the-moog / fixexec.py
Last active August 10, 2023 15:03
Python script to fix the "exec format error" seen with tools like gzip in WSL with Ubuntu 22.04 in Q1/Q2 2022
#!/usr/bin/env python
r"""
This script can be used to fix the "exec format error" seen with tools like gzip in
WSL with Ubuntu 22.04 in Q1/Q2 2022
A hacky fix for broken executables in WSL/Ubuntu 22.0
see https://github.com/microsoft/WSL/issues/8219
@Zibri
Zibri / 24c256br.c
Created August 28, 2021 11:09
24c256 backup and restore
/*
Utility to dump and restore a 24c256 eeprom.
(Changing the defines it will work with other eeproms too.)
Remember that 24c256 has 16 bit addressing.
Smaller ones have 8 bit addressing.
By Zibri.
@Informatic
Informatic / cursors.sh
Created April 16, 2021 18:05
simple tool to apply overlayfs over specific directories
#!/bin/sh
# Directory to store overlays in (one directory structure is created per overlay configured down below)
OVERLAY_BASE=/home/root/overlays
overlay() {
set -e
overlay_id="$(echo $1 | sed 's;/;__;g')"
unset TARGET SOURCE FSTYPE OPTIONS
eval $(findmnt -P $1)
@generalmimon
generalmimon / log2_int32.ksy
Created January 30, 2021 14:41
A Kaitai Struct YAML specification for finding the log2 of a 32-bit integer
meta:
id: log2_int32
title: Find the log base 2 of a 32-bit integer
license: CC0-1.0
doc-ref: https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
# params:
# - id: val
# type: u4
seq:
- id: log2
@mnaberez
mnaberez / nec_78k0_flash.md
Last active April 3, 2024 20:24
NEC 78K0 Flash Vulnerability

NEC 78K0 Flash Vulnerability

Overview

The microcontroller that I studied was removed from a Volkswagen car radio manufactured by Delco (now Delphi). The chip had only Delco markings on the package. It was decapsulated and the markings "NEC D78F0831Y" were found on the die. I reverse engineered the device definition files for the NEC toolchain (RA78K0) and determined that the uPD78F0831Y is a subset of a documented chip, the uPD78F0833Y. The '833Y adds 3 more timers, extended I2C functionality, and adds registers that allow firmware running on the '833Y to reprogram the flash ("self-programming"). Otherwise, the '831Y and '833Y are the same.

The uPD78F0831Y uses the NEC 78K0 core. Note that NEC (now Renesas) produced a number of incompatible cores with similar names such as 78K0S and 78K

@kapilgupta101292
kapilgupta101292 / Java mail Create-Delete Appointment
Created June 21, 2019 16:14
Java mail Create/Delete Appointment
public void sendOutlookMail() throws Exception {
String toEmail = "abc@xyz.com";
String fromEmail = "xyz@abc.com";
//register the text/calendar mime type
MimetypesFileTypeMap mimetypes = (MimetypesFileTypeMap) MimetypesFileTypeMap.getDefaultFileTypeMap();
mimetypes.addMimeTypes("text/calendar ics ICS");
@camthesaxman
camthesaxman / irixswextract.c
Created March 17, 2018 19:32
tool to extract IRIX software packages
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
struct Archive
//here is descriptors
//needs interrupt endpoint 1 in, bulk endpoint 2 out, bulk endpoint 3 in
//info from pl2303hx datasheet
/* Device Descriptor */
const USB_DEVICE_DESCRIPTOR device_dsc=
{
0x12, // Size of this descriptor in bytes
USB_DESCRIPTOR_DEVICE, // DEVICE descriptor type
0x0200, // USB Spec Release Number in BCD format