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
########################################################################### | |
# Rotating bits (tested with Python 2.7) | |
from __future__ import print_function # PEP 3105 | |
# max bits > 0 == width of the value in bits (e.g., int_16 -> 16) | |
# Rotate left: 0b1001 --> 0b0011 | |
rol = lambda val, r_bits, max_bits: \ | |
(val << r_bits%max_bits) & (2**max_bits-1) | \ |
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 <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
void xtea_decipher(unsigned int num_rounds, uint32_t v[2], uint8_t const key[4]) { | |
unsigned int i; | |
uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds; | |
for (i=0; i < num_rounds; i++) { | |
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]); | |
sum -= delta; |
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 <stdio.h> | |
#include <stdint.h> | |
void xtea_decipher(unsigned int num_rounds, uint32_t v[2], uint8_t const key[4]) { | |
unsigned int i; | |
uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds; | |
for (i=0; i < num_rounds; i++) { | |
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]); | |
sum -= delta; | |
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]); |
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
data = [0x7A, 0x17, 0x08, 0x34, 0x17, 0x31, 0x3B, 0x25, 0x5B, 0x18, 0x2E, 0x3A, 0x15, 0x56, 0x0E, 0x11, 0x3E, 0x0D, 0x11, 0x3B, 0x24, 0x21, 0x31, 0x06, 0x3C, 0x26, 0x7C, 0x3C, 0x0D, 0x24, 0x16, 0x3A, 0x14, 0x79, 0x01, 0x3A, 0x18, 0x5A, 0x58, 0x73, 0x2E, 0x09, 0x00, 0x16, 0x00, 0x49, 0x22, 0x01, 0x40, 0x08, 0x0A, 0x14] | |
sign = [0x40, 0x66, 0x6C, 0x61, 0x72, 0x65, 0x2D, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, 0x6D] | |
key = '' | |
for i in range(len(sign)): | |
tmp = sign[::-1][i] ^ data[::-1][i] | |
key += chr(tmp) |
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
import hashlib | |
def fire(wood, bounce): | |
meaning = bytearray(wood) | |
bounce = bytearray(bounce) | |
regard = len(bounce) | |
manage = list(range(256)) | |
def prospect(*financial): | |
return sum(financial) % 256 |
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
from z3 import * | |
s = Solver() | |
x = [BitVec("%d" % i, 8) for i in range(16)] | |
h = [115, 29, 32, 68, 106, 108, 89, 76, 21, 71, 78, 51, 75, 1, 55, 102] | |
for i in range(16): | |
s.add(x[i] >= 0x20, x[i] < 0x7f) |
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
from ctypes import * | |
import struct, hashlib | |
def wrong(): | |
trust = open("MEM_00010000_0005E000.mem", "rb").read() | |
ImageBase = 0x00010000 | |
computer = string_at(trust, 1024) | |
dirty, = struct.unpack_from('=I', computer, 60) |
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
def canoodle(panjandrum, arylo, s, bibble): | |
kerfuffle = bytearray() | |
quean = 0 | |
for cattywampus in range(0, len(panjandrum), 4): | |
b1 = int(panjandrum[cattywampus + arylo:cattywampus + arylo + 2], 16) | |
b2 = bibble[quean % len(bibble)] | |
kerfuffle.append(b1 ^ b2) | |
quean += 1 | |
if quean == s: | |
break |
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
def canoodle(panjandrum, arylo, s, bibble): | |
kerfuffle = bytearray() | |
quean = 0 | |
for cattywampus in range(0, len(panjandrum), 4): | |
b1 = int(panjandrum[cattywampus + arylo:cattywampus + arylo + 2], 16) | |
b2 = bibble[quean % len(bibble)] | |
kerfuffle.append(b1 ^ b2) | |
quean += 1 | |
if quean == s: | |
break |
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
def rigmarole(es): | |
furphy = '' | |
for i in range(0, len(es), 4): | |
c = int(es[i:i+2], 16) | |
s = int(es[i+2:i+4], 16) | |
cc = c - s | |
furphy += chr(cc) | |
return furphy |
NewerOlder