Skip to content

Instantly share code, notes, and snippets.

def solve(f, inverse, period, target, bits):
"""Find some integer n such that f(n) ≈ target where f is periodic and
invertible"""
inverse = inverse(target.n(bits))
period = period.n(bits)
basis1 = [1 * 2**bits, 0, 0, inverse * 2**bits]
basis2 = [0, 1, 0, period * 2**bits]
basis3 = [0, 0, 1, -1 * 2**bits]
# python3 swaperator.py
# Make sure to use CPython!
import ctypes as c
r = lambda x: c.c_size_t.from_address(x).value
n = r((t := r(id(int) + 96)) + 16)
c.c_size_t.from_address(t).value = n
a = 5
import angr
import claripy
# Create a new project with the ./angry binary
project = angr.Project('./angry')
# It's OK if this is a (reasonable) overestimate, but
# it cannot be an underestimate.
flag_len = 50
//Art by :F_P:, C by Nathan
//gcc monke.c && ./a.out
main(_){puts(
&(
1&
_&0
/_&0
/1/11
/1| // .--.
'\6')["m( OO)m"

Keybase proof

I hereby claim:

  • I am nathanfarlow on github.
  • I am nathanfarlow (https://keybase.io/nathanfarlow) on keybase.
  • I have a public key ASBcO4CcJ0qctD8gs8LScX1vG1C3ZjEcrLAgTdvNE3tHaQo

To claim this, I am signing this object:

@nathanfarlow
nathanfarlow / weast.c
Last active February 6, 2020 02:26
weast
// gcc weast.c -o weast
// ./weast
#include<stdio.h>
#include<stdlib.h>
#define t <<34)*29,!x?printf("%s\n",&c):c,y:d;
#define s sizeof(w)*x),srand(y),c=rand()+(1l
#define a main(x+2,~x)+((w)x["L|)\x1d"]<<
#define e c,d=unix>linux;return!(--x&4)?y=
#define w long long
main(int x,int y){w e a s t}