Skip to content

Instantly share code, notes, and snippets.

openpgp4fpr:EB17F5FE0814E75C89E3B52D28E26A2651650BF6

@dzwdz
dzwdz / rar.py
Created January 13, 2024 14:07
find SFX RAR header
import sys, struct
### some helper functions ###
def die(*args):
print(*args)
exit(0)
def pread(fp, size, offset):
fp.seek(offset)
return fp.read(size)
@dzwdz
dzwdz / decode.cpp
Created September 5, 2023 22:27
VB/VAG PS2 audio decoder from tinyted.net/eddie/decode.cpp
/* Obtained from https://web.archive.org/web/20080201201739/tinyted.net/eddie/decode.cpp
* Useful for extracting audio from PS2 games. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct VAGState
{
VAGState() { Reset(); }
#!/bin/sh
set -eu
if [ ! -f /etc/spiped/sshd.key ]; then
echo generating key...
mkdir -p /etc/spiped
dd if=/dev/urandom of=/etc/spiped/sshd.key bs=32 count=1
else
echo key already present.
monero:88pSCufgs5VQwB4eFjXMoMBhuLEC7v3JN2nua7CXVXXQVhsvxRYeCmaJU2Kd4oWk2JJ34wJc39vBnCyJe9wKeBxkHUJ5aZ5
@dzwdz
dzwdz / main.c
Created September 11, 2022 12:53
libext2fs basic usage
#include <stdio.h>
#include <sys/types.h> /* required by ext2fs.h */
#include <ext2fs/ext2fs.h>
#define die(...) do {fprintf(stderr, __VA_ARGS__); exit(1);} while (0)
static int dir_iter(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *userdata) {
printf("dir_iter '%.*s', inode %u\n", dirent->name_len, dirent->name, dirent->inode);
return 0; /* the iteration stops when the return is negative */
@dzwdz
dzwdz / diff1.c
Last active December 22, 2021 22:57
fuck() { for (void;;sizeof(char)){{{;
do {} while(({break;sizeof(char);}));
return sizeof(char)+sizeof(char);}}};
return sizeof(char)-sizeof(char);{}};
char*s="gcc\0clang";
main() { puts(fuck() + s + fuck());};