Skip to content

Instantly share code, notes, and snippets.

View Wouterr0's full-sized avatar
😅
Busy AF

Wouterr0

😅
Busy AF
  • Amsterdam, Netherlands
View GitHub Profile
@Wouterr0
Wouterr0 / png_parser.py
Created October 23, 2021 10:19
Python PNG parser
# PNG spec http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html
import argparse
import binascii
import struct
from typing import cast
parser = argparse.ArgumentParser(prog="png_parse",
description="Parse a PNG file and show the file information",
epilog="See http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html for the PNG spec")
@Wouterr0
Wouterr0 / hexdump.c
Last active October 23, 2021 10:19
Hexdump file to stdout
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
#include <math.h>
#define STR_HELPER(x) #x
import matplotlib.pyplot as plt
import numpy as np
min = -5
max = 5
step = .1
width = (max-min)/step
fx0 = lambda x, y: abs(x) + abs(y)