Skip to content

Instantly share code, notes, and snippets.

View dev-zzo's full-sized avatar

Dmitry Janushkevich dev-zzo

View GitHub Profile
#!/usr/bin/env python3
import sys
import io
from pcsc import PcScTransport
def h2b(x):
return bytes.fromhex(x)
@dev-zzo
dev-zzo / 78k0.780103.cfg
Created January 4, 2024 11:37
IDA Pro config for NEC 780101/780102/780103
.UPD780101
.UPD780102
.UPD780103
; U15836EJ5V0UD00
; MEMORY MAP
area DATA ROM 0x0000:0x6000 Internal ROM
area DATA RAM 0xFC00:0xFF00 Internal High-Speed RAM
area DATA SFR 0xFF00:0x10000 Special Function Register
@dev-zzo
dev-zzo / rotator.py
Created November 22, 2023 19:37
PERFEKTROTATOR for all your rotation needs
import sys
import os
import os.path
import math
from collections import namedtuple
# screw this
os.environ["OPENCV_IO_MAX_IMAGE_PIXELS"] = str(pow(2,40))
import cv2 as cv
PointBase = namedtuple("Point", ("x", "y", "z"), defaults=(0, 0, 0))
@dev-zzo
dev-zzo / nec-renesas.md
Last active February 14, 2023 14:32
Package information for easier checking of remarked MCU p/n

NEC / Renesas MCUs

Distinct feature: pins RESET, XOUT, VSS, XIN, VDD go in a group, and accept a ceramic resonator.

M16C MCUs

Family Packages Doc.no.
M16C/1N 48P6Q-A REJ09B0007
M16C/26 48P6Q REU09B0001
@dev-zzo
dev-zzo / calibrations.md
Last active July 19, 2022 21:18
3D printer calibrations checklist

This is a list of procedures to perform in order to calibrate a FDM/FFF 3D printer.

Heaters PID constants

Perform this calibration to ensure the control algorithms for heating elements do the right job and do not overshoot/undershoot/oscillate.

This only needs to be done once per maintenance period.

  1. Use the M303 E0 S to calibrate the hot end and save the reported values with M301 P I D.
  2. Use the M303 E-1 S to calibrate the bed and save the reported values with M304 P I D.
@dev-zzo
dev-zzo / wiring.md
Last active February 20, 2022 14:00

Total wires: 910

Options:

  • RHD except AU, SG, HK
  • w/ Built-in Amplifier
  • w/ Navigation
  • w/ Side Airbag
  • w/ Front Fog Light
  • w/ Rear Fog Light
  • w/o Cold Area Spec
@dev-zzo
dev-zzo / imperfect-design.md
Last active July 8, 2024 13:37
A curated list of research papers and blog posts on embedded security, keyed by the device p/n

The list below is compiled to inform, guide, and inspire budding security researchers. Oh and to pick something for bedtime reading too.

Included in the list are works on the following topics related to MCU/SoC security:

  • Secure boot
  • Fault injection
  • Side channel attacks

At the end of the list, there is also a section with links to articles of potential general interest, not addressing vulnerabilities in any specific device.

EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# Generic_ONFI_NAND_LGA52
#
DEF Generic_ONFI_NAND_LGA52 U 0 40 Y Y 1 F N
F0 "U" 0 2650 50 H V L BNN
F1 "Generic_ONFI_NAND_LGA52" 0 -100 50 H V L BNN
F2 "Memory:LGA52C100P7X13_UNI" 0 0 50 H I L BNN
F3 "" 0 0 50 H I L BNN

CUPL(WM) 5.0a Serial# MW-10400000
Device g22v10 Library DLIB-h-40-1
Created Tue Jul 28 01:39:30 2020
Name bug
Partno NA
Revision 01
Date 22/04/2020
Designer dj
Company None
@dev-zzo
dev-zzo / betterstruct.py
Last active August 22, 2022 15:40
Simple but better structs for Python :)
import struct
class BetterStructMeta(type):
def __new__(cls, clsname, superclasses, attributedict):
if clsname != 'BetterStruct':
fields = attributedict['__fields__']
field_types = [ _[0] for _ in fields ]
field_names = [ _[1] for _ in fields if _[1] is not None ]
size = 0
for fielddef in fields: