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 | |
import struct | |
import sys | |
from Crypto.Hash import SHA1 | |
stage2file = sys.argv[1] | |
outfile = sys.argv[2] | |
stage2 = bytearray(open(stage2file, "rb").read()) |
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 write_payload(uint8_t *ptr) | |
{ | |
/* instructions placed at 0x0C+(0x20*k) | |
* will be corrupted if the 2 least | |
* significant bits are set */ | |
/* clean the area overwritten by the stack overflow | |
* memset( 0x0D40E240, 0, 0xB70 ) */ | |
write32(ptr+0x000, 0xe59f30f8); // ldr r3, [pc, #0xF8] |
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 ISFS_Setup(ISFS *this,int init) | |
{ | |
if (init == 0) | |
return 0; | |
super = ISFS_LoadSuperblock(this); | |
if (!super) | |
return -0x8046F; |
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
ISFS_Superblock *ISFS_LoadSuperblock(ISFS *isfs) | |
{ | |
if ((isfs->initState & 2) == 0) | |
return; | |
if ((isfs->initState & 0x44) == 0x44) | |
return NULL; | |
int latestVersion = 0; |
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
/* gensuperblock.c | |
* | |
* Copyright (C) 2021 rw-r-r-0644 | |
* This file is under GNU GPLv2+ | |
*/ | |
#include <arpa/inet.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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 <iostream> | |
#include <fstream> | |
#include <arpa/inet.h> | |
#include <cstdint> | |
#include <cstring> | |
struct FST_Entry | |
{ | |
char name[12]; | |
uint8_t mode; |
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
; brainfuck.rkt | |
; | |
; A slow, limited, but fun to write brainfuck interpreter in Racket teaching language | |
; Input instructions are not supported | |
; | |
; (language: Intermediate Student with lambda) | |
; | |
; Copyright (C) 2021 rw-r-r-0644 | |
; This code is under GNU GPLv2 |
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
.text | |
@ this code runs at 0x00000048 after boot1 jumps to NULL | |
.global _start | |
_start: | |
@ Patch PRSH checksum (offsets replaced when writing payload) | |
ldr r2, =0xcafe0001 @ prsh_hdr_offset | |
ldr r0, =0xcafe0002 @ checksum_old | |
str r0, [r2] |
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
#!/bin/python3 | |
# manhattan.py | |
# Solves "paths of Manhattan (2d)" problem | |
# | |
# Copyright(C) 2020 rw-r-r-0644 | |
# This file is under GNU GPLv2 | |
import math, sys | |
def tartaglia(n, k): |
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
#!/bin/python3 | |
from PyPDF2 import PdfFileWriter, PdfFileReader | |
from Levenshtein import distance | |
import sys | |
import re | |
# Requires PyPDF2 and python-Levenshtein. | |
# Install them with `pip install PyPDF2 python-Levenshtein | |
# Maximum distance between the same content located in |