Skip to content

Instantly share code, notes, and snippets.

View disconnect3d's full-sized avatar
🎯
deadlocking the reality

Disconnect3d disconnect3d

🎯
deadlocking the reality
View GitHub Profile
@disconnect3d
disconnect3d / numpy_array_attrs_ids.py
Created June 5, 2017 23:09
Helper code for Murmus CTF numpy fuzzing/exploitation stream -> https://www.youtube.com/watch?v=v61uh0NJ4_U
#!/usr/bin/env python
import numpy as np
from types import FunctionType, MethodType, BuiltinFunctionType
n = np.array("ABC")
attr_names = dir(n)
for attr in attr_names:
val = getattr(n, attr)
@disconnect3d
disconnect3d / makefile
Last active January 20, 2025 01:38
Minimal & universal makefile for C language
CC=gcc
CFLAGS=-Wall -Wextra -Wpedantic
LDFLAGS=
SOURCES=$(wildcard *.c )
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=exec
all: $(EXECUTABLE)
./$(EXECUTABLE)
import functools
import inspect
class Bar:
def changelist_view(self, request, extra_content):
print("Bar.changelist_view(request={}, extra_content={})".format(request, extra_content))
def change_view(self, request, object_id, form_url, extra_content):
print("Bar.change_view(request={}, object_id={}, form_url={}, extra_content={})"
#!/usr/bin/env python3
NODE_START = 4
NODE_WIDTH = 6
NODE_START_X = 1 # left of node
NODE_START_Y = 1 # bottom of node
NODE_SHORT_HEIGHT = 1
NODE_LONG_HEIGHT = 1.5
@disconnect3d
disconnect3d / pytest_iter_mock.py
Created September 4, 2017 13:29
Is this the best way to return list like thing?
@pytest.fixture
def mock_time_in_ms(monkeypatch):
def _mock_time_in_ms(values_to_return):
idx = [0]
def _time():
v = values_to_return[idx[0]]
idx[0] += 1
return v
#include <stdio.h>
#include <semaphore.h>
#include <unistd.h>
#include <fcntl.h>
#define INFOFUNC printf("[%d] %s\n", getpid(), __FUNCTION__)
#define INFO(m) printf("[%d] %s\n", getpid(), m)
sem_t* parent_sem;
sem_t* sem;
//BallController.cs
//Created by: <Name Surname>
using UnityEngine;
using System;
using UnityEngine.Assertions;
using Arkanoid.Utils;
namespace Arkanoid.Game
{
/// <summary>
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax@3
int v4; // eax@3
int result; // eax@9
int v6; // eax@23
char **envpa; // [sp+0h] [bp-20h]@1
envpa = (char **)envp;
if ( argc <= 1 )
@disconnect3d
disconnect3d / 300.py
Created January 3, 2018 08:07 — forked from sroettger/300.py
One solution for the 34c3ctf's 300 heap challenge.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# The 300 challenge was a heap challenge that allowed you to make allocations of size 0x300.
# You could free allocations and read/write to them even after they got freed.
# The tricky part about the challenge was that you don't control the size and can't for example use the usual fastbin techniques.
# This exploit overwrites the check_action variable so that the libc doesn't abort on errors anymore.
# Afterwards we can get a write-what-where primitive using unsafe unlink.
@disconnect3d
disconnect3d / babymarvel_z3.py
Created March 29, 2018 12:18
amit94 solution to babymarvel mangle function
from pwn import *
from z3 import *
def demangle(s):
pad0 = [0xeb, 0x88, 0x27, 0x41, 0x90, 0x1e, 0x33, 0x51, 0x98, 0x2b,
0x13, 0x57, 0x18, 0x32, 0x15, 0x17, 0x23, 0x16, 0x41, 0x35,
0x25, 0x31, 0x045, 0x76, 0x0a, 0xa5, 0xcc, 0x81, 0xa0, 0x6b,
0xd4, 0x15];
pad1 = [7424712, 4551408,
8364500, 2965602, 2274639, 10661532,