This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
CFLAGS=-Wall -Wextra -Wpedantic | |
LDFLAGS= | |
SOURCES=$(wildcard *.c ) | |
OBJECTS=$(SOURCES:.c=.o) | |
EXECUTABLE=exec | |
all: $(EXECUTABLE) | |
./$(EXECUTABLE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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={})" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BallController.cs | |
//Created by: <Name Surname> | |
using UnityEngine; | |
using System; | |
using UnityEngine.Assertions; | |
using Arkanoid.Utils; | |
namespace Arkanoid.Game | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |