Skip to content

Instantly share code, notes, and snippets.

View synap5e's full-sized avatar

Simon Pinfold synap5e

View GitHub Profile
from Crypto.Cipher import DES
from Crypto.Util.Padding import pad, unpad
from hashlib import md5
IV = b'ABCDEFGH'
KEY = b'DES KEY!'
HASHSEP = b'=++!MD5!++='
SECRET = b'SECRET123'
# -------------------------------------------------------
# Free IP2Location Firewall List by Country
# Source: https://www.ip2location.com/free/visitor-blocker
# Last Generated: 29 Dec 2020 05:25:30 GMT
# [Important] Please update this list every month
# -------------------------------------------------------
14.1.32.0/19
14.1.64.0/19
14.128.4.0/22
14.137.0.0/19

Keybase proof

I hereby claim:

  • I am synap5e on github.
  • I am uint8 (https://keybase.io/uint8) on keybase.
  • I have a public key ASCrq_CVrakVZs1Y5NrEmY04Jcqq_wp_WZW5jKMpvFv_yQo

To claim this, I am signing this object:

@synap5e
synap5e / 0_segment.py
Last active November 20, 2019 02:41
OpenCV OCR segmentation
import cv2
import matplotlib.pyplot as plt
import numpy as np
def main() -> None:
f, (ax1, ax2) = plt.subplots(2, 1)
im = cv2.imread('number_plate.png')

Keybase proof

I hereby claim:

  • I am synap5e on github.
  • I am uint8 (https://keybase.io/uint8) on keybase.
  • I have a public key ASCnO7oPwSx6xO1k9kudx0ng2lHqUmGXVQH5ZJi2Yd4b6wo

To claim this, I am signing this object:

@synap5e
synap5e / source_sdk_afl.txt
Created July 26, 2016 19:57
Build vtfdiff with afl-gcc
simon@sol ~/source $ ./steam-runtime-sdk_2013-09-05/setup.sh
======================================
Which architectures would you like to target?
1) i386 (x86 32-bit)
2) amd64 (x64 64-bit)
3) all supported architectures
Default i386:
Set target architecture to: i386
======================================
sqlite> select address, (select count(*) from crash c2 where c2.campaign_id = 4 and c2.address = c1.address), faulting_instruction from crash c1 where campaign_id = 4 and crash_in_debugger = 1 group by address;
4279108 | 1 | 0x414b44 <DestroyImages+196>: mov rax,QWORD PTR [rbx+0x1568]
4412504 | 140 | 0x435458 <SyncImage+536>: movzx esi,WORD PTR [rcx+rax*8]
4645403 | 7 | 0x46e21b <ReadPCXImage+4267>: mov WORD PTR [r12-0x90],r8w
4649772 | 3 | 0x46f32c <ReadPCXImage+8636>: movzx esi,BYTE PTR [rax-0x1]
4649840 | 21 | 0x46f370 <ReadPCXImage+8704>: or BYTE PTR [rdx],dil
4651389 | 1 | 0x46f97d <ReadPCXImage+10253>: mov BYTE PTR [rbx],bpl
4651411 | 14 | 0x46f993 <ReadPCXImage+10275>: mov WORD PTR [rbx+0x4],r11w
4651615 | 1 | 0x46fa5f <ReadPCXImage+10479>: movzx ebp,BYTE PTR [r8]
4651619 | 1 | 0x46fa63 <ReadPCXImage+10483>: movzx r13d,BYTE PTR [r8+0x1]
public void translate(Expr.RecordAccess e, Location target, Context context) {
// Determine the field offset
Type.Record type = (Type.Record) typeOf(e.getSource());
int offset = getFieldOffset(type, e.getName());
// Translate source expression into a temporary stack location. This is
// unfortunately a little inefficient in some cases, as we could
// potentially avoid all memory usage. But, it will do for now!
// Note that 'llocateLocation' modifies the stack pointer so it invalidates
// 'target' if target is stack relative.
void main() {
{{{int z} y} x} a = {x:{y:{z:1}}};
{{{int z} y} x} b = a;
assert a == b;
b.x.y = {z:2};
assert a != b;
b.x.y.z = 1;
assert a == b;
int[][][] p = [[[1, 2], [3, 4]], [[5, 6]], [[7]]];
//--------------------------------------
//--- 010 Editor Binary Template
//
// File: FSB5.bt
// Author: Simon Pinfold
// Purpose: Parses the FSB5 (v0 and v1) audio container.
//--------------------------------------
BitfieldDisablePadding();