Skip to content

Instantly share code, notes, and snippets.

View th0rex's full-sized avatar

Timo von Hartz th0rex

View GitHub Profile
@th0rex
th0rex / mix_columns.cpp
Last active December 13, 2017 18:17
AES
// Compile with: clang++ -std=c++17 -O3 mix_columns.cpp -o mix_columns
// Run with: ./mix_columns
#include <stdint.h>
#include <array>
#include <iomanip>
#include <iostream>
#include <string>
@th0rex
th0rex / crack.rs
Last active November 26, 2017 13:20
// Compile with:
// rustc -C opt-level=2 -C debuginfo=2 -o crack crack.rs
// Run with:
// ./crack
fn bit_move(input: u64, from_index: u64, to_index: u64) -> u64 {
let c = (input >> (64 - from_index)) & 1;
c << (64 - to_index)
}
data = bv.read(0x8049a80, 0xd6)
last_char = 0x22
string = '"'
for char in data[1::2]:
current = ord(char) ^ last_char
last_char = current
string += chr(current)
print("result: {}".format(string))
@th0rex
th0rex / main.cpp
Last active April 12, 2017 21:28
linq stuff
#include <algorithm>
#include <experimental/optional>
#include <iostream>
#include <vector>
#include <random>
using std::experimental::make_optional;
using std::experimental::optional;
template <class... F>
@th0rex
th0rex / cross-compile.sh
Created December 8, 2016 14:46
Rust crosscompile windows
cargo rustc --release --target i686-pc-windows-gnu -- -C link-args=-lpthread -C panic=abort