Skip to content

Instantly share code, notes, and snippets.

View own2pwn's full-sized avatar
🌴
On vacation

own2pwn

🌴
On vacation
View GitHub Profile
@own2pwn
own2pwn / SharedCache.swift
Created May 3, 2019 16:53
Abstract Signal
//
// SharedCache.swift
// Quick-pg
//
// Created by Evgeniy on 01/05/2019.
// Copyright © 2019 surge. All rights reserved.
//
import Foundation
public final class SpendModel: RealmModel {
// MARK: - Properties
@objc public dynamic var string = ""
// MARK: - Init
public convenience init(with string: String) {
self.init()
self.string = string
open class RealmModel: Object {
// MARK: - Properties
@objc dynamic var id: Int = nextID()
// MARK: - Internal
private static func nextID() -> Int {
return RealmService.shared.nextID(for: self)
}
public final class RealmService {
public var realm: Realm {
return try! Realm()
}
// MARK: - Interface
public func nextID<Model: Object>(for modelType: Model.Type) -> Int {
let className = String(describing: modelType)
//
//
// GooglePromiseTests.swift
// PromiseTests
//
// Created by Evgeniy on 06.02.18.
//
import Promise
import XCTest
@own2pwn
own2pwn / DmaHvBackdoor.c
Created January 12, 2018 07:38 — forked from Cr4sh/DmaHvBackdoor.c
Hyper-V backdoor for UEFI
/*
*********************************************************************
Part of UEFI DXE driver code that injects Hyper-V VM exit handler
backdoor into the Device Guard enabled Windows 10 Enterprise.
Execution starts from new_ExitBootServices() -- a hook handler
for EFI_BOOT_SERVICES.ExitBootServices() which being called by
winload!OslFwpKernelSetupPhase1(). After DXE phase exit winload.efi
transfers exeution to previously loaded Hyper-V kernel (hvix64.sys)
@own2pwn
own2pwn / ethereum_graphs.py
Created January 9, 2018 19:27 — forked from pdaian/ethereum_graphs.py
Ethereum Fork Market Data Graphing Script
import datetime, requests
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import json, collections, os
UTC_OFFSET = -14400 # Local offset from UTC
START_DATE = "2016-01-01" # Day to start chat
TMP_DIR = "/tmp" # Writable temp directory, without trailing slash
@own2pwn
own2pwn / spectre.c
Created January 4, 2018 22:38 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
#import <Foundation/Foundation.h>
typedef uint64_t CGSSpace;
typedef uint64_t CGSManagedDisplay;
typedef int CGSConnection;
typedef enum _CGSSpaceSelector {
kCGSSpaceCurrent = 5,
kCGSSpaceOther = 6,
kCGSSpaceAll = 7
@own2pwn
own2pwn / gist:21a64eddd8f4f53ab89251835bfdf9da
Created November 25, 2017 13:38 — forked from hfossli-agens/gist:4676773
dispatch_after with repeat / loop
static void dispatch_repeated_internal(dispatch_time_t firstPopTime, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop))
{
__block BOOL shouldStop = NO;
dispatch_time_t nextPopTime = dispatch_time(firstPopTime, (int64_t)(intervalInSeconds * NSEC_PER_SEC));
dispatch_after(nextPopTime, queue, ^{
work(&shouldStop);
if(!shouldStop)
{
dispatch_repeated_internal(nextPopTime, intervalInSeconds, queue, work);
}