This file contains 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
from struct import pack, unpack | |
# reversed from the challenge | |
def zz_helper(x, y, z): | |
if y > z: | |
return [1, z - x] | |
a, b = zz_helper(y, x + y, z) | |
if b >= x: | |
return [2 * a + 1, b - x] |
This file contains 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
def split_by(data, cnt): | |
return [data[i : i+cnt] for i in range(0, len(data), cnt)] | |
MAX_PATH = 150 # just some guessed estimate, should be fine | |
LEVELS = [ | |
'rbrr rgb rb r brgrbrgb grrgbbg grg bgrg bbgrbg', | |
'rrbrb rg g bgrbgggr ggrgr gr rg brr b bggrbgbb', | |
'rbr bbggrgrggb bggbb b b bbrbbgg gbrrbgrbbb g', | |
] |
This file contains 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
// Solver for CRC Recursive Challenge from Dragon CTF 2021 | |
// Author: Michał "Redford" Kowalczyk | |
// | |
// Could probably be much simpler, but this code was evolving for too long | |
// without a rewrite ¯\_(ツ)_/¯ | |
#include <iostream> | |
#include <cstdio> | |
#include <cstddef> | |
#include <cstring> |
This file contains 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
// +0xABC0 (in .o) | |
bool ensure_calling_only_once_and_set_key_bit( | |
unsigned __int64 addr_to_disasm_if_valid, | |
unsigned int key_bit_ind, | |
unsigned int a3, | |
unsigned int ket_init_unique_id) | |
{ | |
char *addr; // rax | |
char *retaddr; // [rsp+0h] [rbp+0h] |
OlderNewer