Skip to content

Instantly share code, notes, and snippets.

import math
from multiprocessing import Pool
def owf(input):
output = ""
input = input*input*input
key = str(input*3)
exprime = ["2","3","5","7"]
input = list(str(input))
for index, digit in enumerate(input):
import sys
import os
import tempfile
import binascii
from PIL import Image
if __name__ == '__main__':
filename = sys.argv[1]
tempdir = tempfile.mkdtemp()
temppath = tempdir + os.path.basename(filename)
@haxelion
haxelion / Resolve Relocation.py
Created October 12, 2016 09:37
Hopper v3 script to resolve relocation using readelf and c++filt. Put it in Hopper script directory to use it (under linux ~/GNUstep/Library/ApplicationSupport/Hopper/Scripts)
import subprocess
import re
doc = Document.getCurrentDocument()
segment = doc.getCurrentSegment()
binary = doc.getExecutableFilePath()
mangled = subprocess.check_output(['readelf', '-rW', binary])
filt = subprocess.Popen(['c++filt'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output = filt.communicate(mangled)
#![feature(simd)]
extern crate rand;
extern crate time;
mod lin_alg;
use lin_alg::Quat;
use rand::Rng;
fn main(){
let mut rng = rand::XorShiftRng::new_unseeded();
EXPECTED = "8D4516AC19DE394BECF3A816DED7D3FC"
SALT = "aRgDsHyUjGkzgRvdfDFVhtTJqVCD"
import md5
import sha
import base64
import itertools
import string
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
extern crate sha;
use std::default::Default;
use sha::sha1::Sha1;
use sha::utils::{Digest, DigestExt};
use std::thread;
use std::iter;
use std::str::StrExt;
use std::str;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
void server(int sock)
% f : frequency array
% a : amplitude array
% p : phase array
% pm : phase margin
% fp : phase margin frequency
% str : title of the plot
function phasegainplot(f, a, p, Pm, Fp, str)
figure;
subplot(2, 1, 1);
semilogx(f, a);
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <sys/mman.h>
#include <sys/wait.h>
int funTime1()
{
int r;