Skip to content

Instantly share code, notes, and snippets.

View dev-zzo's full-sized avatar

DJ Sunshine dev-zzo

View GitHub Profile
# http://adamsblog.aperturelabs.com/2013/02/atmel-sam7xc-crypto-co-processor-key.html
# https://ridrix.wordpress.com/2009/09/19/mifare-desfire-communication-example/#comment-27
from binascii import hexlify, unhexlify
from Crypto.Cipher import DES3
def xor(a, b):
x = ''
for i in xrange(8):
x += chr(ord(a[i]) ^ ord(b[i]))
Proxmark3:
proxmark3> hf 14a reader
UID : de ad ba be 11 22 33
ATQA : 03 44
SAK : 20 [1]
TYPE : NXP MIFARE DESFire 4k | DESFire EV1 2k/4k/8k | Plus 2k/4k SL3 | JCOP 31/41
MANUFACTURER : no tag-info available
ATS : 06 75 00 81 02 00 6e 79
- TL : length is 6 bytes
- T0 : TA1 is present, TB1 is present, TC1 is present, FSCI is 5 (FSC = 64)
@dev-zzo
dev-zzo / card1.txt
Last active October 23, 2016 13:56
DESFire traces
UID : 39 66 b0 1f
ATQA : 00 04
SAK : 20 [1]
TYPE : NXP MIFARE DESFire 4k | DESFire EV1 2k/4k/8k | Plus 2k/4k SL3 | JCOP 31/41
ATS : 13 78 80 72 02 80 31 80 66 b1 84 0c 01 6e 01 83 00 90 00 11 d8
- TL : length is 19 bytes
- T0 : TA1 is present, TB1 is present, TC1 is present, FSCI is 8 (FSC = 256)
- TA1 : different divisors are NOT supported, DR: [], DS: []
- TB1 : SFGI = 2 (SFGT = 16384/fc), FWI = 7 (FWT = 524288/fc)
- TC1 : NAD is NOT supported, CID is supported
@dev-zzo
dev-zzo / tutorial.md
Last active February 9, 2023 00:08
ChameleonMini fun

Getting it to work

The device is shipped with test firmware installed. To burn a proper firmware, you will need:

The instructions on the blog page are incorrect because Rev G hardware uses ATxmega128A4U instead of ATxmega32A4U. Why? Probably an outdated version of hardware.

@dev-zzo
dev-zzo / dsp.py
Last active June 4, 2017 19:44
Python vs DSP
"""
A set of simple DSP utilities with abysmal performance
"""
import math
import cmath
import struct
import util
#
"""A simple test for presence of a WCF net.tcp handler on a port"""
import sys
import socket
import struct
def hexdump(data):
"""Pretty print a hex dump of data, similar to xxd"""
lines = []
offset = 0
@dev-zzo
dev-zzo / bum.py
Last active August 18, 2016 14:54
MAGNETO!!!!
import socket
import time
import sys
import http
import magneto
def run_test(target, id):
print
print "* * * * * Starting next test"
@dev-zzo
dev-zzo / _notes.md
Last active September 26, 2016 22:25
Air band receiver

Air band receiver

The main reuiqrements are:

  • Simultaneous reception and demodulation of multiple channels
  • Coverage of the VHF aircraft band, 118.000 through 136.975 MHz (19 MHz bandwidth), channel spacing 25 kHz
  • Demodulation of voice AM, ACARS, and VDL mode 2

Design

@dev-zzo
dev-zzo / mp.c
Last active June 1, 2016 21:38
void matrix_multiply(const data_t *M, const data_t *x, data_t *y, size_t width, size_t height)
{
// assert(height > 0);
// assert(width >= 4);
// assert((width & 3) == 0);
IACA_START;
#if 1
if (height >= 4) {
#include <stdio.h>
#include <malloc.h>
struct _perceptron_t {
size_t weights_count;
float thfunc_param;
float weights[1];
};
typedef struct _perceptron_t perceptron_t;