Skip to content

Instantly share code, notes, and snippets.

Avatar

Aris Adamantiadis arisada

View GitHub Profile
View efw.py
#!/usr/bin/env python3
import usb.core
import usb.util
import usb.control
import time
cmd_calibrate = [0x03, 0x7e, 0x5a, 0x01, 0x01]
#bidirectional
cmd_setpos_bi = [0x03, 0x7e, 0x5a, 0x01, 0x3]
@arisada
arisada / sortpics.py
Created June 20, 2022 10:21
Sort Sony ARW files for astrophotography
View sortpics.py
#!/usr/bin/env python3
"""
Automatically move Sony ARW raw files into directories based on the guessed
content (brut/flat/offset/dark/darkflat).
Usage: ./sortpics.py *.ARW
"""
import sys
import os
View rmseq.py
#!/usr/bin/env python3
import sys
import os
"""
Deletes all FIT files from a Siril sequence file (.seq)
"""
def parse_seq(seq):
View montyhall.py
#!/usr/bin/env python3
import random
change_strategy, stay_strategy = 0, 0
for i in range(1000):
v = [True, False, False]
random.shuffle(v)
print("Solution:", v)
firstchoice = random.choice([0, 1, 2])
View findthebug.c
void compute_session_keys(uint8_t encryptkey[AES128_KEY_LEN],
uint8_t master_key[AES128_KEY_LEN],
uint8_t encryption_salt[8]){
uint8_t long_encryptkey[SHA256_DIGEST_LEN];
HMAC_SHA256_CTX ctx;
HMAC_SHA256_Init(&ctx, master_key, sizeof(master_key));
HMAC_SHA256_Update(&ctx,encryption_salt, 8);
HMAC_SHA256_Update(&ctx, "encryption", 10);
@arisada
arisada / constructor-nocd.py
Created October 17, 2018 18:32
NOCD patch for Constructor (1997)
View constructor-nocd.py
#!/usr/bin/env python
# This script will let you play constructor without the CD
# in the drive. My retrogaming laptop has no CD drive.
f = open("GAME.EXE").read()
patches = [
(272174,"\x74","\xeb"),
(642050,"\x83\x3d\x88\x3b\x04\x00\x00","\x90\x90\x90\x90\x90\x90\x90"),
(750753,"\x75","\xeb"),
(750850,"\xfa\xff\xff\xff","\x00\x00\x00\x00"),
(750887,"\x74","\xeb"),
@arisada
arisada / rhme3_quals_xp.py
Last active August 28, 2017 22:30
rhme3_quals_xp.py
View rhme3_quals_xp.py
#!/usr/bin/env python3
import struct
from libctf import *
port=1337
atoi_got = 0x603110
#ubuntu 14.04
View secuprim.py
#!/usr/bin/env python3
from libctf import *
import subprocess
process=subprocess.Popen(["./secuprim", "3l6f2tUN3Ix7k9TY4v0dLv",
"e6c2f738459e25670d3d46785f2e4496"], stdout=subprocess.PIPE)
print(process.stdout.read()[:4])
process.kill()
View keybase.md

Keybase proof

I hereby claim:

  • I am arisada on github.
  • I am aris (https://keybase.io/aris) on keybase.
  • I have a public key ASBt7AuYECwQQNI2SRMk2FGvjjhwJS7cryM8OkrVpoZ2rQo

To claim this, I am signing this object:

View maketuple.py
#!/usr/bin/env python3
from collections import namedtuple
def maketuple(name, params, data):
tclass=namedtuple(name, params)
d = tclass._make(data[i] for i in params.split(' '))
return d
data = {