Skip to content

Instantly share code, notes, and snippets.

View adrian17's full-sized avatar

Adrian Wielgosik adrian17

View GitHub Profile
diff --git a/core/src/avm2/activation.rs b/core/src/avm2/activation.rs
index ae72dceb9..89b3464f4 100644
--- a/core/src/avm2/activation.rs
+++ b/core/src/avm2/activation.rs
@@ -35,6 +35,8 @@ use swf::avm2::types::{
use super::error::make_mismatch_error;
+static mut STATS: [u32; 256] = [0; 256];
+
@adrian17
adrian17 / kanji_easy.json
Last active June 2, 2023 18:43
kanji data for NHK News Web Easy
{
"desc": "kanji frequency for NHK News Web Easy, 1855 articles from 2014-12-02 to 2016-07-15",
"source": "https://gist.github.com/adrian17/836b97ee5740b20e63edbe35251d6bc1",
"label": "easy news",
"total": 158118,
"list": [
[
"人",
5093
],
@adrian17
adrian17 / kakuro.py
Created February 23, 2015 14:40
Kakuro solver in Python
import itertools
from copy import deepcopy
def possible_combinations(values, n, total):
# generate all combinations of given values with given sum
return [combination for combination in itertools.combinations(values, n) if sum(combination) == total]
def make_aval(board, clues):
"""
Generates a set of all digits you can use in each cell, just like you do in sudoku board
@adrian17
adrian17 / brainfuck.cpp
Last active October 24, 2022 17:37
Brainfuck compiler with LLVM
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/TargetSelect.h"
@adrian17
adrian17 / writeup.md
Last active July 2, 2021 14:51
Różdżka Chaosu ctfd.rozdzka.securing.pl writeup

https://ctfd.rozdzka.securing.pl/ https://vallheru.rozdzka.securing.pl/

Jak na CTFa, to wydawał się dość prosty - szczególnie dla mnie, laika bez doświadczenia. Wszystkie zadania były "jednowarstwowo" trudne, do wielu trudniejszych można znaleźć write-upy podobnych zadań w internecie. Strona jest forkiem open-sourcowego silnika a autorzy CTFa udostępnili większość źródeł .php, więc można było wręcz po prostu diffować oryginalne pliki z plikami CTFa żeby zobaczyć gdzie dodali luki.

Web

Witamy w Dębinie (10): Login w HTMLu strony głównej, hasło automatycznie wypełnione.

@adrian17
adrian17 / patcher.py
Created July 22, 2014 11:15
TH autobomb patcher
import shutil
import os
games = [
{"name": "th10", "offset": 0x25013, "data": [0xf6, 0x05, 0x5c, 0x4e, 0x47, 0x00, 0x02, 0x0f, 0x84, 0x52, 0x01, 0x00, 0x00]},
{"name": "th11", "offset": 0x30679, "data": [0xf6, 0x05, 0xc0, 0x93, 0x4c, 0x00, 0x02, 0x0f, 0x84, 0xd5, 0x02, 0x00, 0x00]},
{"name": "th12", "offset": 0x3619b, "data": [0xf6, 0x05, 0xd0, 0x49, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0xe8, 0x01, 0x00, 0x00]},
{"name": "th125", "offset": 0x3ace8, "data": [0xf6, 0x05, 0x10, 0xb2, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0xf9, 0x00, 0x00, 0x00]},
{"name": "th13", "offset": 0x42925, "data": [0xf6, 0x05, 0x14, 0x4c, 0x4e, 0x00, 0x02, 0x0f, 0x84, 0x2c, 0x01, 0x00, 0x00]},
{"name": "th14", "offset": 0x4d2c4, "data": [0xf6, 0x05, 0x9c, 0x8a, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0x00, 0x01, 0x00, 0x00]}
printf 'à____]\0k“ôç¹ñ6$s8,gã®]•TÍNäsÐÐs«Ò܍@:ñ=/¸Â-¶ ‡ß9¿Í~ë¬PJdÆv³—Q›¹­E¶çøäkƒ5bÉoŠ€ÁÚN®È@ëPuÞ¨Ä3׶*<§†N]¥:µV»jUÑÁYÑ.qGÄ
uá–vPå.úU!Ð\äŒÞ, ìÓè¬_'|xz -dqqFraw
#include <iostream>
#include <string>
#include <regex>
int main() {
std::regex pattern(R"((\d+) #(.+)# (\d+) ([\d.]+))");
std::string line = "83 #Electric Sander# 7 57.00";
// imagine that's inside the while() loop
#include <string>
#include <iostream>
#include <vector>
#include <utility>
#include <chrono>
#include <unordered_set>
using namespace std::chrono;
@adrian17
adrian17 / ub14.txt
Last active November 10, 2016 08:54
import timeit
import time
import subprocess
lines = [
"a = ''",
"a = ' '",
"a = ' '",
"a = 'a'",
"a = 'a b a b '*100",