Skip to content

Instantly share code, notes, and snippets.

View Sasszem's full-sized avatar
💥
Burning the dynamite at both ends

László Baráth Sasszem

💥
Burning the dynamite at both ends
  • Szolnok, Hungary
View GitHub Profile
@Sasszem
Sasszem / libhackrf_tx_fm_triangle.c
Created December 18, 2022 09:13
Transmit a 440Hz triangle wave through FM using the libhackrf API
#include <libhackrf/hackrf.h>
#include <math.h>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <complex.h>
#include <stdint.h>
const double f_mod = 440;
const uint64_t sample_rate = 10000000;

Rescue Rover (shareware) maps

Map images of the game "Rescue Rover (1991)"

Used GIMP and Tiled to create the map images. Tile images were extracted via screenshoting DosBox. Used the game version from PlayDosGames. Map images and TILED files included.

@Sasszem
Sasszem / image_mixer.py
Created December 10, 2021 16:21
Create "fake-preview" images (similar to this one: https://www.reddit.com/r/rickroll/comments/ls99p2/wheres_waldo/). Requires the Pillow package!
import struct
import zlib
from PIL import Image
import click
import io
GAMMA = 0.08
DESAT_RATE = 0.4
################################################################################
@Sasszem
Sasszem / bf2c.py
Created September 10, 2021 20:36
Optimizing bf2c compiler in python. Possibly not 100% working. Gave up on fixing cuz' I got bored on it.
from dataclasses import dataclass, field, replace
import typing
from collections.abc import Iterator
from enum import Enum
from collections import defaultdict
#######################################
# Base classes for storing operations #
#######################################
@Sasszem
Sasszem / unfucker.py
Created August 10, 2021 10:49
RPGMAKER 2k(3) "protection" unfucker so you can open games in the editor
import os
EXTENSIONS = ("lmu", "ldb", "lmt")
GOOD_DATA = {
"lmu": b"\x0aLcfMapUnit",
"ldb": b"\x0BLcfDataBase",
"lmt": b"\x0aLcfMapTree",
}
@Sasszem
Sasszem / xstrings.py
Created May 15, 2021 15:14
Like strings, but also searches (and bruteforces) single-byte XOR. Might be useful for CTFs. Uses click!
#!/bin/env python3
"""
import subprocess
def strings(data):
process = subprocess.Popen(["strings"], stdin=subprocess.PIPE,stdout=subprocess.PIPE)
print("Created process")
process.stdin.write(data)
process.stdin.close()
@Sasszem
Sasszem / bf.py
Created April 25, 2021 20:49
Simple BF interpreter to test the new 3.10 pattern matching
"""
BF interpreter in python, coded in half an hour just for fun
Warning! Python 3.10 is required!
"""
from sys import stdin, stdout
class BFPreter:
"""BD interpreter for a program"""
def __init__(self, program):
@Sasszem
Sasszem / switch.js
Created April 17, 2021 10:30
A simple experiment with JS switch-case statements
/*
Test on how are JS's switch-cases are working.
I was in an argument w/ someone saying they turn into jumptables,
so I coded this up quickly to check.
With a few calls (so JIT won't kick in) it is clear that this executes
every case every time we enter the switch, so it is clear that jump tables
are not used in general, but they still might be used as an optional optimization,
but only when possible.
*/
@Sasszem
Sasszem / ledremote.ino
Created March 17, 2021 12:47
Minimal example that shows tne basics of remote-controlled electornics
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#ifndef STASSID
#define STASSID "MY-SSID"
#define STAPSK "PASSWORD"
#endif
@Sasszem
Sasszem / pwnme.c
Last active January 28, 2021 01:15
Pwn me - do not modify the source, but make it print the "you won" text! Use Linux/WSL!
#include <stdio.h>
int main() {
long admin = 0;
long s;
char name[100];
fprintf(stdout, "\e[41mDEBUG:\e[49m %p\n", &s);
fprintf(stdout, "\e[41mDEBUG:\e[49m %ld %ld\n", sizeof s, sizeof &s);
printf("Whats ur name? ");
scanf("%100s", name);