Skip to content

Instantly share code, notes, and snippets.

@stek29
stek29 / 0_ropemporium.md
Last active January 4, 2018 20:59
ropemporium

ROP Emporium

import struct
def dumpx(x): return (''.join(map(lambda x: '\\x%02x'%x, struct.pack('<Q', x))))
def d(x): print ('print "%s";' % dumpx(x))
  • remove all packages except core ones which are dangerous to remove
  • iterate over .list files, build list of all files to be removed
  • filter out some critical from those
  • remove all files and empty directories which are in that list from disk, pop them from that list on removal
  • keep doing previous step until list is empty, or there are no empty directories left in it
  • print out list leftovers and ask user to handle them manually
from PIL import Image
import struct
# https://msdn.microsoft.com/en-us/library/windows/desktop/dd390989(v=vs.85).aspx
red_mask = 0xF800;
green_mask = 0x7E0;
blue_mask = 0x1F;
def rgb565pixunpack(pixel):
r = (pixel & red_mask) >> 11;
set scnds to (time of (current date))
set timeOfDay to item ((scnds div 21600 as integer) + 1) of {"night", "morning", "afternoon", "evening"}
set userName to (item 1 of (words of (long user name of (system info))))
say "Good " & timeOfDay & ", " & userName & "." using "Alex" speaking rate 170 modulation 70 pitch 39
// File:
// click.m
//
// stek29 2015
//
// Compile with:
// cc -o click click.m -framework ApplicationServices -framework Foundation
//
// Usage:
// ./click x_cord y_cord
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.

public domain but no liability blah blah

Error codes

According to Webogram (And TDesktop a bit)

  • 400 -- Bad request (Almost all errors)
  • 401 -- Unauthorized
  • 403 -- Forbidden
  • 404 -- Not found
  • 406 -- Network
  • 420 -- Flood
  • 500 and greater -- "Temporary" errors
import telethon.sync
from telethon.tl.types import WallPaper
from telethon.tl.functions.account import GetWallPapersRequest
# see telethon docs to get client
w = client(GetWallPapersRequest())
for i, wp in enumerate(w):
@stek29
stek29 / 0UniversalPaperclips.md
Last active October 27, 2018 21:33
Universal Paperclips related scrips

See Universal Paperclips

qbot.js

"non-cheat" quantum computing bot (makes decisions based on chip opacity, without accessing game's internal variables)

qtoggle.js

Add "toggle" button to quantum computing