Skip to content

Instantly share code, notes, and snippets.

View dneprDroid's full-sized avatar

Aleksandr Ovechko dneprDroid

View GitHub Profile
@marcan
marcan / m1cat.c
Last active October 26, 2023 15:42
m1cat: a PoC for the M1RACLES covert channel vulnerability in the Apple M1
/*
* m1cat: a proof of concept for the M1RACLES vulnerability in the Apple M1.
*
* This program implements a covert channel that can be used to transmit data
* between two processes when run on the Apple Silicon "M1" CPUs.
*
* The channel is slightly lossy due to (presumably) the scheduler sometimes
* scheduling us on the wrong CPU cluster, so this PoC sends every byte twice
* together with some metadata/framing bits, which is usually good enough.
* A better approach would be to use proper FEC or something like that.
@dneprDroid
dneprDroid / build_webrtc_ios_fat_framework.sh
Last active December 2, 2020 13:25
build webrtc ios fat framework
gn gen out/Release-universal -args='target_os="ios" target_cpu="x64" additional_target_cpus=["arm", "arm64", "x86"] is_component_build=false is_debug=false ios_enable_code_signing=false'
ninja -C out/Release-universal sdk:framework_objc
@dneprDroid
dneprDroid / tg-read.js
Created March 15, 2020 20:32
tg-read.js
Config.Schema.API.methods[Config.Schema.API.methods.findIndex(x=>x.method=="messages.readHistory")].params = [{name: "emperor", type: "InputPeer"}, {name: "nmaid", type: "int"}]
@dneprDroid
dneprDroid / GIT TOKEN
Created January 16, 2020 20:50
GIT TOKEN
git config --global credential.helper store && git fetch --all && cat ~/.git-credentials
@dneprDroid
dneprDroid / show-ports
Created January 15, 2020 20:04
show ports in USE
sudo lsof -i -P -n | grep LISTEN
import Accelerate
/// This object provides easy color sampling of the `capturedImage` property of an ARFrame.
///
/// - Warning: This class is NOT thread safe. The `rawRGBBuffer` property is shared between instances
/// and will cause a lot of headaches if 2 instances try to simultaneously access it.
/// If you need multi-threading, make the shared buffer an instance property instead.
/// Just remember to release it when you're done with it.
class CapturedImageSampler {
@sftekin
sftekin / warping.py
Created December 20, 2019 12:53
Example of torch.grid_sample. Warping implementation
"""
https://discuss.pytorch.org/t/solved-torch-grid-sample/51662
I have used this code.
"""
from torchvision import transforms
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
@fracasula
fracasula / encrypt_decrypt.go
Last active April 11, 2024 13:20
A simple example with Golang that uses AES-128 to encrypt and decrypt messages.
package mycrypto
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"io"
"time"
)
;// store 3822
mov x8, #3822
;// next: (4969 << 16) | 3822
movk x8, #4969, lsl #16 ;// now `x8` is 325652206
;// next: (2 << 32) | ((4969 << 16) | 3822)
movk x8, #2, lsl #32 ;// now `x8` is 8915586798
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import re
import time
from functools import reduce
import pyperclip