Skip to content

Instantly share code, notes, and snippets.

#lang rosette/safe
(require rosette/lib/angelic ; provides `choose*`
rosette/lib/destruct) ; provides `destruct`
; Tell Rosette we really do want to use integers.
(current-bitwidth #f)
@5unKn0wn
5unKn0wn / nobranch.sage
Created December 20, 2020 17:34
hxp 2020 write-up
F.<x> = GF(2^8, modulus=GF(2^9).fetch_int((2^8) + 0x1b))
A = Matrix(F, 64, 64)
v = [137, 110, 79, 199, 218, 137, 20, 176, 83, 199, 244, 109, 98, 39, 156, 116, 86, 219, 77, 125, 243, 0, 101, 85, 143, 123, 124, 37, 120, 223, 213, 198, 67, 193, 214, 169, 213, 35, 156, 16, 56, 210, 166, 58, 207, 215, 37, 78, 77, 204, 32, 205, 154, 92, 207, 79, 233, 97, 252, 86, 190, 25, 139, 240]
matrix = [[16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79], [44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107], [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
@stong
stong / cheese.cpp
Last active August 28, 2024 01:26
pbctf 2020: Jiang Ying's Disasssembler author's writeup
// TLDR:
// Whitebox 128-bit rsa with e=17. Input is multiplied by a constant before the RSA
#include <Windows.h>
#include <stdio.h>
#include <stdint.h>
extern "C" void __fastcall rsa_encrypt (uint8_t* in, uint8_t* out);
// 1. Func is ~90kb, and control flow is simple. Should be decompilable just extremely SLOW.
@sdasgup3
sdasgup3 / alltutoroals.md
Last active December 23, 2022 07:53
Few things I am inerested in!